[JNDI/Naming/Network] - Re: java.lang.ClassNotFoundException: org.jnp.interfaces.Nam
by bulloncito
Similar problem, however, I'm using portlets, running things inside the same JVM and everything runs inside the same app, however, in some places my app uses
TransactionManager tm = (TransactionManager)new InitialContext().lookup("java:/TransactionManager") ;
... wich runs nice and smooth, while some other places, INSIDE THE VERY SAME APPLICATION, with the very same identical code, print this error:
javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org/jnp/interfaces/NamingContextFactory]
| at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
| at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
| at javax.naming.InitialContext.init(InitialContext.java:223)
| at javax.naming.InitialContext.<init>(InitialContext.java:175)
| at portlets.performers.ActionPerformer.flushPersistence(Unknown Source)
| at portlets.performers.ActionPerformer.finalize(Unknown Source)
| at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
| at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
| at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
| at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
| Caused by: java.lang.ClassNotFoundException: org/jnp/interfaces/NamingContextFactory
| at java.lang.Class.forName0(Native Method)
| at java.lang.Class.forName(Class.java:247)
| at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)
| at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
| ... 9 more
... weird, huh ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994359#3994359
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994359
19 years, 4 months
[JBoss AOP] - Using a custom ClassLoader with JBoss AOP in Standalone Mode
by ttarhan
Hello,
I am having trouble making JBoss AOP (standalone) use my custom class loader. To keep the example simple, let's say I have a ClassLoader called CustomClassLoader which loads classes from a source other than the class path.
Now, assume we have these two classes
class A {
B someVariable;
}
class B {
A someVariable;
}
When my CustomClassLoader loads Class A and passes the class's byte[] to transform() OR if I use -javaagent and my CustomClassLoader simply calls defineClass, the AOP library tries to resolve the reference to Class B from within Class A. The problem is that it doesn't use my CustomClassLoader to do this -- it searches the classpath all on its own. I've tried changing the threadContextClassLoader, I've tried registering my classloader with the aspect manager. No matter what I do, the AOP framework uses its own class loader.
Any help on forcing the aspecting framework to use my own classloader to resolve references would be greatly appreciated.
I am using JBoss AOP 1.5.2.GA with JDK 1.5.
Thanks,
Tolga Tarhan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994355#3994355
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994355
19 years, 4 months