[JNDI/Naming/Network] - @Resource injection not working in shared library
by vdmeerenp
Hello everyone,
I have the impression that resource injection (using @Resource annotation) is not executed when using shared library (in common/lib folder).
I have created a HttpSessionListener , with a datasource declared like this:
| @Resource(mappedName = "java:DefaultDS")
| private DataSource ds;
| ...
|
This listener is bundled in a jar file, which I have put under <JBOSS_HOME>/common/lib to make it available for all applications running on my Jboss application server.
Then I have a web application which uses this HttpSessionListener by declaring it in it's web.xml.
What I see is that when web application is deployed and listener is executed the datasource (ds) is always = null.This means the container did not execute the dependency injection of the datasource.
Note that when I add the jar file (with listener) to WEB-INF/lib of my web application, it DOES get executed.
So it seems that JBoss does not do dependency injection when @Resource annotations are put on classes which are in the common/lib folder.
Could someone please help because I don't want to deploy my shared jar with each application individually.
Many thanks in advance.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4219765#4219765
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4219765
17 years, 1 month
[EJB 3.0] - @Resource injection not working in shared library
by vdmeerenp
Hello everyone,
I have the impression that resource injection (using @Resource annotation) is not executed when using shared library (in common/lib folder).
I have created a HttpSessionListener , with a datasource declared like this:
| @Resource(mappedName = "java:DefaultDS")
| private DataSource ds;
| ...
|
This listener is bundled in a jar file, which I have put under <JBOSS_HOME>/common/lib to make it available for all applications running on my Jboss application server.
Then I have a web application which uses this HttpSessionListener by declaring it in it's web.xml.
What I see is that when web application is deployed and listener is executed the datasource (ds) is always = null.This means the container did not execute the dependency injection of the datasource.
Note that when I add the jar file (with listener) to WEB-INF/lib of my web application, it DOES get executed.
So it seems that JBoss does not do dependency injection when @Resource annotations are put on classes which are in the common/lib folder.
Could someone please help because I don't want to deploy my shared jar with each application individually.
Many thanks in advance.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4219762#4219762
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4219762
17 years, 1 month
[JBossWS] - No Content-type in the header
by gurkanerdogdu
Hi;
JDK : 1.6.0_11-b03
Server : 5.0.1.GA
I have developed an EJB3 class like this;
@WebService(name="EchoWebService", portName="EchoPort", serviceName="EchoService")
@Stateless
@SOAPBinding(RPC)
public class EchoServiceBean implement IEchoService
{
@WebMethod
public String echo(String echo){return echo}
}
It is succesfully deployed in to the server, I can see WSDL file.
After that I created a client using the wsconsume, it generates EchoService client code.
But when I want to call the webservice via EchoService using wsrunclient
--> wsrunclient MyMainMethod "Echo", it throws the following exception
javax.xml.ws.WebServiceException : No Content-type in the header!
What is the problem?
Thanks;
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4219758#4219758
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4219758
17 years, 1 month