[JBossWS] - Re: WebServiceContext injection. Was it fixed or not?
by ggary
"richard_opalka" wrote : Could you share your service code with us?
|
| Richard
Sure, here it is:
package com.rsys.rsystools.ws;
|
| import javax.annotation.Resource;
| import javax.jws.WebMethod;
| import javax.jws.WebParam;
| import javax.jws.WebResult;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
| import javax.jws.soap.SOAPBinding.Style;
| import javax.servlet.ServletContext;
| import javax.xml.ws.ResponseWrapper;
| import javax.xml.ws.WebServiceContext;
| import javax.xml.ws.handler.MessageContext;
| import org.springframework.web.context.support.WebApplicationContextUtils;
|
|
| @WebService(targetNamespace="http://service.responsys.com/rsystools/ws/SpamComplaintWS/1.0")
| @SOAPBinding(style = Style.DOCUMENT)
| public class SpamComplaintWS implements SpamComplaint
| {
| @Resource
| private WebServiceContext context;
|
| ServletContext servletCtx;
| /** Creates a new instance of SpamComplaintWS */
| public SpamComplaintWS()
| {
| }
|
| /**
| * Web service operation
| */
| @WebMethod(operationName="processSpamComplaints")
| @WebResult(name="SpamResult", targetNamespace="http://service.responsys.com/rsystools/ws/SpamComplaintWS/1.0")
| @ResponseWrapper(className="com.rsys.rsystools.ws.SpamResult",
| targetNamespace="http://service.responsys.com/rsystools/ws/SpamComplaintWS/1.0")
| public SpamResult processSpamComplaints(
| @WebParam(name = "email") String email,
| @WebParam(name = "fromAddress") String fromAddress,
| @WebParam(name = "mailDate") String mailDate,
| @WebParam(name = "complaintDate") String complaintDate,
| @WebParam(name = "mailbox") String mailbox,
| @WebParam(name = "complainer") String complainer,
| @WebParam(name = "xRext") String xRext,
| @WebParam(name = "accountName") String accountName)
| {
| ServletContext servletCtx = (ServletContext) context.getMessageContext().get(MessageContext.SERVLET_CONTEXT);
| Object appContext = WebApplicationContextUtils.getRequiredWebApplicationContext(servletCtx);
| responsys.prodtools.SpammerTables st = new responsys.prodtools.SpammerTables();
| java.lang.String[] res = st.processSpamRecord(email, fromAddress, mailDate, complaintDate, mailbox, complainer, xRext, accountName);
| return (new SpamResult(res[0],res[1],res[2],res[3],res[4],res[5],res[6],res[7],res[8],res[9],res[10],res[11],res[12],res[13]));
| }
|
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091652#4091652
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091652
18Â years, 6Â months
[Installation, Configuration & DEPLOYMENT] - Overriding universal classloader, JBoss 4.2.1GA
by jimpo
How can I override JBoss's universal classloader, and use my own jars from my war's WEB-INF/lib, instead of ones in server/xxx/lib?
I have hibernate jars inside my war. I know one option is to remove them from war, but assume for now that I need to be able to select hibernate version freely and include it in the war. I tried to change the classloading to use the files from war based on
http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration
so, I added this jboss-web.xml in WAR's WEB-INF:
<jboss-web>
<class-loading java2ClassLoadingCompliance="false">
<loader-repository>
com.example.loaderrepository:loader=somename-webapp.war
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</class-loading>
</jboss-web>
but I did not notice any effect - JBoss still seems to load the hibernate jars that are bundled in the server installation.
I do not know if the wiki page is relevant for 4.2.1GA, since it starts with prior to version 3.2... There is some mention of 4.0 using Servlet classloader (instead of universal classloader?), but I remember reading somewhere that this was once again changed in 4.1? Confusing. What should I do with 4.2.1GA?
Simply, what do I need to configure so that I can use my own libraries from the war file in 4.2.1GA?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091640#4091640
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091640
18Â years, 6Â months