Skip to main content

JMS client sending message to MDB using appclient fails with injection exce

1 reply [Last post]
ejb3user
Offline
Joined: 2005-12-14

Hi
I have created a simple MDB which is listening to a Topic
(I have create a TopicConnectionFactory and a Topic using asadmin - create-jms-resource command) and deployed. No verifier exceptions.

I created a small Java class which is using @Resource to inject the TopicConnectionFactory and Topic and send a message to the topic.

I get the following stack trace. Not sure why the stack trace says Delete Tables etc.. What tables are these ? There is no persistence unit in the jar file.

Any pointers ??

thanks
-ejb3user

>
WARNING: ACC003: Application threw an exception.
com.sun.enterprise.InjectionException: Exception attempting to inject Res-Ref-En
v-Property: com.ejb3.client.StatusMailerClient/statusMessageTop
@ resolved as: jndi: jms/StatusMessageTopic
ConnectionFactory@res principal: null@mail: null
No Runtime properties
Database Vendor : null
Create Tables at Deploy : false
Delete Tables at Undeploy : falseinto class com.ejb3.client.Sta
tusMailerClient
at com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManager
Impl.java:356)
at com.sun.enterprise.util.InjectionManagerImpl.inject(InjectionManagerI
mpl.java:193)
at com.sun.enterprise.util.InjectionManagerImpl.injectClass(InjectionMan
agerImpl.java:131)
at com.sun.enterprise.util.InjectionManagerImpl.injectClass(InjectionMan
agerImpl.java:123)
at com.sun.enterprise.appclient.MainWithModuleSupport.(MainWithMod
uleSupport.java:325)
at com.sun.enterprise.appclient.Main.main(Main.java:180)
Caused by: java.lang.NullPointerException
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(Unknown Source)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source)
at java.lang.reflect.Field.set(Unknown Source)
at com.sun.enterprise.util.InjectionManagerImpl$1.run(InjectionManagerIm
pl.java:313)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManager
Impl.java:307)
... 5 more
Exception in thread "main" java.lang.RuntimeException: com.sun.enterprise.Inject
ionException: Exception attempting to inject Res-Ref-Env-Property: com.ej
b3.client.StatusMailerClient/statusMessageTopicCF@javax.jms.TopicConne
ctionFactory@ resolved as: jndi: jms/StatusMessageTopicConnectionFactory@res pri
ncipal: null@mail: null
No Runtime properties
Database Vendor : null
Create Tables at Deploy : false
Delete Tables at Undeploy : falseinto class com.ejb3.client.Sta
tusMailerClient
at com.sun.enterprise.appclient.MainWithModuleSupport.(MainWithMod
uleSupport.java:364)
at com.sun.enterprise.appclient.Main.main(Main.java:180)
Caused by: com.sun.enterprise.InjectionException: Exception attempting to inject
Res-Ref-Env-Property: com.ejb3.client.StatusMailerClient/statu
@ resolved as: jndi: jms/StatusM
essageTopicConnectionFactory@res principal: null@mail: null
No Runtime properties
Database Vendor : null
Create Tables at Deploy : false
Delete Tables at Undeploy : falseinto class com.ejb3.client.Sta
tusMailerClient
at com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManager
Impl.java:356)
at com.sun.enterprise.util.InjectionManagerImpl.inject(InjectionManagerI
mpl.java:193)
at com.sun.enterprise.util.InjectionManagerImpl.injectClass(InjectionMan
agerImpl.java:131)
at com.sun.enterprise.util.InjectionManagerImpl.injectClass(InjectionMan
agerImpl.java:123)
at com.sun.enterprise.appclient.MainWithModuleSupport.(MainWithMod
uleSupport.java:325)
... 1 more
Caused by: java.lang.NullPointerException
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(Unknown Source)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source)
at java.lang.reflect.Field.set(Unknown Source)
at com.sun.enterprise.util.InjectionManagerImpl$1.run(InjectionManagerIm
pl.java:313)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManager
Impl.java:307)
... 5 more

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ksak
Offline
Joined: 2005-05-20

Double-check that the injected fields/methods in the Application Client class are marked as static.