classloader

Apache Commons JCI ReloadingClassLoader

故事扮演 提交于 2019-12-07 04:24:54
问题 Does anyone have any experience in using the ReloadingClassLoader of the Apache Commons JCI API? The only usage example can found in the following page: http://commons.apache.org/jci/usage.html I am assuming that whenever the directory or jar changes, it will automatically reload the classes within the classloader? If so, you would have to load/instantiate a previously loaded/instantiated class (by calling loadClass()) again to use the newly modified class? Is that correct? Hope this is clear

WAS 8.5: java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl incompatible with javax.xml.parsers.SAXParserFactory

本小妞迷上赌 提交于 2019-12-07 03:59:37
问题 I am deploying a J2EE web application in Websphere Application Server 8.5. The web application has a shared library with all the third party libraries. All the internally coded libraries are inside the WEB-INF/lib folder. The problem is that in only some jsps WAS it is throwing the following exception. I think it is related with xercesImpl-2.8.1.jar but I don't understand why it is throwing this exception and why it is throwing in only some pages. In tomcat it is working perfectly. java.lang

Tools for finding all dependencies in Java jars

放肆的年华 提交于 2019-12-07 03:57:18
问题 Are there any tools that can be given a classpath or folder, and will search through all the .jar files looking for references to a particular class? It would have saved me a day of searching in order to resolve this kind of problem. In my case I had to find out where a rogue reference to a class was coming from, as it was stopping JBoss from starting correctly due to a NoClassDefFoundError . I suppose I am looking for this: java -jar magicbullet.jar /path/to/search com.myproject.DodgyClass

WebappClassLoader memory leak even with no gc roots

柔情痞子 提交于 2019-12-07 03:27:08
问题 HERE IS THE HEAD DUMP (UPDATED ON 10/29/2013) I'm working in a webapp with: Tomcat 7.0.24 Java 6 Spring 3 (with aop - cglib) SLF4J over Log4j Oracle Coherence After a lot of work, I managed to remove all the strong reference to the class loader and now it is a candidate for the garbage collector. So, memory leak solved? Of course not! Because after several hot deployments a OOME appears due to PermGen space. Thanks to Yourkit, I was able to check that the WebappClassLoader was Pending

Android app fails to load on some phones in PathClassLoader

两盒软妹~` 提交于 2019-12-07 02:48:52
问题 I have an app, let us call it 'com.company.foo', with a main Activity 'FooBar'. In my AndroidManifest.xml, I have <application android:label="@string/app_name" android:icon="@drawable/icon" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" > <activity android:name="FooBar" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /

Thread.getContextClassLoader() == null?

若如初见. 提交于 2019-12-07 02:48:49
问题 Can Thread.getContextClassLoader() be null ? The javadoc is not really clear. Should a library take this case into account ? Update: the reason I asked is that beansbinding.dev.java.net does not work in this case (and my code does setContextClassLoader(null) 回答1: Java threads created from JNI code in a non-java thread have null ContextClassloader unless the creator explicitly sets it. Also in such context Thread.currentThread() returns null. 回答2: Yes you should, someone could have called

manage conflict on java classpath

∥☆過路亽.° 提交于 2019-12-07 02:44:17
问题 I expose my context : I have two Java programs that run on a unique Weblogic Server : program A and program B. These ones are launched by two ksh : programA.ksh and programB.ksh Both need C.jar but in different versions (but with exactly the same package and classes) : program A need C-1.0.jar program B need C-2.0.jar I precise that both programs share the same weblogic classpath. So, my classpath contains in that order : ..... C-1.0.jar C-2.0.jar ..... How can I do so that each program finds

What happens when you have the same class twice in a war deployed in tomcat?

你。 提交于 2019-12-07 02:13:22
问题 What happens when you have the same compiled class twice in a war deployed in tomcat? (I know it's not a good practice and so on, but what happens behind the scene?) Are there chances of nasty side-effects? 回答1: I would expect the behaviour is the same as anywhere else you have that situation. The first class found by the class loader will be used, the other will be ignored. 回答2: If you have one class is in WEB-INF/classes and the other in a jar, the one in WEB-INF/classes will have priority.

defining root classpath for class.getResource()

安稳与你 提交于 2019-12-07 00:44:06
问题 I'm using java in Eclipse (windows), and I'm trying to use: myClass.getResource("/image.jpg"), While image.jpg exists in the root loacation "myProject/". It returns null. I checked many other threads but none of them resolved my issue. So I tried to evaluate this: this.getClass().getResource("/").getPath(); and it returned "myProject/build/classes". So I checked the project's configuration for this dir, and found the exact same dir under Java Build Path --> Source --> Default output folder My

ANT - Could not load a dependent class com/jcraft/jsch/Logger

夙愿已清 提交于 2019-12-06 21:45:37
问题 I have a problem with my Ant script. I need to copy a file to Linux server <copy file="../Ant/lib/jsch-0.1.50.jar" tofile="${ant.home}/lib/jsch-0.1.50.jar" /> <scp todir="${server.user}:${server.password}@${server.dev}:${server.dev.dir.config}" trust="true" verbose="true"> <fileset dir="${src.home}/Config/"> <include name="**/*" /> </fileset> </scp> File is copied correctly, but I receive this error: BUILD FAILED C:\dev.xml:179: Problem: failed to create task or type scp Cause: Could not load