Search Results

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

Page 5/31 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Setting the Classpath and Accessing code from book: Programming Clojure

    - by user130153
    (I posted this same question on the Clojure list but haven't got an answer yet. Is anyone here ready to help?) I am going through Programming Clojure and I recently downloaded the code from the books official website. For other utils I can do, for example, (require 'clojure.contrib.str-utils) and it works. But how do I load code from the book? (require 'examples.introduction) throws the following exception: java.io.FileNotFoundException: Could not locate examples/ introduction__init.class or examples/introduction.clj on classpath: (NO_SOURCE_FILE:0) [Thrown class clojure.lang.Compiler$CompilerException] Here is the full backtrace: Backtrace: 0: clojure.lang.Compiler.eval(Compiler.java:4543) 1: clojure.core$eval__3990.invoke(core.clj:1728) 2: swank.commands.basic$eval_region__686.invoke(basic.clj:36) 3: swank.commands.basic$listener_eval__695.invoke(basic.clj:50) 4: clojure.lang.Var.invoke(Var.java:346) 5: user$eval__1200.invoke(NO_SOURCE_FILE) 6: clojure.lang.Compiler.eval(Compiler.java:4532) 7: clojure.core$eval__3990.invoke(core.clj:1728) 8: swank.core$eval_in_emacs_package__307.invoke(core.clj:55) 9: swank.core$eval_for_emacs__384.invoke(core.clj:123) 10: clojure.lang.Var.invoke(Var.java:354) 11: clojure.lang.AFn.applyToHelper(AFn.java:179) 12: clojure.lang.Var.applyTo(Var.java:463) 13: clojure.core$apply__3243.doInvoke(core.clj:390) 14: clojure.lang.RestFn.invoke(RestFn.java:428) 15: swank.core$eval_from_control__310.invoke(core.clj:62) 16: swank.core$eval_loop__313.invoke(core.clj:67) 17: swank.core$spawn_repl_thread__445$fn__476$fn__478.invoke(core.clj: 173) 18: clojure.lang.AFn.applyToHelper(AFn.java:171) 19: clojure.lang.AFn.applyTo(AFn.java:164) 20: clojure.core$apply__3243.doInvoke(core.clj:390) 21: clojure.lang.RestFn.invoke(RestFn.java:428) 22: swank.core$spawn_repl_thread__445$fn__476.doInvoke(core.clj:170) 23: clojure.lang.RestFn.invoke(RestFn.java:402) 24: clojure.lang.AFn.run(AFn.java:37) 25: java.lang.Thread.run(Unknown Source) I am trying both Clojure Box and Enclojure in NetBeans on Windows XP. Is it a classpath issue? Where should I place the folder that contains code from the book? Please help me out with my variable enviroment settings as well.

    Read the article

  • load class not in classpath dynamically in web application - without using custom classloader

    - by swdeveloper
    I am developing a web application. The web application generates java classes on the fly. For example it generates class com.people.Customer.java In my code, I dynamically compile this to get com.people.Customer.class and store in some directory say repository/com/people/Customer.class which is not on the classpath of my application server.My application server(I am using WebSphere Application Server/Apache Tomcat etc) picks up the classes from the WEB-INF/classes directory. The Classloader would use this to load the classes. After compilation I need to load this class so that it becomes accessible to other classes using it after its creation. 4.When I use Thread.currentThread().getContextClassLoader().loadClass(com.people.Customer) obviously the Classloader is not able to load the class, since its not on the classpath(not in WEB-INF/classes). Due to similar reasons, getResource(..) or getResourceAsStream(..) also does not work. I need a way to : Read the class Customer.class maybe as a stream (or any other way would do) and then load it. Following are the constraints: I cannot add the repository folder to the WEB-INF/classes folder. I cannot create a new Custom ClassLoader. If I create a new ClassLoader and this loads the class, it will not be accessible to its parent ClassLoader. Is there any way of achieving this? If not this, in the worse case, is there a way of overriding the default class loader with a custom class loader for web applications the same classloader should be used to load applications throughout entire lifecycle of my web application. Appreciate any solution :)

    Read the article

  • Problem locating file in a classpath

    - by Gandalf StormCrow
    I'm trying to read in file content, ex : public void myMethod(){ FileInputStream fstream = new FileInputStream(fileLocation); // Get the object of DataInputStream DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String strLine; while ((strLine = br.readLine()) != null) { .... .... ..... end while end method And I have at the begining of the class body private String fileLocation; and at the end of a class I have a getter and setter for it. Now I'm trying inject this file location from spring inside bean from this class and I specify the init-method of this class. But I get error cannot find the specified file as if its not on a classpath but it is inside war file? I'm building the project with maven and I put file in src/main/resources This is the error I get when trying to read file : Error: src\main\resources\ids.txt (The system cannot find the path specified) That is when I tried this : FileInputStream fstream = new FileInputStream("src\\main\\resources\\ids.txt"); how to reference the properly from the classpath? EDIT When I edit my code according to @BalusC solution , here is how it looks but I still get null error : ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); InputStream input = classLoader.getResourceAsStream("src/main/resources/ids.txt"); // Get the object of DataInputStream BufferedReader br = new BufferedReader(new InputStreamReader(input)); String strLine; while ((strLine = br.readLine()) != null) { .... .... ..... end while end method

    Read the article

  • Retrieve property from classpath inside POM

    - by Jeroen
    For my current project I want to integrate a maven plug-in for database migrations. For this plug-in to work, however, I have to obtain the database settings inside my POM. My database settings are currently placed inside a hibernate.properties file, positioned in a directory that is marked as maven resource. For a variety of reasons I do not want to duplicate my database configurations in both the pom and hibernate.properties. I'm aware that maven offers a "filtering" ability which makes it possible to specify the database settings as property inside my POM, and reference them inside my hibernate.properties as ${property_name}. But as I'm using multiple maven profiles, with different property resources, this is not a suitable solution. Instead I'd like my database configurations to be loaded from a property file inside my classpath (e.g. classpath:hibernate.properties), and use these properties in my migration plug-in configuration. I have already tried the org.codehaus.mojo » properties-maven-plugin, but this plug-in only accepts absolute locations. Is there a plug-in which can scan all my maven resources for a certain property?

    Read the article

  • clojure: ExceptionInInitializerError in Namespace.<init> loading from a non-default classpath

    - by Charles Duffy
    In attempting to load an AOT-compiled class from a non-default classpath, I receive the following exception: Traceback (innermost last): File "test.jy", line 10, in ? at clojure.lang.Namespace.<init>(Namespace.java:34) at clojure.lang.Namespace.findOrCreate(Namespace.java:176) at clojure.lang.Var.internPrivate(Var.java:149) at aot_demo.JavaClass.<clinit>(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) java.lang.ExceptionInInitializerError: java.lang.ExceptionInInitializerError I'm able to reproduce this with the following trivial project.clj: (defproject aot-demo "0.1.0-SNAPSHOT" :dependencies [[org.clojure/clojure "1.3.0"]] :aot [aot-demo.core]) ...and src/aot_demo/core.clj defined as follows: (ns aot-demo.core (:gen-class :name aot_demo.JavaClass :methods [#^{:static true} [lower [java.lang.String] java.lang.String]])) (defn -lower [str] (.toLower str)) The following Jython script is then sufficient to trigger the bug: #!/usr/bin/jython import java.lang.Class import java.net.URLClassLoader import java.net.URL import os cl = java.net.URLClassLoader( [java.net.URL('file://%s/target/aot-demo-0.1.0-SNAPSHOT-standalone.jar' % (os.getcwd()))]) java.lang.Class.forName('aot_demo.JavaClass', True, cl) However, the exception does not occur if the test script is started with the uberjar already in the CLASSPATH variable. What's going on here? I'm trying to write a plugin for the BaseX database in Clojure; the above accurately represents how their plugin-loading mechanism works for the purpose of providing a SSCE for this problem.

    Read the article

  • How to override ant task stored in ant lib directory

    - by mchr
    At my work we use AspectJ in some of our Java projects. To get this to work with ant builds we have been placing aspectjtools.jar within ant/lib/. I am now working on a particular Java project and need to use a newer version of aspectJ. I don't want to have to get everyone who uses the project to update their local copy of aspectjtools.jar. Instead, I tried adding the newer aspectjtools.jar to the lib directory of the project and adding the following line to build.xml. <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties" classpath="./lib/aspectjtools.jar" /> However, this doesn't work as I hoped as the ANT classloader loads jars from ant/lib/ in preference to the jar I specify in the taskdef classpath. Is there any way to force ant to pick the jar checked into my project instead?

    Read the article

  • Problem with Apache Commons Id UUID Version 1 generation

    - by Pekka Mattila
    My problem is to generate version 1 UUIDs. We use Jetty 6.x, Maven (to start Jetty among other things) and Apache Commons ID (to generate UUID version 1 from the current time). Apache Commons ID requires a configuration file that is told to the JVM, using a parameter, e.g. 'org.apache.commons.id.uuid.config.resource.filename=commons-id-uuid.xml'. I checked the Apache Commons ID code and it tries to find the file from the classpath. Jetty's documentation states that WEB-INF/lib and WEB-INF/classes are in the classpath. The 'commons-id-uuid.xml' can be found from the deployed war file from the root of WEB-INF/classes directory but Jetty cannot load it: Message: java.lang.RuntimeException: java.lang.IllegalStateException: commons-id-uuid.xml loaded as system resource is null Jetty was started using the following command: mvn jetty:run -Dorg.apache.commons.id.uuid.config.resource.filename=commons-id-uuid.xml Any idea what is going wrong? We just need to generate UUID version 1 identifiers. Any suggestions?

    Read the article

  • Is javac enough to build an OSGi bundle?

    - by Chatanga
    To produce a bundle from source using a tool such as javac, you need to provide it with a linear classpath. Unfortunately, it won't work in some situations still perfectly legal from an OSGi point of view: dependencies with embedded JAR in them; same packages contained by different dependencies. Since javac doesn't understand OSGi metadata, I won't be able to simply but the dependencies in a classpath. A finer package grained approach seems necessary. How this problem is addressed by people using OSGi in an automated process (continuous integration)? Strangely, there is a lot of resources on the web on how to create bundle JAR (creating the metadata, creating the JAR) provided you have the classes/inner JAR to put inside, but very few things on how actually get theses classes compiled.

    Read the article

  • How to customize $(project.compileClasspathElement) like expression in Maven?

    - by zbdiablo
    When i try to run a maven plugin, i found that the default classpath defined in expression $(project.compileClasspathElement) is too long. So, i just want to customize a shorter classpath for this plugin. The default configuration is as follows: <plugin> <groupId>org.datanucleus</groupId> <artifactId>maven-datanucleus-plugin</artifactId> <version>2.0.1</version> <configuration> ...<classpathElements>${project.compileClasspathElements}</classpathElements> </configuration> and the value of classpathElements should be a String List. May i solve this problem? and how? thx!

    Read the article

  • Standard Oracle Fusion Middleware Installation fails on SOA ManagedServer start due to classpath pro

    - by Neuquino
    Hi, Trying to install Oracle Fusion Middleware 11gR2 on windows (same thing happens on Linux). I have followed the guidelines provided in the http://download.oracle.com/docs/cd/E12839_01/install.1111/e14318/toc.htm Installing the weblogic (11g) Oracle 11g databse installation Running the RCU utility to create schema Installed and copied relevant files for Java Bridge Configure the Fusion Middleware But i found that the SOA server is not getting up in the enterprise manager its showing as down. When i checked the logs iam getting the following error: oracle.jrf.wls.JRFStartup java.lang.ClassNotFoundException: oracle.jrf.wls.JRFStartup at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at weblogic.management.deploy.classdeployment.ClassDeploymentManager.invokeClass(ClassDeploymentManager.java:253) at weblogic.management.deploy.classdeployment.ClassDeploymentManager.access$000(ClassDeploymentManager.java:54) at weblogic.management.deploy.classdeployment.ClassDeploymentManager$1.run(ClassDeploymentManager.java:205) Truncated. see log file for complete stacktrace <Jul 7, 2009 4:18:48 PM CEST> <Critical> <WebLogicServer> <BEA-000286> <Failed to invoke startup class "SOAStartupClass", java.lang.ClassNotFoundException: oracle.bpel.services.common.util.GenerateBPMCryptoKey java.lang.ClassNotFoundException: oracle.bpel.services.common.util.GenerateBPMCryptoKey at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at weblogic.management.deploy.classdeployment.ClassDeploymentManager.invokeClass(ClassDeploymentManager.java:253) at weblogic.management.deploy.classdeployment.ClassDeploymentManager.access$000(ClassDeploymentManager.java:54) at weblogic.management.deploy.classdeployment.ClassDeploymentManager$1.run(ClassDeploymentManager.java:205) Truncated. see log file for complete stacktrace <Jul 7, 2009 4:19:27 PM CEST> <Error> <Deployer> <BEA-149205> <Failed to initialize the application 'SocketAdapter' due to error weblogic.application.ModuleException: The ra.xml <connectionfactory-impl-class> class 'oracle.tip.adapter.socket.SocketConnectionFactory' could not be loaded from the resource adapter archive/application because of the following error: java.lang.NoClassDefFoundError: oracle/tip/adapter/api/OracleConnectionFactory.weblogic.application.ModuleException: The ra.xml <connectionfactory-impl-class> class 'oracle.tip.adapter.socket.SocketConnectionFactory' could not be loaded from the resource adapter archive/application because of the following error: java.lang.NoClassDefFoundError: oracle/tip/adapter/api/OracleConnectionFactory at weblogic.connector.deploy.ConnectorModule.prepare(ConnectorModule.java:228) at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93) at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37) at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58) Truncated. see log file for complete stacktrace <Jul 7, 2009 4:19:27 PM CEST> <Error> <Deployer> <BEA-149205> <Failed to initialize the application 'MQSeriesAdapter' due to error weblogic.application.ModuleException: The ra.xml <connectionfactory-impl-class> class 'oracle.tip.adapter.mq.ConnectionFactoryImpl' could not be loaded from the resource adapter archive/application because of the following error: java.lang.NoClassDefFoundError: oracle/tip/adapter/api/OracleConnectionFactory.weblogic.application.ModuleException: The ra.xml <connectionfactory-impl-class> class 'oracle.tip.adapter.mq.ConnectionFactoryImpl' could not be loaded from the resource adapter archive/application because of the following error: java.lang.NoClassDefFoundError: oracle/tip/adapter/api/OracleConnectionFactory at weblogic.connector.deploy.ConnectorModule.prepare(ConnectorModule.java:228) at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93) at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37) at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58) Truncated. see log file for complete stacktrace <Jul 7, 2009 4:19:27 PM CEST> <Error> <Deployer> <BEA-149205> <Failed to initialize the application 'OracleAppsAdapter' due to error weblogic.application.ModuleException: java.lang.NoClassDefFoundError: oracle/tip/adapter/api/exception/PCResourceException.weblogic.application.ModuleException: java.lang.NoClassDefFoundError: oracle/tip/adapter/api/exception/PCResourceException at weblogic.connector.deploy.ConnectorModule.prepare(ConnectorModule.java:238) at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93) at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37) at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58) Truncated. see log file for complete stacktrace java.lang.NoClassDefFoundError: oracle/tip/adapter/api/exception/PCResourceException at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) at java.lang.Class.privateGetPublicMethods(Class.java:2547) at java.lang.Class.getMethods(Class.java:1410) at weblogic.connector.external.impl.RAComplianceChecker.checkOverrides(RAComplianceChecker.java:972) Truncated. see log file for complete stacktrace Can any one please tell me if i have missed any steps? thanks and regards, Naveen

    Read the article

  • Classpath issue with java -jar

    - by portoalet
    Hi, I have an executable jar Client.jar that requires jndi.properties file. Since the jndi properties is not part of the Client.jar, and java -jar ignores the -classpath argument, How can I execute the jar and let it know where the jndi.properties is? Thanks

    Read the article

  • specifying classpath for built-in ant tasks

    - by carneades
    I use the classpath attribute in custom Ant tasks to tell Ant where to find the external task jar, but how do I do the same for built-in tasks? In my case I'd like to make sure ant uses my copy of jsch.jar for the scp task, and not one that my already be installed on the system. Is there any way I can <scp> while guaranteeing it's using my jsch.jar?

    Read the article

  • Wicket WAR in Jetty: .html files not on classpath

    - by Ondra Žižka
    Hi, I deployed a Wicket-based app's .war file to Jetty 7.0.2. The problem is that Jetty copies the classpath to a temp dir, but only copies *.class, so *.html is not available for the classloader and I get the error: WicketMessage: Markup of type 'html' for component 'cz.dynawest.wicket.chat.ChatPage' not found. Copying the war as an expanded directory helped. Still, I am wondering how to configure Jetty to copy everything. And, with mvn jetty:run I get the same error. Thanks, Ondra

    Read the article

  • setting classpath using reg files on windows xp

    - by Supereme
    Hi, I want my classpath to be set using a 'reg' file. How to set that. I've seen on many websites the code for that but will it affect other registry keys? While setting value for a particular key we have to set only that value or we need to set values of other registry keys too? Thank you.

    Read the article

  • hibernate.properties classpath conflict

    - by Adam B
    I have a jar on the classpath which contains a hibernate.properties. This causes problems when my app starts because hibernate tries to use the settings from this file. Is there a way to explicitly specify the file that hibernate should look for, or tell it to ignore the properties file in the dependency jar?

    Read the article

  • Ant + JUnit: NoClassDefFoundError

    - by K-Boo
    Ok, I'm frustrated! I've hunted around for a good number of hours and am still stumped. Environment: WinXP, Eclipse Galileo 3.5 (straight install - no extra plugins). So, I have a simple JUnit test. It runs fine from it's internal Eclipse JUnit run configuration. This class has no dependencies on anything. To narrow this problem down as much as possible it simply contains: @Test public void testX() { assertEquals("1", new Integer(1).toString()); } No sweat so far. Now I want to take the super advanced step of running this test case from within Ant (the final goal is to integrate with Hudson). So, I create a build.xml: <project name="Test" default="basic"> <property name="default.target.dir" value="${basedir}/target" /> <property name="test.report.dir" value="${default.target.dir}/test-reports" /> <target name="basic"> <mkdir dir="${test.report.dir}" /> <junit fork="true" printSummary="true" showOutput="true"> <formatter type="plain" /> <classpath> <pathelement path="${basedir}/bin "/> </classpath> <batchtest fork="true" todir="${test.report.dir}" > <fileset dir="${basedir}/bin"> <include name="**/*Test.*" /> </fileset> </batchtest> </junit> </target> </project> ${basedir} is the Java project name in the workspace that contains the source, classes and build file. All .java's and the build.xml are in ${basedir}/src. The .class files are in ${basedir}/bin. I have added eclipse-install-dir/plugins/org.junit4_4.5.0.v20090423/junit.jar to the Ant Runtime Classpath via Windows / Preferences / Ant / Runtime / Contributed Entries. ant-junit.jar is in Ant Home Entries. So, what happens when I run this insanely complex target? My report file contains: Testsuite: com.xyz.test.RussianTest Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec Testcase: initializationError took 0 sec Caused an ERROR org/hamcrest/SelfDescribing java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.hamcrest.SelfDescribing at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) What is this org.hamcrest.SelfDescribing class? Something to do with mocks? OK, fine. But why the dependency? I'm not doing anything at all with it. This is literally a Java project with no dependencies other than JUnit. Stumped (and frustrated)!!

    Read the article

  • ANT: ways to include libraries and license issues

    - by Eric Tobias
    I have been trying to use Ant to compile and ready a project for distribution. I have encountered several problems along the way that I have been finally able to solve but the solution leaves me very unsatisfied. First, let me explain the set-up of the project and its dependencies. I have a project, lets call it Primary which depends on a couple of libraries such as the fantastic Guava. It also depends on another project of mine, lets call it Secondary. The Secondary project also features some dependencies, for example, JDOM2. I have referenced the Jar I build with Ant in Primary. Let me give you the interesting bits of the build.xml so you can get a picture of what I am doing: <project name="Primary" default="all" basedir="."> <property name='build' location='dist' /> <property name='application.version' value='1.0'/> <property name='application.name' value='Primary'/> <property name='distribution' value='${application.name}-${application.version}'/> <path id='compile.classpath'> <fileset dir='libs'> <include name='*.jar'/> </fileset> </path> <target name='compile' description='Compile source files.'> <javac includeantruntime="false" srcdir="src" destdir="bin"> <classpath refid='compile.classpath'/> </javac> <target> <target name='jar' description='Create a jar file for distribution.' depends="compile"> <jar destfile='${build}/${distribution}.jar'> <fileset dir="bin"/> <zipgroupfileset dir="libs" includes="*.jar"/> </jar> </target> The Secodnary project's build.xml is nearly identical except that it features a manifest as it needs to run: <target name='jar' description='Create a jar file for distribution.' depends="compile"> <jar destfile='${dist}/${distribution}.jar' basedir="${build}" > <fileset dir="${build}"/> <zipgroupfileset dir="libs" includes="*.jar"/> <manifest> <attribute name="Main-Class" value="lu.tudor.ssi.kiss.climate.ClimateChange"/> </manifest> </jar> </target> After I got it working, trying for many hours to not include that dependencies as class files but as Jars, I don't have the time or insight to go back and try to figure out what I did wrong. Furthermore, I believe that including these libraries as class files is bad practice as it could give rise to licensing issues while not packaging them and merely including them in a directory along the build Jar would most probably not (And if it would you could choose not to distribute them yourself). I think my inability to correctly assemble the class path, I always received NoClassDefFoundError for classes or libraries in the Primary project when launching Second's Jar, is that I am not very experienced with Ant. Would I require to specify a class path for both projects? Specifying the class path as . should have allowed me to simply add all dependencies to the same folder as Secondary's Jar, should it not?

    Read the article

  • activemq-maven-plugin ignore files in classpath?

    - by Oscar Chan
    I have been trying to get activemq-maven-plugin to run activemq with configuration in classpath of the bundle. However, I don't have much luck. It seems that the activemq-maven-plugin just ignore resources (resources/main/conf/activemq.properties) the local bundle. I checked the jar and target/classes and they are built into the right local. I am able to get plugin to run (mvn activemq:run) if I take out the PropertyPlaceholderConfigurer bean in the activemq.xml Did I do anything wrong? Here is the output [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Failed to start ActiveMQ Broker Embedded error: Could not load properties; nested exception is java.io.FileNotFoundException: class path resource [conf/activemq.properties] cannot be opened because it does not exist [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2 seconds [INFO] Finished at: Mon May 03 15:56:05 PDT 2010 [INFO] Final Memory: 11M/79M [INFO] ------------------------------------------------------------------------ Here is the pom.xml, which I specific the plugin to look up activemq.xml via file, that works. However, in the activemq.xml <?xml version="1.0"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>oc.test</groupId> <artifactId>mq</artifactId> <version>0.1</version> <name>mq</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.activemq.tooling</groupId> <artifactId>maven-activemq-plugin</artifactId> <version>5.3.1</version> <configuration> <configUri>xbean:file:src/main/resources/conf/activemq.xml</configUri> <fork>false</fork> <systemProperties> <property> <name>javax.net.ssl.keyStorePassword</name> <value>password</value> </property> <property> <name>org.apache.activemq.default.directory.prefix</name> <value>./target/</value> </property> </systemProperties> </configuration> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> <version>2.5.5</version> </dependency> </dependencies> </plugin> </plugins> </build> </project> Here is the src/main/resources/conf/activemq.xml <?xml version="1.0"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.apache.org/schema/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd "> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <value>classpath:conf/activemq.properties</value> </property> <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/> </bean> <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="./data"> <!-- The transport connectors ActiveMQ will listen to --> <transportConnectors> <transportConnector name="openwire" uri="tcp://localhost:61616"/> </transportConnectors> </broker> </beans> Here is the src/main/resources/conf/activemq.properties activemq.port=61616

    Read the article

  • Could not locate compojure in classpath

    - by Xian
    I am trying the various Getting started examples and I can get a basic hello world example working with basic HTML in the route as such (ns hello-world (:use compojure.core ring.adapter.jetty) (:require [compojure.route :as route])) (defroutes example (GET "/" [] "<h1>Hello World Wide Web!</h1>")) (run-jetty example {:port 8080}) But when I attempt to use the html helpers like so (ns hello-world (:use compojure ring.adapter.jetty) (:require [compojure.route :as route])) (defroutes example (GET "/" (html [:h1 "Hello World"]))) (run-jetty example {:port 8080}) Then I get the following error [null] Exception in thread "main" java.io.FileNotFoundException: Could not locate compojure__init.class or compojure.clj on classpath: (core.clj:1)

    Read the article

  • Relative paths in spring classpath resource

    - by Mike Q
    Hi all, I have a bunch of spring config files, all of which live under the META-INF directory in various subpackages. I have been using import like the following... <import resource="../database/schema.xml"/> So a relative path from the source file. This works fine when I am working with a local build outside of a jar file. But when I package everything up in a jar then I get an error that it cannot resolve the URL resource. If I change the above to an absolute path (with classpath:) then it works fine. Is there any way to use relative paths with ".." in when the configs are packaged in a jar or am I restricted to descending relative paths and absolute paths only? Thanks.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >