classpath

Spring : PropertyPlaceholderConfigurer cannot find property file

淺唱寂寞╮ 提交于 2019-12-01 06:22:07
问题 I have a strange problem with Spring using PropertyPlaceholderConfigurer . One of my beans is designed as follow : <bean name="propertyPlaceholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <value>classpath:jdbc.properties</value> </property> </bean> The problem is that spring never find jdbc.properties ( FileNotFoundException ). The file is in a folder named "resources" that is in the bundle classpath (I am working in a OSGi

How do i get jars from manifest's Class-Path-entries

一世执手 提交于 2019-12-01 06:14:30
I have a runnable jar with two jars in the Class-Path entry of its manifest file: Class-Path: module1-0.0.1-SNAPSHOT.jar base-0.0.1-SNAPSHOT.jar Main-Class: test.MySPI The program runs fine and all dependencies in the referenced jars are met. However, when I try to access the class path, the jars are not there: String classpath = System.getProperty("java.class.path"); String[] entries = classpath.split(System.getProperty("path.separator")); for (String entry : entries) { System.out.println("Entry: " + entry); } Only gives Entry: .\module2-0.0.1-SNAPSHOT.jar Is there a way of accessing the

Adding to ColdFusion Classpath for Particular Instance in Multi-Server Adobe Coldfusion 9

心不动则不痛 提交于 2019-12-01 05:51:59
问题 Adobe ColdFusion 9 Multi-Server doesn't have the "JVM and Java Settings" page in the CF Admin, so to add something to the CF classpath, for a given instance, that instance must be started with an alternate jvm.config. I don't have a problem with starting with an alternate jvm.config. I do, however, have a problem knowing precisely how to edit that file in the proper way. My stock jvm.config looks like this (ignore line breaks--they are not in the actual file): java.args=-server -Xmx512m

Yet another Ant + JUnit classpath problem

不想你离开。 提交于 2019-12-01 05:46:36
I'm developing an Eclipse SWT application using Eclipse. There are also some JUnit 4 tests, which test some DAO's. But when I try to run the tests via an ant build, all of the tests fail, because the test classes aren't found. Google brought up about a million of people who all have the same problem, but none of their solutions seem to work for me -.- . These are the contents of my build.xml file: <property name="test.reports" value="./test/reports" /> <property name="classes" value="build" /> <path id="project.classpath"> <pathelement location="${classes}" /> </path> <target name="testreport"

Can JNI be made to honour wildcard expansion in the classpath?

懵懂的女人 提交于 2019-12-01 04:49:34
I have a C binary that calls out to Java via JNI. I set CLASSPATH to somedir/* to pick up all the jars in somedir. When I run the binary, a required class definition cannot be found. When I run java that.class's.name from the same command line, the class is successfully found. If I explicitly add all the jars in somedir/ to the classpath, everything works great, but that leads to a very long classpath which I'd like to avoid. Does a JVM executed via JNI honour wildcard expansion of the classpath? Can it be made to do so? I figured out the answer by reading the hotspot source code. Only paths

WebSphere ClassNotFoundException with deployed dynamic web project

旧街凉风 提交于 2019-12-01 04:47:07
问题 Problem I am currently experiencing a ClassNotFoundException with a deployed EAR (with OpenFaces web project) on WebSphere 7.0 application server. The EAR deploys with no problems, but when I go to access a page from the web project (included in the EAR), I get the ClassNotFoundException (below). I have exported the EAR to make sure that everything was there and the WAR file is included. When I looked inside the WAR file, the class that is not being found is included in the WEB-INF/classes

How do i get jars from manifest's Class-Path-entries

拟墨画扇 提交于 2019-12-01 04:31:58
问题 I have a runnable jar with two jars in the Class-Path entry of its manifest file: Class-Path: module1-0.0.1-SNAPSHOT.jar base-0.0.1-SNAPSHOT.jar Main-Class: test.MySPI The program runs fine and all dependencies in the referenced jars are met. However, when I try to access the class path, the jars are not there: String classpath = System.getProperty("java.class.path"); String[] entries = classpath.split(System.getProperty("path.separator")); for (String entry : entries) { System.out.println(

Specifying classpath for a jar

半世苍凉 提交于 2019-12-01 04:30:01
问题 I am trying to configure the classpath of a JAR so that my ResourceBundle can pick up property files from it. If I run it from the .class files and specify the -cp flag it works fine, and System.err.println(System.getProperty("java.class.path")); will print the path specified in the -cp flag. If I try and create a jar file for it, System.err.println(System.getProperty("java.class.path")); always prints the path of the jar file, and the property files aren't picked up. It seems if you are

How to set the class path in Eclipse and Android Studio

混江龙づ霸主 提交于 2019-12-01 04:10:57
I've heard that you can use classpath to use classes in other libraries. I googled about this and all results tell me to use the command line to compile the program and specify a classpath. But who would use command line to compile java programs nowadays? I am using eclipse and Android Studio. I mean they are IDEs so they surely can set the classpath very easily, right? Also, I want to know the word "library" in this context is just a jar file , right? Sumit Singh In Eclipse: Right-Click on the Project → Build Path → Configure Build Path . Under Libraries tab, click Add Jars or Add External

How does the java compiler find the class files whereas the classpath is not set to the jdk path?

可紊 提交于 2019-12-01 04:00:25
I'm trying to look under the hood about java compilation. So I put my IDE away and started using MS-DOS command-line... I created a simple project, as described in the tree below : SampleApp |____**src** |_____pack |______Sample.java |____**classes** This is the Sample.java source code : public class Sample { private String s = new String("Hello, world"); public Sample(){ System.out.println(s); } } I just want to compile this class, so I used the javac command : prompt\SampleApp\src>javac -d ..\classes -sourcepath . pack\Sample.java All works fine, but i didn't expect that because I deleted my