[JCA/JBoss] - Could not dereference object
by lasanac
Hello,
I keep this error:
javax.naming.NamingException: Could not dereference object [Root exception is java.lang.NullPointerException]
at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1152)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:707)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.kt.dao.DBConnection.doConnection(DBConnection.java:46)
at com.kt.dao.MakeConnectionTest.main(MakeConnectionTest.java:17)
Caused by: java.lang.NullPointerException
at org.jnp.interfaces.NamingContextFactory.getObjectInstance(NamingContextFactory.java:83)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1127)
at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1144)
... 5 more
I am running on JBoss 4.2.0GA
using JDK 1.5
DB is MySQL5.0
here is my code:
public Hashtable doEnvironment(){
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
return env;
}
public String doConnection(Hashtable env){
try{
Reference ref = new Reference("javax.sql.DataSource", "org.jnp.interfaces.NamingContextFactory", null);
System.out.println("step 1");
Context ctx= new InitialContext(env);
ctx.rebind("java:MySQLDS", ref);
//ctx = new InitialContext();
System.out.println("step 2");
DataSource ds = (DataSource)ctx.lookup("java:MySQLDS");
System.out.println("step 3 " + obj.getClass().getName().toString());
}
catch(Exception ex){
ex.printStackTrace();
}
return null;
It nevers gets to step 3...
Is there something wrong with what I am doing? Please help
LC
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112920#4112920
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112920
18 years, 4 months
[JBoss AOP] - JJBoss-5.0.0.Beta2 AOP problems
by vbatista
Hi!
I am having problems with JBoss AOP on JBoss-5.0.0.Beta2 (with JVM 1.5).
I enabled the property below on the AspectManager MBean:
property name="enableLoadtimeWeaving">true</property
I also added -javaagent:pluggable-instrumentor.jar to run.conf because I need runtime "aspectization" (I have no compile time instrumentation).
My Aspect is being executed, although I am having some deploy errors:
2007-12-14 13:16:08,092 ERROR [STDERR] [warn] AOP Instrumentor failed to transform net.sourceforge.stripes.controller.multipart.CosMultipartWrapper
2007-12-14 13:16:08,092 ERROR [STDERR] java.lang.RuntimeException: javassist.NotFoundException: com.oreilly.servlet.MultipartRequest
...
2007-12-14 13:18:25,567 ERROR [STDERR] org.jboss.aop.instrument.TransformationException: Failed to aspectize class org.quartz.impl.StdSchedulerFactory. Could not find class it references org.quartz.utils.PoolingConnectionProvider It may not be in your classpath and you may not be getting field and constructor weaving for this class.
2007-12-14 13:18:25,567 ERROR [STDERR] at org.jboss.aop.instrument.Instrumentor.convertReferences(Instrumentor.java:663)
What can I change to avoid this errors?
How can I have runtime "aspectization" without adding the -javaagent flag?
Any help would really be appreciated.
Thanks in advance.
Best regards,
Victor
PS: JBoss-5.0.0.Beta2 comes with Implementation-Version: jboss-aop-2.0.0.alpha3. I couldn't find pluggable-instrumentor.jar for this release. I am using
the pluggable-instrumentor.jar that ships with JBoss AOP 2.0.0 CR1
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112916#4112916
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112916
18 years, 4 months