Search Results

Search found 774 results on 31 pages for 'classpath'.

Page 9/31 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Java - Problem in deploying Web Application

    - by Yatendra Goel
    I have built a Java Web Application and packed it in a .war file and tested it on my local tomcat server and it is running fine. But when I deployed it on my client's server, it is showing an error. According to the remote server (my client's server), it is not finding a tld file packed in a jar file which I had placed in WEB-INF/lib directory. But when I checked the WEB-INF/lib directory for the jar file, i found that it was there. The contents of META-INF/MANIFEST.MF is as follows: Manifest-Version: 1.0 Class-Path: I think that there is no need to explicitly mention the classpath of WEB-INF/lib directory as it is in the classpath of any web application by default. Then, why the server can't find the jar file in the lib directory when I deployed it on a remote server and why it is working when I deployed the same application on my local server. I posted a question for this at http://stackoverflow.com/questions/2441254/struts-1-struts-taglib-jar-is-not-being-found-by-my-web-application but found that the problem is unusual as nobody could answer it. So my questions are as follows: Q1. Is WEB-INF/lib still remains on the classpath if I leave the classpath entry blank as shown above in the MANIFEST.MF file or I should delete the classpath entry completely from the file or I should explicitly enter Class-Path: /WEB-INF/lib as the classpath entry? Q2. I have JSP pages, Servlets and some helper classes in the web application. Jsp pages are located at the root. Servlets and helper classes are located in WEB-INF/classes folder. So Is there any problem if my helper classes are located in the WEB-INF/classes folder? Note: Please note that this question is not same as my previous question. It is a follow-up question of my previous question. Both the servers (local and remote) are tomcat servers.

    Read the article

  • Compiling GWT 2.6.1 at Java 7 source level

    - by Neeko
    I've recently updated my GWT project to 2.6.1, and started to make use of Java 7 syntax since 2.6 now supports Java 7. However, when I attempt to compile, I'm receiving compiler errors such as [ERROR] Line 42: '<>' operator is not allowed for source level below 1.7 How do I specify the GWT compiler to target 1.7? I was under the impression that it would do that by default, but I guess not. I've attempted cleaning the project, including deleting the gwt-unitCache directory but to no avail. Here is my Ant compile target. <target name="compile" depends="prepare"> <javac includeantruntime="false" debug="on" debuglevel="lines,vars,source" srcdir="${src.dir}" destdir="${build.dir}"> <classpath refid="project.classpath"/> </javac> </target> <target name="gwt-compile" depends="compile"> <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler"> <classpath> <!-- src dir is added to ensure the module.xml file(s) are on the classpath --> <pathelement location="${src.dir}"/> <pathelement location="${build.dir}"/> <path refid="project.classpath"/> </classpath> <jvmarg value="-Xmx256M"/> <arg value="${gwt.module.name}"/> </java> </target>

    Read the article

  • How do I copy all referenced jars of an eclipse project using ant4eclipse?

    - by interstellar
    I've tried like this (link): <taskdef resource="net/sf/antcontrib/antlib.xml" /> <taskdef resource="net/sf/ant4eclipse/antlib.xml" /> <target name="copy_jars"> <getEclipseClasspath workspace="${basedir}/.." projectname="MyProject" property="classpath" relative="false" runtime="true" pathseparator="#" /> <!-- iterate over all classpath entries --> <foreach list="${classpath}" delimiter="#" target="copy_jar_file" param="classpath.entry" /> </target> <target name="copy_jar_file"> <!-- check if current is a .jar-file ... --> <if> <isfileselected file="${classpath.entry}"> <filename name="**/*.jar" /> </isfileselected> <then> <!-- copy the jar file to a destination directory --> <copy file="${classpath.entry}" tofile="${dest.dir}"/> </then> </if> </target> But I get the exception: [getEclipseClasspath] net.sf.ant4eclipse.model.FileParserException: Could not parse plugin project 'E:\...\MyProject' since it contains neither a Bundle-Manifest nor a plugin.xml! [getEclipseClasspath] at net.sf.ant4eclipse.model.pdesupport.plugin.PluginDescriptorParser.parseEclipseProject(Unknown Source) [getEclipseClasspath] at net.sf.ant4eclipse.model.pdesupport.plugin.PluginProjectRoleIdentifier.applyRole(Unknown Source) [getEclipseClasspath] at net.sf.ant4eclipse.model.roles.RoleIdentifierRegistry.applyRoles(Unknown Source) [getEclipseClasspath] at net.sf.ant4eclipse.tools.ProjectFactory.readProjectFromWorkspace(Unknown Source) [getEclipseClasspath] at net.sf.ant4eclipse.tools.resolver.AbstractClasspathResolver.resolveEclipseClasspathEntry(Unknown Source) [getEclipseClasspath] at net.sf.ant4eclipse.tools.resolver.AbstractClasspathResolver.resolveProjectClasspath(Unknown Source) [getEclipseClasspath] at net.sf.ant4eclipse.tools.resolver.ProjectClasspathResolver.resolveProjectClasspath(Unknown Source) [getEclipseClasspath] at net.sf.ant4eclipse.ant.task.project.GetEclipseClassPathTask.resolvePath(Unknown Source) [getEclipseClasspath] at net.sf.ant4eclipse.ant.task.project.AbstractGetProjectPathTask.execute(Unknown Source) [getEclipseClasspath] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) [getEclipseClasspath] at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) [getEclipseClasspath] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [getEclipseClasspath] at java.lang.reflect.Method.invoke(Method.java:597) [getEclipseClasspath] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105) [getEclipseClasspath] at org.apache.tools.ant.Task.perform(Task.java:348) [getEclipseClasspath] at org.apache.tools.ant.Target.execute(Target.java:357) [getEclipseClasspath] at org.apache.tools.ant.Target.performTasks(Target.java:385) [getEclipseClasspath] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) [getEclipseClasspath] at org.apache.tools.ant.Project.executeTarget(Project.java:1298) [getEclipseClasspath] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) [getEclipseClasspath] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32) [getEclipseClasspath] at org.apache.tools.ant.Project.executeTargets(Project.java:1181) [getEclipseClasspath] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423) [getEclipseClasspath] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137) BUILD FAILED E:\...\build.xml:132: Exception whilst resolving the classpath of project MyProject! Reason: Could not parse plugin project 'E:\...\MyProject' since it contains neither a Bundle-Manifest nor a plugin.xml! I wan't to copy just the jars, not the referenced projects. Is there a way to parametrize the task getEclipseClasspath so it only gets the jars, not the projects?

    Read the article

  • How to load the environment variables at boot time before X11 on Ubuntu Precise?

    - by Fnux
    Using Ubuntu Precise 64 bit, I'm facing a problem that I'm unable to solve and that I'll try to describe below: I'm using a console mode program (let's say abc) that uses Go, NodeJS, Java and Scala. In order for abc to work with these languages, I've to declare the following statements: a) within /etc/environment: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin" CLASSPATH=$CLASSPATH:/usr/share/java/scala-library.jar b) within /etc/login.defs ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin ENV_PATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin c) a) within /etc/sudoers: `# env_reset Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin"` Then, when I start abc from a terminal, all is fine and I can use any of the 4 languages described above. However, if I put a script within /etc/init.d that starts abc during the boot process (i.e. before to start the GUI), using Java from abc still is fine, but using Go, NodeJS or Scala doesn't work anymore. Then, I guess that during the boot process, the script within /etc/init.d that starts abc is executed before that the different environment variables set within /etc/sudoers, /etc/environment and /etc/login.defs are loaded. So, my question is: how to force the environment variables to be loaded before that my script starting abc is launched? Any help and advice on this topic would be trully appreciated. TIA. Cheers. Thanks again to Mark and Danila. Below is the current "abc" script file that I put within /etc/init.d `#! /bin/sh ### EDIT: ADD THIS VARS DEFINITIONS: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin" CLASSPATH=$CLASSPATH:/usr/share/java/scala-library.jar "ENV_SUPATH PATH"="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin" "ENV_PATH PATH"="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin" "Defaults secure_path"="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin" ##### EXPORT this VARS so they are accessible to children:" export "PATH" "CLASSPATH" "ENV_SUPATH PATH" "ENV_PATH PATH" "Defaults secure_path" `### BEGIN INIT INFO `# Provides: abc `# Required-Start: $remote_fs $syslog `# Required-Stop: $remote_fs $syslog `# Default-Start: 2 3 4 5 `# Default-Stop: 0 1 6 `# Short-Description: abc initscript `# Description: This iniscript starts and stops abc `### END INIT INFO `# Author: Fnux, fnux.fl at gmail dot com `# Version: 1.2 `# Note: (edit ABC_PATH if abc isn't installed in /opt/abc) NAME=abc ABC_PATH=/opt/abc START="-d" STOP="-k" VERSION="-v" SCRIPTNAME=/etc/init.d/$NAME STARTMESG="\nStarting abc in deamon mode." UPMESG="\n$NAME is running." DOWNMESG="\n$NAME is not running." STATUS=`pidof $NAME` `# Exit if abc is not installed [ -x "$ABC_PATH/$NAME" ] || exit 0 case "$1" in start) echo $STARTMESG cd $ABC_PATH ./$NAME $START ;; stop) cd $ABC_PATH ./$NAME $STOP ;; status) if [ "$STATUS" > 0 ] ; then echo $UPMESG else echo $DOWNMESG fi ;; restart) cd $ABC_PATH ./$NAME $STOP echo $STARTMESG ./$NAME $START ;; version) cd $ABC_PATH ./$NAME $VERSION ;; *) echo "Usage: $SCRIPTNAME {start|status|restart|stop|version}" >&2 exit 3 ;; esac : So, where and how should I write the needed environment variables for: a) Go needs the following statements (ie: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin" ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin ENV_PATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin `# env_reset Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin") b) and Scala needs this one: (ie CLASSPATH=$CLASSPATH:/usr/share/java/scala-library.jar). TIA for an explanation how to do so. Cheers.

    Read the article

  • Java Class path problem in cent os..

    - by Ramesh
    I have installed java in centos5 classpath is not working .... my bash_profile export PATH=$PATH:/zzz/jdk1.6.0_03/bin/ export JAVA_HOME=/zzz/jdk1.6.0_03/bin/java/ export CLASSPATH=$CLASSPATH:/zzz/aa/mysql.jar:. java -version java version "1.6.0" OpenJDK Runtime Environment (build 1.6.0-b09) OpenJDK Server VM (build 1.6.0-b09, mixed mode)

    Read the article

  • Configuring ant to run unit tests. Where should libraries be? How should classpath be configured? av

    - by chillitom
    Hi All, I'm trying to run my junit tests using ant. The tests are kicked off using a JUnit 4 test suite. If I run this direct from Eclipse the tests complete without error. However if I run it from ant then many of the tests fail with this error repeated over and over until the junit task crashes. [junit] java.util.zip.ZipException: error in opening zip file [junit] at java.util.zip.ZipFile.open(Native Method) [junit] at java.util.zip.ZipFile.(ZipFile.java:114) [junit] at java.util.zip.ZipFile.(ZipFile.java:131) [junit] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1028) [junit] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:147) [junit] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.nextElement(AntClassLoader.java:130) [junit] at org.apache.tools.ant.util.CollectionUtils$CompoundEnumeration.nextElement(CollectionUtils.java:198) [junit] at sun.misc.CompoundEnumeration.nextElement(CompoundEnumeration.java:43) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.checkForkedPath(JUnitTask.java:1128) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeAsForked(JUnitTask.java:1013) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:834) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue(JUnitTask.java:1785) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:785) [junit] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) [junit] at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [junit] at java.lang.reflect.Method.invoke(Method.java:597) [junit] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [junit] at org.apache.tools.ant.Task.perform(Task.java:348) [junit] at org.apache.tools.ant.Target.execute(Target.java:357) [junit] at org.apache.tools.ant.Target.performTasks(Target.java:385) [junit] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337) [junit] at org.apache.tools.ant.Project.executeTarget(Project.java:1306) [junit] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) [junit] at org.apache.tools.ant.Project.executeTargets(Project.java:1189) [junit] at org.apache.tools.ant.Main.runBuild(Main.java:758) [junit] at org.apache.tools.ant.Main.startAnt(Main.java:217) [junit] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) [junit] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) my test running task is as follows: <target name="run-junit-tests" depends="compile-tests,clean-results"> <mkdir dir="${test.results.dir}"/> <junit failureproperty="tests.failed" fork="true" showoutput="yes" includeantruntime="false"> <classpath refid="test.run.path" /> <formatter type="xml" /> <test name="project.AllTests" todir="${basedir}/test-results" /> </junit> <fail if="tests.failed" message="Unit tests failed"/> </target> I've verified that the classpath contains the following as well as all of the program code and libraries: ant-junit.jar ant-launcher.jar ant.jar easymock.jar easymockclassextension.jar junit-4.4.jar I've tried debugging to find out which ZipFile it is trying to open with no luck, I've tried toggling includeantruntime and fork and i've tried running ant with ant -lib test/libs where test/libs contains the ant and junit libraries. Any info about what causes this exception or how you've configured ant to successfully run unit tests is gratefully received. ant 1.7.1 (ubuntu), java 1.6.0_10, junit 4.4 Thanks. Update - Fixed Found my problem. I had included my classes directory in my path using a fileset as opposed to a pathelement this was causing .class files to be opened as ZipFiles which of course threw an exception.

    Read the article

  • web.xml not reloading in tomcat even after stop/start

    - by ajay
    This is in relation to:- http://stackoverflow.com/questions/2576514/basic-tomcat-servlet-error I changed my web.xml file, did ant compile , all, /etc/init.d/tomcat stop , start Even then my web.xml file in tomcat deployment is still unchanged. This is build.properties file:- app.name=hello catalina.home=/usr/local/tomcat manager.username=admin manager.password=admin This is my build.xml file. Is there something wrong with this:- <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- General purpose build script for web applications and web services, including enhanced support for deploying directly to a Tomcat 6 based server. This build script assumes that the source code of your web application is organized into the following subdirectories underneath the source code directory from which you execute the build script: docs Static documentation files to be copied to the "docs" subdirectory of your distribution. src Java source code (and associated resource files) to be compiled to the "WEB-INF/classes" subdirectory of your web applicaiton. web Static HTML, JSP, and other content (such as image files), including the WEB-INF subdirectory and its configuration file contents. $Id: build.xml.txt 562814 2007-08-05 03:52:04Z markt $ --> <!-- A "project" describes a set of targets that may be requested when Ant is executed. The "default" attribute defines the target which is executed if no specific target is requested, and the "basedir" attribute defines the current working directory from which Ant executes the requested task. This is normally set to the current working directory. --> <project name="My Project" default="compile" basedir="."> <!-- ===================== Property Definitions =========================== --> <!-- Each of the following properties are used in the build script. Values for these properties are set by the first place they are defined, from the following list: * Definitions on the "ant" command line (ant -Dfoo=bar compile). * Definitions from a "build.properties" file in the top level source directory of this application. * Definitions from a "build.properties" file in the developer's home directory. * Default definitions in this build.xml file. You will note below that property values can be composed based on the contents of previously defined properties. This is a powerful technique that helps you minimize the number of changes required when your development environment is modified. Note that property composition is allowed within "build.properties" files as well as in the "build.xml" script. --> <property file="build.properties"/> <property file="${user.home}/build.properties"/> <!-- ==================== File and Directory Names ======================== --> <!-- These properties generally define file and directory names (or paths) that affect where the build process stores its outputs. app.name Base name of this application, used to construct filenames and directories. Defaults to "myapp". app.path Context path to which this application should be deployed (defaults to "/" plus the value of the "app.name" property). app.version Version number of this iteration of the application. build.home The directory into which the "prepare" and "compile" targets will generate their output. Defaults to "build". catalina.home The directory in which you have installed a binary distribution of Tomcat 6. This will be used by the "deploy" target. dist.home The name of the base directory in which distribution files are created. Defaults to "dist". manager.password The login password of a user that is assigned the "manager" role (so that he or she can execute commands via the "/manager" web application) manager.url The URL of the "/manager" web application on the Tomcat installation to which we will deploy web applications and web services. manager.username The login username of a user that is assigned the "manager" role (so that he or she can execute commands via the "/manager" web application) --> <property name="app.name" value="myapp"/> <property name="app.path" value="/${app.name}"/> <property name="app.version" value="0.1-dev"/> <property name="build.home" value="${basedir}/build"/> <property name="catalina.home" value="../../../.."/> <!-- UPDATE THIS! --> <property name="dist.home" value="${basedir}/dist"/> <property name="docs.home" value="${basedir}/docs"/> <property name="manager.url" value="http://localhost:8080/manager"/> <property name="src.home" value="${basedir}/src"/> <property name="web.home" value="${basedir}/web"/> <!-- ==================== External Dependencies =========================== --> <!-- Use property values to define the locations of external JAR files on which your application will depend. In general, these values will be used for two purposes: * Inclusion on the classpath that is passed to the Javac compiler * Being copied into the "/WEB-INF/lib" directory during execution of the "deploy" target. Because we will automatically include all of the Java classes that Tomcat 6 exposes to web applications, we will not need to explicitly list any of those dependencies. You only need to worry about external dependencies for JAR files that you are going to include inside your "/WEB-INF/lib" directory. --> <!-- Dummy external dependency --> <!-- <property name="foo.jar" value="/path/to/foo.jar"/> --> <!-- ==================== Compilation Classpath =========================== --> <!-- Rather than relying on the CLASSPATH environment variable, Ant includes features that makes it easy to dynamically construct the classpath you need for each compilation. The example below constructs the compile classpath to include the servlet.jar file, as well as the other components that Tomcat makes available to web applications automatically, plus anything that you explicitly added. --> <path id="compile.classpath"> <!-- Include all JAR files that will be included in /WEB-INF/lib --> <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** --> <!-- <pathelement location="${foo.jar}"/> --> <!-- Include all elements that Tomcat exposes to applications --> <fileset dir="${catalina.home}/bin"> <include name="*.jar"/> </fileset> <pathelement location="${catalina.home}/lib"/> <fileset dir="${catalina.home}/lib"> <include name="*.jar"/> </fileset> </path> <!-- ================== Custom Ant Task Definitions ======================= --> <!-- These properties define custom tasks for the Ant build tool that interact with the "/manager" web application installed with Tomcat 6. Before they can be successfully utilized, you must perform the following steps: - Copy the file "lib/catalina-ant.jar" from your Tomcat 6 installation into the "lib" directory of your Ant installation. - Create a "build.properties" file in your application's top-level source directory (or your user login home directory) that defines appropriate values for the "manager.password", "manager.url", and "manager.username" properties described above. For more information about the Manager web application, and the functionality of these tasks, see <http://localhost:8080/tomcat-docs/manager-howto.html>. --> <taskdef resource="org/apache/catalina/ant/catalina.tasks" classpathref="compile.classpath"/> <!-- ==================== Compilation Control Options ==================== --> <!-- These properties control option settings on the Javac compiler when it is invoked using the <javac> task. compile.debug Should compilation include the debug option? compile.deprecation Should compilation include the deprecation option? compile.optimize Should compilation include the optimize option? --> <property name="compile.debug" value="true"/> <property name="compile.deprecation" value="false"/> <property name="compile.optimize" value="true"/> <!-- ==================== All Target ====================================== --> <!-- The "all" target is a shortcut for running the "clean" target followed by the "compile" target, to force a complete recompile. --> <target name="all" depends="clean,compile" description="Clean build and dist directories, then compile"/> <!-- ==================== Clean Target ==================================== --> <!-- The "clean" target deletes any previous "build" and "dist" directory, so that you can be ensured the application can be built from scratch. --> <target name="clean" description="Delete old build and dist directories"> <delete dir="${build.home}"/> <delete dir="${dist.home}"/> </target> <!-- ==================== Compile Target ================================== --> <!-- The "compile" target transforms source files (from your "src" directory) into object files in the appropriate location in the build directory. This example assumes that you will be including your classes in an unpacked directory hierarchy under "/WEB-INF/classes". --> <target name="compile" depends="prepare" description="Compile Java sources"> <!-- Compile Java classes as necessary --> <mkdir dir="${build.home}/WEB-INF/classes"/> <javac srcdir="${src.home}" destdir="${build.home}/WEB-INF/classes" debug="${compile.debug}" deprecation="${compile.deprecation}" optimize="${compile.optimize}"> <classpath refid="compile.classpath"/> </javac> <!-- Copy application resources --> <copy todir="${build.home}/WEB-INF/classes"> <fileset dir="${src.home}" excludes="**/*.java"/> </copy> </target> <!-- ==================== Dist Target ===================================== --> <!-- The "dist" target creates a binary distribution of your application in a directory structure ready to be archived in a tar.gz or zip file. Note that this target depends on two others: * "compile" so that the entire web application (including external dependencies) will have been assembled * "javadoc" so that the application Javadocs will have been created --> <target name="dist" depends="compile,javadoc" description="Create binary distribution"> <!-- Copy documentation subdirectories --> <mkdir dir="${dist.home}/docs"/> <copy todir="${dist.home}/docs"> <fileset dir="${docs.home}"/> </copy> <!-- Create application JAR file --> <jar jarfile="${dist.home}/${app.name}-${app.version}.war" basedir="${build.home}"/> <!-- Copy additional files to ${dist.home} as necessary --> </target> <!-- ==================== Install Target ================================== --> <!-- The "install" target tells the specified Tomcat 6 installation to dynamically install this web application and make it available for execution. It does *not* cause the existence of this web application to be remembered across Tomcat restarts; if you restart the server, you will need to re-install all this web application. If you have already installed this application, and simply want Tomcat to recognize that you have updated Java classes (or the web.xml file), use the "reload" target instead. NOTE: This target will only succeed if it is run from the same server that Tomcat is running on. NOTE: This is the logical opposite of the "remove" target. --> <target name="install" depends="compile" description="Install application to servlet container"> <deploy url="${manager.url}" username="${manager.username}" password="${manager.password}" path="${app.path}" localWar="file://${build.home}"/> </target> <!-- ==================== Javadoc Target ================================== --> <!-- The "javadoc" target creates Javadoc API documentation for the Java classes included in your application. Normally, this is only required when preparing a distribution release, but is available as a separate target in case the developer wants to create Javadocs independently. --> <target name="javadoc" depends="compile" description="Create Javadoc API documentation"> <mkdir dir="${dist.home}/docs/api"/> <javadoc sourcepath="${src.home}" destdir="${dist.home}/docs/api" packagenames="*"> <classpath refid="compile.classpath"/> </javadoc> </target> <!-- ====================== List Target =================================== --> <!-- The "list" target asks the specified Tomcat 6 installation to list the currently running web applications, either loaded at startup time or installed dynamically. It is useful to determine whether or not the application you are currently developing has been installed. --> <target name="list" description="List installed applications on servlet container"> <list url="${manager.url}" username="${manager.username}" password="${manager.password}"/> </target> <!-- ==================== Prepare Target ================================== --> <!-- The "prepare" target is used to create the "build" destination directory, and copy the static contents of your web application to it. If you need to copy static files from external dependencies, you can customize the contents of this task. Normally, this task is executed indirectly when needed. --> <target name="prepare"> <!-- Create build directories as needed --> <mkdir dir="${build.home}"/> <mkdir dir="${build.home}/WEB-INF"/> <mkdir dir="${build.home}/WEB-INF/classes"/> <!-- Copy static content of this web application --> <copy todir="${build.home}"> <fileset dir="${web.home}"/> </copy> <!-- Copy external dependencies as required --> <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** --> <mkdir dir="${build.home}/WEB-INF/lib"/> <!-- <copy todir="${build.home}/WEB-INF/lib" file="${foo.jar}"/> --> <!-- Copy static files from external dependencies as needed --> <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** --> </target> <!-- ==================== Reload Target =================================== --> <!-- The "reload" signals the specified application Tomcat 6 to shut itself down and reload. This can be useful when the web application context is not reloadable and you have updated classes or property files in the /WEB-INF/classes directory or when you have added or updated jar files in the /WEB-INF/lib directory. NOTE: The /WEB-INF/web.xml web application configuration file is not reread on a reload. If you have made changes to your web.xml file you must stop then start the web application. --> <target name="reload" depends="compile" description="Reload application on servlet container"> <reload url="${manager.url}" username="${manager.username}" password="${manager.password}" path="${app.path}"/> </target> <!-- ==================== Remove Target =================================== --> <!-- The "remove" target tells the specified Tomcat 6 installation to dynamically remove this web application from service. NOTE: This is the logical opposite of the "install" target. --> <target name="remove" description="Remove application on servlet container"> <undeploy url="${manager.url}" username="${manager.username}" password="${manager.password}" path="${app.path}"/> </target> </project>

    Read the article

  • Regarding Shell Script

    - by arav
    I have the below line in the unix shell script. I want to exclude test.jar in WEB-INF/lib being added to the CLASSPATH. How can i do it? for file in WEB-INF/lib/*jar ; do CLASSPATH=$CLASSPATH:$PWD/$file done

    Read the article

  • java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

    - by Nitin Garg
    I am trying to connect to mysql database using java on windows7. Inspite of adding the complete url of jdbcdriver jar file in CLASSPATH, java.lang.ClassNotFoundException: com.mysql.jdbc.Driver is thrown. Could anyone tell me what i am missing here?? it works if i add the jar file in project library but i want to do it by CLASSPATH itself. My classpath looks like this- C:\jython2.5.1\javalib\mysql-connector-java-5.1.12-bin.jar

    Read the article

  • Execute a jar file using Ant

    - by geetha
    I am trying to create a runnable jar file from java classes using ant. The java classes use external jars. When I execute the build.xml its showing class not found exception while running the java program. Its compiling fine. Part of My source code: <path id="project-libpath"> <fileset dir="${lib.dir}"> <include name="*.jar"/> </fileset> </path> <path id="project-classpath"> <fileset dir="C:/xmldecode/lib"> <include name="*.jar"/> </fileset> </path> <target name="compile" depends="prepare"> <javac srcdir="${src.dir}" destdir="${classes.dir}"> <classpath refid="project-classpath"/> </javac> </target> <target name="jar" depends="compile"> <copy todir="${classes.dir}"> <fileset dir="C:/xmldecode/lib"/> </copy> <pathconvert property="mf.classpath" pathsep=";"> <path refid="project-classpath" /> <flattenmapper /> </pathconvert> <jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}"> <manifest> <attribute name="Main-Class" value="${main-class}"/> <attribute name="Class-Path" value="${mf.classpath}"/> </manifest> </jar> </target> <target name="run" depends="jar"> <java jar="${jar.dir}/${ant.project.name}.jar" fork="true"> </java>

    Read the article

  • OSGi bundle imports packages from non-bundle jars: create bundles for them?

    - by John Simmons
    I am new to OSGi, and am using Equinox. I have done several searches and can find no answer to this. The discussion at OSGI - handling 3rd party JARs required by a bundle helps somewhat, but does not fully answer my question. I have obtained a jar file, rabbitmq-client.jar, that is already packaged as an OSGi bundle (with Bundle-Name and other such properties in its MANIFEST.MF), that I would like to install as a bundle. This jar imports packages org.apache.commons.io and org.apache.commons.io.input from commons-io-1.2.jar. The RabbitMQ client 2.7.1 distribution also includes commons-cli-1.1.jar, so I presume that it is required as well. I examined the manifests of these commons jars and found that they do not appear to be packaged as bundles. That is, their manifests have none of the standard bundle properties. My specific question is: if I install rabbitmq-client.jar as a bundle, what is the proper way to get access to the packages that it needs to import from the commons jars? There are only three alternatives that I can think of, without rebuilding rabbitmq-client.jar. The packages from the commons jars are already included in the Equinox global classpath, and rabbitmq-client.jar will get them automatically from there. I must make another bundle with the two commons jars, export the needed packages, and install that bundle in Equinox. I must put these two commons jars in the global classpath when I start Equinox, and they will be available to rabbitmq-client.jar from there. I have read that one normally does not use the global classpath in an OSGi container. I am not clear on whether items from the global classpath are even available when building individual bundle classpaths. However, I note that rabbitmq-client.jar also imports other packages such as javax.net, which I presume come from the global classpath. Or is there some other bundle that exports them? Thanks for any assistance!

    Read the article

  • How to install JavaFx in Ubuntu 12.04?

    - by Ant's
    I download JavaFx from here. I placed it in my home directory(anto) under the name javafx. Then I did something like this : vi ~/.bashrc and added the following lines: javaFx_home=/anto/javafx/rt/lib/jfxrt.jar export PATH=$PATH:$javaFx_home But after providing the classpath, I tried running : groovy MyProgram (which depends on the JavaFx classpath). But that throws me an error. Where I went wrong?

    Read the article

  • Groovy Grapes in NetBeans IDE

    - by Geertjan
    The start of Groovy Grapes support in NetBeans IDE. Below you see a pure Groovy project, with the Groovy JAR and the Ivy JAR automatically on its classpath. There's also a Groovy script that makes use of a @Grab annotation. In the bottom left, in the Services window, you also see a Grape Repository browser, i.e., showing you the JARs that are currently in ".groovy/grapes". Click the images below to get a better look at them. Next, you see what happens when the project is run. The @Grab annotation automatically starts downloading the JARs that are needed and puts them into the ".groovy/grapes" folder. However, the "no suitable classloader found for grab" error message (which Google shows is a problem for lots of developers) prevents the application from running successfully: The final screenshot shows that I've put the JARs that I need onto the classpath of the project. I did that manually, hoping to learn from the NetBeans Maven project or the NetBeans Gradle project how to do that automatically. Also note that the @Grab annotation has been commented out. Now the error message about the classloader is avoided and the project runs. What needs to happen for Groovy Grapes support to be complete in NetBeans IDE: Figure out how to add the downloaded JARs to the project classpath automatically. Fix the refresh problem in the Grape Repository browser, i.e., right now the refresh doesn't happen automatically yet. Hopefully find a way to get around the grab classloader problem, i.e., it's not ideal that one needs to comment out the annotation. Let the user specify a different Grape repository, i.e., right now ".groovy/grapes" is assumed, but the user should be able to point the repository browser to something different. Maybe there should be support for multiple Grape repositories? Comments/feedback/help is welcome.

    Read the article

  • Does JUnit4 testclasses require a public no arg constructor?

    - by Thomas Baun
    I have a test class, written in JUnit4 syntax, that can be run in eclipse with the "run as junit test" option without failing. When I run the same test via an ant target I get this error: java.lang.Exception: Test class should have public zero-argument constructor at org.junit.internal.runners.MethodValidator.validateNoArgConstructor(MethodValidator.java:54) at org.junit.internal.runners.MethodValidator.validateAllMethods(MethodValidator.java:39) at org.junit.internal.runners.TestClassRunner.validate(TestClassRunner.java:33) at org.junit.internal.runners.TestClassRunner.<init>(TestClassRunner.java:27) at org.junit.internal.runners.TestClassRunner.<init>(TestClassRunner.java:20) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26) at junit.framework.JUnit4TestAdapter.<init>(JUnit4TestAdapter.java:24) at junit.framework.JUnit4TestAdapter.<init>(JUnit4TestAdapter.java:17) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:386) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:911) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:768) Caused by: java.lang.NoSuchMethodException: dk.gensam.gaia.business.bonusregulering.TestBonusregulerAftale$Test1Reader.<init>() at java.lang.Class.getConstructor0(Class.java:2706) at java.lang.Class.getConstructor(Class.java:1657) at org.junit.internal.runners.MethodValidator.validateNoArgConstructor(MethodValidator.java:52) I have no public no arg constructor in the class, but is this really necessary? This is my ant target <target name="junit" description="Execute unit tests" depends="compile, jar-test"> <delete dir="tmp/rawtestoutput"/> <delete dir="test-reports"/> <mkdir dir="tmp/rawtestoutput"/> <junit printsummary="true" failureproperty="junit.failure" fork="true"> <classpath refid="class.path.test"/> <classpath refid="class.path.model"/> <classpath refid="class.path.gui"/> <classpath refid="class.path.jfreereport"/> <classpath path="tmp/${test.jar}"></classpath> <batchtest todir="tmp/rawtestoutput"> <fileset dir="${build}/test"> <include name="**/*Test.class" /> <include name="**/Test*.class" /> </fileset> </batchtest> </junit> <junitreport todir="tmp"> <fileset dir="tmp/rawtestoutput"/> <report todir="test-reports"/> </junitreport> <fail if="junit. failure" message="Unit test(s) failed. See reports!"/> </target> The test class have no constructors, but it has an inner class with default modifier. It also have an anonymouse inner class. Both inner classes gives the "Test class should have public zero-argument constructor error". I am using Ant version 1.7.1 and JUnit 4.7

    Read the article

  • Error running java -jar command

    - by dmantamp
    Hi all, I created a jar file using the following ANT script <manifestclasspath property="jar.classpath" jarfile="${bin.dir}/${jar.app.name}" maxparentlevels="0"> <classpath refid="main.class.path" /> </manifestclasspath> <target name="jar"> <mkdir dir="${build.dir}/lib/isp"/> <mkdir dir="${build.dir}/lib/jasper"/> <copy todir="${build.dir}/lib/jasper"> <fileset dir="${lib.jasper.dir}"> <include name="**/*.jar" /> </fileset> </copy> <copy todir="${build.dir}/lib/isp"> <fileset dir="${lib.isp.dir}"> <include name="**/*.jar" /> </fileset> </copy> <jar jarfile="${bin.dir}/${jar.app.name}" index="true" basedir="${classes.dir}" excludes="lib/mytest.jar " > <manifest> <attribute name="Main-Class" value="${main.class}" /> <attribute name="Class-Path" value="${jar.classpath}" /> </manifest> </jar> </target> The resulting jar file has the following MANIFEST.MF entry. Main-Class: dm.jb.Main Class-Path: lib/isp/OfficeLnFs_2.2.jar lib/isp/RXTXcomm.jar lib/isp/ba rbecue-1.0.6d.jar lib/isp/commons-logging-1.1.jar lib/isp/forms-1.0.5 .jar lib/isp/gnujaxp.jar lib/isp/helpUI.jar lib/isp/inspInstaller.jar lib/isp/itext-2.0.1.jar lib/isp/itext-2.0.2.jar lib/isp/jcalendar-1. 3.2.jar lib/isp/jcl.jar lib/isp/jcommon-1.0.10.jar lib/isp/jcommon-1. 0.9.jar lib/isp/jdnc-0_7-all.jar lib/isp/jdnc-runner.jar lib/isp/jdom .jar lib/isp/jfreechart-1.0.6.jar lib/isp/jlfgr-1_0.jar lib/isp/junit .jar lib/isp/log4j-1.2.9.jar lib/isp/looks-1.3.2.jar lib/isp/msbase.j ar lib/isp/mssqlserver.jar lib/isp/msutil.jar lib/isp/mysql-connector When I try to run the command java -jar mytest.jar, it fails and throws error saying dm.jb.Main not found. But I could run the class by specifying the classpath java -classpath dm.jb.Main Please help me DM

    Read the article

  • Build path issues learning Guice

    - by Preston
    I can't figure out why I'm getting this error below I have included all the appropriate jars as far as I can tell(I have included eclipses .classpath file below.) All of the classpath entries resolve just fine. What am I missing? The type javax.servlet.ServletContextListener cannot be resolved. It is indirectly referenced from required .class files on the "extends GuiceServletContextListener" line - import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.servlet.GuiceServletContextListener; import com.google.inject.servlet.ServletModule; public class ServletConfig extends GuiceServletContextListener { @Override protected Injector getInjector() { return Guice.createInjector(new ServletModule(){ @Override protected void configureServlets() { // TODO: add necessary code to bind } }); } } .Classpath <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_21"> <attributes> <attribute name="owner.project.facets" value="java"/> </attributes> </classpathentry> <classpathentry kind="con" path="oracle.eclipse.tools.glassfish.lib.system"> <attributes> <attribute name="owner.project.facets" value="jst.web"/> </attributes> </classpathentry> <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> <classpathentry kind="lib" path="guice-3.0/aopalliance.jar"/> <classpathentry kind="lib" path="guice-3.0/guice-3.0.jar"/> <classpathentry kind="lib" path="guice-3.0/guice-servlet-3.0.jar"/> <classpathentry kind="lib" path="guice-3.0/javax.inject.jar"/> <classpathentry kind="output" path="build/classes"/> </classpath>

    Read the article

  • Error in simple Java application

    - by mrblah
    Just playing around with java trying to learn it etc. Here is my code so far, using HtmlUnit. package hsspider; import com.gargoylesoftware.htmlunit.WebClient; /** * @author */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { System.out.println("starting "); Spider spider = new Spider(); spider.Test(); } } package hsspider; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlPage; /** * @author */ public class Spider { public void Test() throws Exception { final WebClient webClient = new WebClient(); final HtmlPage page = webClient.getPage("http://www.google.com"); System.out.println(page.getTitleText()); } } I am using Netbeans. I can't seem to figure out what the problem is, why doesn't it compile? The error: C:\Users\mrblah\.netbeans\6.8\var\cache\executor-snippets\run.xml:45: Cancelled by user. BUILD FAILED (total time: 0 seconds) The row in the xml is: <translate-classpath classpath="${classpath}" targetProperty="classpath-translated" />

    Read the article

  • Layout of Ant build.xml with junit tests

    - by Derk
    In a project I have a folder src for all application source code and a different folder test for all junit test (both with a simular package hierarchy). Now I want that Ant can run all tests in in test folder, bot the problem is that now also files in the src folder with "Test" in the filename are included. This is the test target in the build.xml: <target name="test" depends="build"> <mkdir dir="reports/tests" /> <junit fork="yes" printsummary="yes"> <formatter type="xml"/> <classpath> <path location="${build}/WEB-INF/classes"/> <fileset dir="${projectname.home}/lib"> <include name="servlet-api.jar"/> <include name="httpunit.jar"/> <include name="Tidy.jar"/> <include name="js.jar"/> <include name="junit.jar"/> </fileset> </classpath> <batchtest todir="reports/tests"> <fileset dir="${build}/WEB-INF/classes"> <include name="**/*Test.class"/> </fileset> </batchtest> </junit> And I have added the test folder to the build target: <target name="build" depends="init,init-props,prepare"> <javac source="1.5" debug="true" destdir="${build}/WEB-INF/classes"> <src path="src" /> <src path="test" /> <classpath refid="classpath"/> </javac> </target>

    Read the article

  • How to macro-ify ant targets?

    - by Jonas Byström
    I want to be able to have different targets doing nearly the same thing, as so: ant build <- this would be a normal (default) build ant safari <- building the safari target. The targets look like this: <target name="build" depends="javac" description="GWT compile to JavaScript"> <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler"> <classpath> <pathelement location="src"/> <path refid="project.class.path"/> </classpath> <jvmarg value="-Xmx256M"/> <arg value="${lhs.target}"/> </java> </target> <target name="safari" depends="javac" description="GWT compile to Safari/JavaScript"> <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler"> <classpath> <pathelement location="src"/> <path refid="project.class.path"/> </classpath> <jvmarg value="-Xmx256M"/> <arg value="${lhs.safari.target}"/> </java> </target> (Nevermind the first thought that strikes: throw out ant! That's not an option just yet.) I tried using macrodef, but got a strange error message (even though the message didn't imply it, it think it had to do with putting a target in sequential). I don't want to do ant -Dwhatever=nevermind. Any ideas?

    Read the article

  • Granite DS Actionscript Code Generation Ant cannot find class error

    - by Roaders
    I am trying to get my Ant build to run the granite DS Actionscript code generation task and am running into some problems. At the moment I am getting this error: BUILD FAILED C...\build.xml:62: Could not load Java class file: SampleDTOOne.class So the .class files are obviously being found. I am not however sure if this error means that the it cannot load the .class file or that it cannot find the actual java source code. My Ant task definition looks like this: <classpath> <pathelement location="C.../src/packages/" /> </classpath> <fileset dir="${base.build.dir}/jc/classes/gpbit/packageName"> <include name="*.class" /> </fileset> </gas3> I have tried many different values for the classpath but cannot get anythign to work. I do not like the path that I am using to find the .class files but again at the moment this is the only one I can get to work. None of the variables seem to make it any easier to get to this location. The fileset is definitely working as it definitely found the .clas files to include the name in the error message. More detailed error message: [gas3] Using output dir: C...trunk\plugin\build/etc/src/as3 [gas3] Using classpath: C...\trunk\plugin\src\packages [gas3] Loading all Java classes referenced by inner fileset(s) { [gas3] java.lang.ClassNotFoundException: SampleDTOOne [gas3] at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1361) any help much appreciated

    Read the article

  • How can I get JUnit test (driven from Ant script) to dump the stack of exception that causes failure

    - by Matt Wang
    We run JUnit test from Ant script, as follows. When the test failed, I expect it to output the stack dump of the exception that casuses the failure, but it doesn't. Is there any trick to get it dumped? <target description="Run JUnit tests" name="run-junit" depends="build-junit"> <copy file="./AegisLicense.txt" tofile="test/junit/classes/AegisLicense.txt" overwrite="true"/> <junit printsummary="yes" haltonfailure="no" fork="yes" forkmode="once" failureproperty="run-aegis-junit-failed" showoutput="yes" filtertrace="off"> <classpath refid="Aegisoft.testsupport.classpath"/> <classpath> <pathelement location="test/junit/classes"/> </classpath> <batchtest> <fileset dir="test/junit/src"> <include name="**"/> </fileset> </batchtest> </junit> <fail

    Read the article

  • Very basic running of drools 5, basic setup and quickstart

    - by Berlin Brown
    Is there a more comprehensive quick start for drools 5. I was attempting to run the simple Hello World .drl rule but I wanted to do it through an ant script, possibly with just javac/java: I get the following error: Note: I don't am running completely without Eclipse or any other IDE: Is there a more comprehensive quick start for drools 5. I was attempting to run the simple Hello World .drl rule but I wanted to do it through an ant script, possibly with just javac/java: I get the following error: Note: I don't am running completely without Eclipse or any other IDE: test: [java] Exception in thread "main" org.drools.RuntimeDroolsException: Unable to load d ialect 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java:org.drools.rule .builder.dialect.java.JavaDialectConfiguration' [java] at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuild erConfiguration.java:274) [java] at org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurati onMap(PackageBuilderConfiguration.java:259) [java] at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConf iguration.java:176) [java] at org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderCo nfiguration.java:153) [java] at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:242) [java] at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:142) [java] at org.drools.builder.impl.KnowledgeBuilderProviderImpl.newKnowledgeBuilde r(KnowledgeBuilderProviderImpl.java:29) [java] at org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(Knowledg eBuilderFactory.java:29) [java] at org.berlin.rpg.rules.Rules.rules(Rules.java:33) [java] at org.berlin.rpg.rules.Rules.main(Rules.java:73) [java] Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in the classpath [java] at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompil er(JavaDialectConfiguration.java:94) [java] at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(Java DialectConfiguration.java:55) [java] at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuild erConfiguration.java:270) [java] ... 9 more [java] Java Result: 1 ... ... I do include the following libraries with my javac and java target: <path id="classpath"> <pathelement location="${lib.dir}" /> <pathelement location="${lib.dir}/drools-api-5.0.1.jar" /> <pathelement location="${lib.dir}/drools-compiler-5.0.1.jar" /> <pathelement location="${lib.dir}/drools-core-5.0.1.jar" /> <pathelement location="${lib.dir}/janino-2.5.15.jar" /> </path> Here is the Java code that is throwing the error. I commented out the java.compiler code, that didn't work either. public void rules() { /* final Properties properties = new Properties(); properties.setProperty( "drools.dialect.java.compiler", "JANINO" ); PackageBuilderConfiguration cfg = new PackageBuilderConfiguration( properties ); JavaDialectConfiguration javaConf = (JavaDialectConfiguration) cfg.getDialectConfiguration( "java" ); */ final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); // this will parse and compile in one step kbuilder.add(ResourceFactory.newClassPathResource("HelloWorld.drl", Rules.class), ResourceType.DRL); // Check the builder for errors if (kbuilder.hasErrors()) { System.out.println(kbuilder.getErrors().toString()); throw new RuntimeException("Unable to compile \"HelloWorld.drl\"."); } // Get the compiled packages (which are serializable) final Collection<KnowledgePackage> pkgs = kbuilder.getKnowledgePackages(); // Add the packages to a knowledgebase (deploy the knowledge packages). final KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages(pkgs); final StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(); ksession.setGlobal("list", new ArrayList<Object>()); ksession.addEventListener(new DebugAgendaEventListener()); ksession.addEventListener(new DebugWorkingMemoryEventListener()); // Setup the audit logging KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, "log/helloworld"); final Message message = new Message(); message.setMessage("Hello World"); message.setStatus(Message.HELLO); ksession.insert(message); ksession.fireAllRules(); logger.close(); ksession.dispose(); } ... Here I don't think Ant is relevant because I have fork set to true: <target name="test" depends="compile"> <java classname="org.berlin.rpg.rules.Rules" fork="true"> <classpath refid="classpath.rt" /> <classpath> <pathelement location="${basedir}" /> <pathelement location="${build.classes.dir}" /> </classpath> </java> </target> The error is thrown at line 1. Basically, I haven't done anything except call final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); I am running with Windows XP, Java6, and within Ant.1.7. The most recent (as of yesterday) version 5 of Drools-Rules.

    Read the article

  • Question regarding Manifest in Java jar file

    - by Tara Singh
    Hi All, Is is mandatory to have classpath inside a Manifest file inside the java jar file? can we do work without having the classpath inside it? The reason why I am asking this is because I have a jar file for a server application. When I tried to connect many connections with Server, Server went down and the error was "Too many open files", when searched about it, I found one Sun Bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6446657 . Then I checked and i was having a classpath entry in the Jar file. So this question arises. Thanks, Tara Singh

    Read the article

  • build.xml in ant

    - by Codenotguru
    > Can anybody help me know what these tags do in build.xml file? > > 1)<property file="" location="."/> > 2)<property environment=""/> > 3)<property name="" value=""/> 4)<path > id="classpath.base"> 5)<pathelement > location="$some.jar"/> 6)<path > id="classpath.build"> 7)<path > id="classpath.test"> > 8)<target></target> > > Thank You

    Read the article

  • Organizing test hierarchy in clojure project

    - by Sergey
    There are two directories in a clojure project - src/ and test/. There's a file my_methods.clj in the src/calc/ directory which starts with (ns calc.my_methods...). I want to create a test file for it in test directory - test/my_methods-test.clj (ns test.my_methods-test (:require [calc.my_methods]) (:use clojure.test)) In the $CLASSPATH there are both project root directory and src/ directory. But the exception is still "Could not locate calc/my_methods__init.class or calc/my_methods.clj on classpath". What is the problem with requiring it in the test file? echo $CLASSPATH gives this: ~/project:~/project/src

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >