on 04-18-2008 10:35 AM
Hi,
Im getting an error message (see below)
javax.xml.ws.soap.SOAPFaultException: javax.ejb.EJBException: Exception in getMethodReady() for stateless bean sap.com/dts-ws-earxml|dts-ws.jarxml|MarketMessageServiceImplBean; nested exception is: com.sap.engine.services.ejb3.util.pool.PoolException: javax.ejb.EJBException: Cannot perform injection over bean instance com.amtsybex.dts.ws.MarketMessageServiceImplBean@4cd4a51 for bean sap.com/dts-ws-earxml|dts-ws.jarxml|MarketMessageServiceImplBean; nested exception is: com.sap.engine.lib.injection.InjectionException: Injection on field jmsConnFactory of instance com.amtsybex.dts.ws.MarketMessageServiceImplBean@4cd4a51 failed. Could not get a value to be injected from the factory.
at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:188)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:116)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
when injecting resources into my java bean. Ive tried different combinations on ejb-jar using mapped-name, injection target etc. But it seems to be ignoring whatever I try. In the code Im looking to reference the resources using @Resource annotation:
@Resource (name = "jms/dts/unregisteredFiles") javax.jms.Queue jmsDestQ;
@Resource (mappedName="jmsfactory/default/jms/dts/queueConnectionFactory", type=javax.jms.XAQueueConnectionFactory.class) javax.jms.XAQueueConnectionFactory jmsConnFactory;
Ive also tried using mapped names and specifying the resource type with no luck.
The ejb-jar looks like this:
<enterprise-beans>
<session>
<resource-ref>
<res-ref-name>jmsConnFactory</res-ref-name>
<res-type>javax.jms.XAQueueConnectionFactory</res-type>
<res-auth>Container</res-auth>
<mapped-name>jmsfactory/default/jms/dts/queueConnectionFactory</mapped-name>
<injection-target>
<injection-target-class>com.amtsybex.dts.ws.MarketMessageServiceImplBean</injection-target-class>
<injection-target-name>jmsConnFactory</injection-target-name>
</injection-target>
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>jms/dts/unregisteredFiles</resource-env-ref-name>
<resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
<mapped-name>jmsqueues/default/jms/dts/unregisteredFiles</mapped-name>
<injection-target>
<injection-target-class>com.amtsybex.dts.ws.MarketMessageServiceImplBean
</injection-target-class>
<injection-target-name>jmsDestQ</injection-target-name>
</injection-target>
</resource-env-ref>
</session>
</enterprise-beans>
Does anyone have any pointers?
Regards,
Andrew
I don't know if this helps but I had the same error and was stuck retrying my data sourse aliases etc. to no avail. I eventually looked in the default trace file to find it was a problem with a precompiled SQL Query. Check your default trace for a further nested exception.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andrew,
The jms-resources.xml should be in the same application as the ejb/war modules which use them. The resources defined in a jms-resource.xml are visible only to the components within the same application.
HTH
Ivo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andrew,
The name or mappedName attribute should refer exactly to the name of the resource as specified in the jms-resources.xml. Otherwise you would need to maintain this mapping in the ejb-j2ee-engine.xml - by means of the <res-link> and <jndi-name> elements.
So, I guess the easiest way to get this work in your case would be to change the annotations as following:
@Resource (name = "jms/dts/unregisteredFiles") javax.jms.Queue jmsDestQ;
@Resource (name = "jms/dts/queueConnectionFactory") javax.jms.XAQueueConnectionFactory jmsConnFactory;
and delete the entries in the ejb-jar.xml.
HTH!
\-- Vladimir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vladimir,
I've tried the advised method, but it comes back with the same error. When I use the context lookup it works ok:
InitialContext jmsContext = new InitialContext();
Destination dest = (Destination) jmsContext.lookup(jmsqueues/default/jms/dts/unregisteredFiles);
ConnectionFactory connectionFactory = jmsContext.lookup(jmsfactory/default/jms/dts/queueConnectionFactory);
However, when injecting directly into fields as you have advised it fails.
The resources are declared in another development component and I can see them in the resource admin tool.
Any ideas?
Regards,
Andrew
Vladimir,
We have tried every combination of string for lookup including long and short names.
We still get the exception.
If we use the initialcontext and look it up it finds the resource, but when injecting via the @Resource annotation it throws the following error:
Caused by: com.sap.engine.lib.injection.InjectionException: Injection on field jmsConnFactory of instance com.amtsybex.dts.ws.MarketMessageServiceImplBean@16bbde55 failed. Could not get a value to be injected from the factory.
at com.sap.engine.lib.injection.FieldInjector.inject(FieldInjector.java:115)
at com.sap.engine.lib.injection.InjectionMatrix.inject(InjectionMatrix.java:45)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_DependencyInjection.invoke(Interceptors_DependencyInjection.java:22)
... 64 more
Caused by: com.sap.engine.services.connector.exceptions.BaseResourceException: ConnectionFactory "jms/dts/queueConnectionFactory" does not exist. Possible reasons: the adapter in which ConnectionFactory "jms/dts/queueConnectionFactory" is defined is not deployed or not started.
at com.sap.engine.services.connector.ResourceObjectFactory.getObjectInstance(ResourceObjectFactory.java:244)
at com.sap.engine.lib.injection.ReferenceObjectFactory.getObject(ReferenceObjectFactory.java:65)
at com.sap.engine.lib.injection.FieldInjector.inject(FieldInjector.java:113)
... 66 more
Regards,
Andrew
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.