classpath

Is there a Tomcat-like classloader that can be used standalone?

萝らか妹 提交于 2019-12-06 11:28:40
I'm working with a Java sort-of-application-server (Smartfox) which can run multiple applications ("extensions") but has a very inconvenient classpath setup to go along with it, along with issues when trying to use SLF4J. To work around that I'd like to wrap my applications in their own classloaders. Such a containing classloader should be much like Tomcat's, in that it Can load classes from a directory containing JARs. Prefers classes from its own classpath over those from the parent Is there a library somewhere that has such a classloader I can just "drag and drop" in my project? If not,

Access project classes from a maven plugin

不羁的心 提交于 2019-12-06 11:05:54
问题 I'm making a maven plugin that run in test phase, in pom.xml configuration of a project that uses my plugin, I'm setting a class canonical name that I want to use to run that class from my plugin, basically I'm making a way to have a dynamic class loading of classes inside the project from my plugin. Class clazz = Class.forName("... class from pom.xml ...") When I run it I receive the expectable "ClassNotFoundException", seems the class loader are not the same or not shared. There is a way to

Parent Last Classloader to solve Java Class path hell?

佐手、 提交于 2019-12-06 10:31:33
问题 I have a project which uses two versions of bouncyCastle jars bcprov-jdk15 and bcprov-jdk16. The jvm loads the older version but there is a feature I wrote which needs the newer version to run. I tried to solve this classpath hell by using a custom class loader. After some googling and with the help of some previous Stackoverflow answers[1] [2] and this blog, I wrote the following Parent Last Class loader to load the classes from the newer jar before delegating to the parent class loader.

Bundling wsdl in jar with CXF wsdl2java

瘦欲@ 提交于 2019-12-06 09:25:05
问题 I'm working on an implementation that will use a wsdl that I have gotten from a vendor. Our project is running on Spring and CXF, and I'd like to create a jar that will allow me to access this vendor's wsdl services, but I'm running into classpath issues. Using CXF's wsdl2java I am able to generate code that acts like this: WSDL_LOCATION = new URL("file:SomeService.wsdl"); The service requires the wsdl to be in the classpath, but I would like to bundle it in the jar so that it is

CLASSPATH on Mac, and how does Mac look for mysql-connector-java-bin.jar

别说谁变了你拦得住时间么 提交于 2019-12-06 09:01:13
问题 Is there a default classpath on Mac OS X 10.6? When I echo $CLASSPATH , nothing would show up. In my .profile , I only see PATH variable being set. My problem is that My servlet cant seem to find a suitable driver to connect to the mysql server. I use Eclipse , with Glassfish v3 and MAMP for MYSQL server. 回答1: There are several methods of getting JARs to be seen by Java on Mac OS X: Place it in /Library/Java/Extensions Create/edit the CLASSPATH environment variable Specify the classpath

Android NDK: Eclipse parameter and javah

混江龙づ霸主 提交于 2019-12-06 08:48:55
I spent hours and hours on it not moving an inch forward. I have redone the project several times and nothing else is left outside places. Hope someone here can shed some light pointing out some direction. On Linux Eclipse IDE panel > Run > External Tools > External Tools Configurations: Name: Dev javah Tab [main]: * location: /usr/java/jdk1.6.0_25/bin/javah * working directory: ${workspace_loc:/Dev/bin} * Arguments: ?? I have tried: * Arguments: -d ${workspace_loc:/Dev/jni} com.dev.DevActivity ${project_classpath:Dev} com.pkgpub.DevActivity which gives me: 1 error javadoc: error - Illegal

Problem with linking to other project in Android Eclipse environment

柔情痞子 提交于 2019-12-06 07:35:55
问题 I am developing an Android application as an Eclipse project that uses classes from another Eclipse Android project I already have. When I originally imported it ( New Project > Android Project > From Existing Source ), it had a bunch of errors, but when I did Project > Properties > Java Build Path and went to the projects tab and added the other project, the errors went away. Unfortunately, when I ran the application, I got the following error in DDMS: java.lang.NoClassDefFoundError:

JBOSS ordering of contents of WEB-INF/lib

女生的网名这么多〃 提交于 2019-12-06 06:45:20
问题 I have an ear file, containing a war file. The war contains a number of jars in its WEB-INF/lib directory. Some of these jars contain confilicting (or at least different ) versions of the same classes. Is there a way that I can influence the order that JBOSS will add these jar files on to the classpath? For example, if com.dave.A.class is found in a.jar and b.jar, both of which are in WEB-INF/lib, and I know that b.jar contains the "correct" version of the class, how do I ensure that JBOSS

Java runtime ClassNotFoundException

Deadly 提交于 2019-12-06 06:31:41
问题 Just had a question about an odd runtime error that I'm having. I'm working with a JSON server that responds with a JSON object when prompted by an outside source. As of right now, however, I'm simply trying to get the JSON object up and running before sending it out. My code compiles without specifying any classpath, but when it comes to runtime, it throws a NoClassDefFoundError as seen here: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang/exception

JavaPlot and gnuplot

我是研究僧i 提交于 2019-12-06 05:39:55
I'm desperately trying to get Java and gnuplot to play nice. I've started using JavaPlot and have added the jar to the classpath (using Eclipse). I've also downloaded gnuplot and have placed it in a safe place. First question, all examples given by JavaPlot are assuming you have put gnuplot in the right place, where this is I have no idea. Therefore their example of: import com.panayotis.gnuplot.JavaPlot; public class test { public static void main(String[] args) { JavaPlot p = new JavaPlot(); p.addPlot("sin(x)"); p.plot(); } } Will only work if gnuplot is added to the classpath, any ideas on