[JBoss AS 7 Development] - How to access the request in a JAXWS webservice (JBoss 7.1.1) ?
by Michaël Leneveut
Michaël Leneveut [https://community.jboss.org/people/mleneveut] created the discussion
"How to access the request in a JAXWS webservice (JBoss 7.1.1) ?"
To view the discussion, visit: https://community.jboss.org/message/755785#755785
--------------------------------------------------------------
Hi all,
I have a working WS on JBoss 7.1.1, using JAX-WS. But when I try to use a javax.xml.ws.WebServiceContext, the messageContext in it is null. It has not been injected by JBoss.
How to access the request in a webservice ?
> public class CommonWSActivityBean extends BaseFrameworkObject {
> @Resource
> private WebServiceContext context;
>
> @PostConstruct
> @WebMethod(exclude = true)
> public void init() throws RemoteException {
> MessageContext messageContext = context.getMessageContext(); //IllegalStateException thrown
> HttpServletRequest request = (HttpServletRequest) messageContext.get(MessageContext.SERVLET_REQUEST);
The error :
> > java.lang.IllegalStateException
> > at org.jboss.ws.common.injection.ThreadLocalAwareWebServiceContext.getWebServiceContext(ThreadLocalAwareWebServiceContext.java:88)
> > at org.jboss.ws.common.injection.ThreadLocalAwareWebServiceContext.getMessageContext(ThreadLocalAwareWebServiceContext.java:69)
> > at fr.xxx.fwmc.arch.isolation.wsserver.bean.CommonWSActivityBean.init(CommonWSActivityBean.java:88)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
The Webservice :
> @WebService(name = "RechercheClient", targetNamespace = " http://ws.rechercheclient.xxx.fr/ http://ws.rechercheclient.xxx.fr/")
> @SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL, parameterStyle = ParameterStyle.WRAPPED)
> public class RechercheClient extends CommonWSActivityBean {
> @WebMethod(action = "rechercher")
> @WebResult(name = "listeClientsWS")
> @RequestWrapper(localName = "rechercher", targetNamespace = " http://ws.rechercheclient.xxx.fr/ http://ws.rechercheclient.xxx.fr/", className = "fr.xxx.rechercheclient.ws.jaxws.Rechercher")
> @ResponseWrapper(localName = "rechercherResponse", targetNamespace = " http://ws.rechercheclient.xxx.fr/ http://ws.rechercheclient.xxx.fr/", className = "fr.xxx.rechercheclient.ws.jaxws.RechercherResponse")
> public ClientWSDataBean[] rechercher(@WebParam(name = "clientWSParametre")
> ClientWSParametreDataBean parametre) throws WSException {
> return RechercheClientHelper.doRecherche(parametre, this.getUserContext());
> }
Thanks for your help.
PS : I tried to set the @Resource on the setter, to remove the "private". The standalone.xml has the "org.jboss.as.webservices" module.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/755785#755785]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 4 months
[jBPM Development] - Configuring HornetQ messaging (Urgent!)
by shekhar g
shekhar g [https://community.jboss.org/people/shekhargod] created the discussion
"Configuring HornetQ messaging (Urgent!)"
To view the discussion, visit: https://community.jboss.org/message/755750#755750
--------------------------------------------------------------
Hi,
I get following exception while starting jBoss 7.1 server. I am trying to configure HornetQ messaging. Any response will be appreciated.
I have 5.4 version of jbpm-human-task-hornetq.jar and jbpm-human-task-core.jar
The TaskSkippedEvent class seems to be in *+org.jbpm.task.event.entity+* package. I am not sure why it is trying to find class in org.jbpm.task.event package. Is it a bug in jBoss App?
20:59:33,894 ERROR [org.jbpm.task.service.TaskServer] (Thread-58) Server Exception with class class org.jbpm.task.service.hornetq.HornetQTaskServer using port 5445 E: Error creating message: java.io.IOException: Error creating message
at org.jbpm.task.service.hornetq.BaseHornetQTaskServer.readMessage(BaseHornetQTaskServer.java:134) [jbpm-human-task-hornetq-5.4.0-20120823.174645-324.jar:5.4.0-SNAPSHOT]
at org.jbpm.task.service.hornetq.BaseHornetQTaskServer.run(BaseHornetQTaskServer.java:102) [jbpm-human-task-hornetq-5.4.0-20120823.174645-324.jar:5.4.0-SNAPSHOT]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_33]
*Caused by: java.lang.ClassNotFoundException: org.jbpm.task.event.TaskSkippedEvent* from [Module "deployment.jbpm-human-task-war.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
at org.jbpm.task.event.TaskEventKey.readExternal(TaskEventKey.java:51) [jbpm-human-task-core-5.4.0-20120823.173658-330.jar:5.4.0-SNAPSHOT]
Thank you.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/755750#755750]
Start a new discussion in jBPM Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 4 months
[JBoss AS 7 Development] - Jboss 7.1.1 Final : JAX-WS : WebServiceContext.messageContext null
by Michaël Leneveut
Michaël Leneveut [https://community.jboss.org/people/mleneveut] created the discussion
"Jboss 7.1.1 Final : JAX-WS : WebServiceContext.messageContext null"
To view the discussion, visit: https://community.jboss.org/message/755397#755397
--------------------------------------------------------------
Hi everybody,
I am trying to use a JAX-WS Webservice in JBoss 7.1.1 Final. Webservice is working on Websphere 7, 8 and JBoss 5.1.
When calling the context.getMessageContext(), I get the following error, because WebServiceContext.messageContext is null :
> java.lang.IllegalStateException
> at org.jboss.ws.common.injection.ThreadLocalAwareWebServiceContext.getWebServiceContext(ThreadLocalAwareWebServiceContext.java:88)
> at org.jboss.ws.common.injection.ThreadLocalAwareWebServiceContext.getMessageContext(ThreadLocalAwareWebServiceContext.java:69)
> at fr.xxx.fwmc.arch.isolation.wsserver.bean.CommonWSActivityBean.init(CommonWSActivityBean.java:88)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
My CommonWSActivityBean :
> public class CommonWSActivityBean extends BaseFrameworkObject {
> @Resource
> private WebServiceContext context;
>
> @PostConstruct
> @WebMethod(exclude = true)
> public void init() throws RemoteException {
> try {
> MessageContext messageContext = context.getMessageContext(); //line 88
My Webservice :
> @WebService(name = "RechercheClientXOP", targetNamespace = " http://ws.rechercheclient.xop.xxx.fr/ http://ws.rechercheclient.xop.xxx.fr/")
> @SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL, parameterStyle = ParameterStyle.WRAPPED)
> public class RechercheClientXOP extends CommonWSActivityBean {
>
> @WebMethod(action = "rechercher")
> @WebResult(name = "rechercheClientsWS", targetNamespace = "")
> @RequestWrapper(localName = "rechercher", targetNamespace = " http://ws.rechercheclient.xop.xxx.fr/ http://ws.rechercheclient.xop.xxx.fr/", className = "fr.xxx.xop.rechercheclient.ws.Rechercher")
> @ResponseWrapper(localName = "rechercherResponse", targetNamespace = " http://ws.rechercheclient.xop.xxx.fr/ http://ws.rechercheclient.xop.xxx.fr/", className = "fr.xxx.xop.rechercheclient.ws.RechercherResponse")
> public RechercheClientWSDataBean rechercher(
> @WebParam(name = "rechercheClientWSParametre", targetNamespace = " http://ws.rechercheclient.xop.xxx.fr/ http://ws.rechercheclient.xop.xxx.fr/") ClientWSParametreDataBean rechercheClientWSParametre)
> throws WSException {
> try {
> return RechercheClientHelper.doRecherche(
> rechercheClientWSParametre, this.getUserContext());
> } catch (WSException e) {
> throw e;
> }
> }
>
web.xml :
> <servlet>
> <description>
> WebService RechercheClient JAXWS</description>
> <display-name>RechercheClientXOP</display-name>
> <servlet-name>RechercheClientXOP</servlet-name>
> <servlet-class>fr.xxx.xop.rechercheclient.ws.RechercheClientXOP</servlet-class>
> </servlet>
> <servlet-mapping>
> <servlet-name>RechercheClientXOP</servlet-name>
> <url-pattern>/RechercheClientXOPService</url-pattern>
> </servlet-mapping>
standalone.xml :
> <?xml version='1.0' encoding='UTF-8'?>
> <server xmlns="urn:jboss:domain:1.2">
> <extensions>
> <extension module="org.jboss.as.clustering.infinispan"/>
> <extension module="org.jboss.as.configadmin"/>
> <extension module="org.jboss.as.connector"/>
> <extension module="org.jboss.as.deployment-scanner"/>
> <extension module="org.jboss.as.ee"/>
> <extension module="org.jboss.as.ejb3"/>
> <extension module="org.jboss.as.jaxrs"/>
> <extension module="org.jboss.as.jdr"/>
> <extension module="org.jboss.as.jmx"/>
> <extension module="org.jboss.as.jpa"/>
> <extension module="org.jboss.as.logging"/>
> <extension module="org.jboss.as.mail"/>
> <extension module="org.jboss.as.naming"/>
> <extension module="org.jboss.as.osgi"/>
> <extension module="org.jboss.as.pojo"/>
> <extension module="org.jboss.as.remoting"/>
> <extension module="org.jboss.as.sar"/>
> <extension module="org.jboss.as.security"/>
> <extension module="org.jboss.as.threads"/>
> <extension module="org.jboss.as.transactions"/>
> <extension module="org.jboss.as.web"/>
> <extension module="org.jboss.as.webservices"/>
> <extension module="org.jboss.as.weld"/>
> </extensions>
> [...]
> <profile>
> [...]
> <subsystem xmlns="urn:jboss:domain:webservices:1.1">
> <modify-wsdl-address>true</modify-wsdl-address>
> <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
> <endpoint-config name="Standard-Endpoint-Config"/>
> <endpoint-config name="Recording-Endpoint-Config">
> <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
> <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
> </pre-handler-chain>
> </endpoint-config>
> </subsystem>
> [...]
I don't have jax-ws-*.jar in my WEB-INF/lib or in standalone/lib/ext.
I tried to put the @Resource on the setContext() instead of context. I tried without the private keyworrd.
Why is the WebServiceContext not filled / injected ?
Thanks for your help.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/755397#755397]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 4 months