[JBoss jBPM] - Re: invoke called, but our invoker is disconnected
by bertrand.njiipwo
Hello Alex,
I have chosed the second alternative. I was trying to let the jbpm.bpel module to read the received SOAPMessage:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
| <SOAP-ENV:Body>
| <m:apply xmlns:m="urn:samples:loanapproval">
| <loanRequestParameters>
| <firstName>Bertrand</firstName>
| <lastName>Njipwo</lastName>
| <amount>1000</amount>
| </loanRequestParameters>
| </m:apply>
| </SOAP-ENV:Body>
| </SOAP-ENV:Envelope>
In PortConsumer.java the following lines:
SOAPElement operationElem = XmlUtil.getElement(envelope.getBody());
| Map outputParts = new HashMap();
| // fill in part values
| Iterator partIt = parts.iterator();
| while (partIt.hasNext()) {
| Part part = (Part) partIt.next();
| String partName = part.getName();
| // get part accessor from operation wrapper
| SOAPElement operPartAccessor = XmlUtil.getElement(operationElem, partName);
| // create part accessor in output message
| Element outputPartAccessor = XmlUtil.createElement(null, partName);
| outputParts.put(partName, outputPartAccessor);
| // copy operation part to output part
| operPartAccessor.getValue();
| XmlUtil.copy(outputPartAccessor, operPartAccessor);
| }
| return outputParts;
|
will copy the informations of the SOAPElement operPartAcessor to the outputPartAccessor and therefore retrieve the value received from the remote service and with that value initialise the outputPartAccessor-object.
But i'm falling at: XmlUtil.copy(outputPartAccessor, operPartAccessor);
If i call any methode on operPartAccessor it raises a NullpointerException.
That why after this call the highlighted methodes also throw the same Exception.
public static void copy(Element target, SOAPElement source) {
| // attributes
| removeAttributes(target);
| copyAttributes(target, source);
| // all namespaces
| copyVisibleNamespaces(target, source);
| // child nodes
| removeChildNodes(target);
| copyChildNodes(target, source);
| if (log.isTraceEnabled()) log.trace("copied element: " + source.getNodeName());
| }
So copyAttributes will fail because the SOAPElement operPartAccessor has no Attributes. One question: (Which methode give the value of the operPartAccessort ? I have tried with to manipulate the operPartAccessort as DOM object by call getChildrens(), but its always fail).
My question is how could i get the value true of true in the following message send by the remote server: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
| <soapenv:Body>
| <validCustomerResponse xmlns="urn:samples:schufa">
| <validCustomerReturn>true</validCustomerReturn>
| </validCustomerResponse>
| </soapenv:Body>
| </soapenv:Envelope>
I have comment out the following line in PortConsumer.java: XmlUtil.copy(outputPartAccessor, operPartAccessor); so i can achieve a "cleaned" process excecution and so i can make some performance measurements during the process execution. This is a temporary solution to be able to work. After doing this i become the following message:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
| <env:Header/>
| <env:Body>
| <m:applyResponse xmlns:m="urn:examples:loanapproval">
| <loanResponse>
| <approved/>
| </loanResponse>
| </m:applyResponse>
| </env:Body>
| </env:Envelope>
Alex why i can't copy the desired value the remote service send me in my BPEL process.
Thanks once again for your help and the time you invest.
Regards
Bertrand
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3999710#3999710
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3999710
19 years, 3 months
[JBoss AOP] - Packaging and AOP
by adamw
Hello,
I have encountered a weird problem concerning packaging of AOP-transformated classes. I use compile-time transformations, and this step works. The classes I transform are a portlet, so I want them to be in a jar. If I put my classes as usually in myapp.war/WEB-INF/classes, or in myapp.war/WEB-INF/lib/jar-with-classes.jar, I get the following exception (fragment):
| at org.jboss.forge.projects.freezone.Freezone.<clinit>(Freezone.java)
| ... 105 more
| Caused by: java.lang.RuntimeException: javassist.NotFoundException: org.jboss.forge.projects.freezone.Freezone
| at org.jboss.aop.Advisor.hasAnnotation(Advisor.java:350)
| at org.jboss.aop.pointcut.Util.matchesClassExpr(Util.java:113)
| ... 117 more
| Caused by: javassist.NotFoundException: org.jboss.forge.projects.freezone.Freezone
|
If I deploy the jar-with.classes.jar and a "stripped" .war independently (both go to the deploy dir), it works. Any ideas why and how to avoid separate deployments?
--
Regards,
Adam
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3999706#3999706
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3999706
19 years, 3 months
[Beginners Corner] - Getting java.lang.reflect.UndeclaredThrowableException when
by vganesh_76
I am Getting java.lang.reflect.UndeclaredThrowableException when returning Collection obj from stateless bean.
Though I implement the Serializable in my return obj(i.e. Response), I got the exception,
java.lang.reflect.UndeclaredThrowableException
at $Proxy96.readResult(Unknown Source)
at com.ussearch.crm.web.report.ViewResultAction1.execute(ViewResultAction1.java:66)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.ussearch.util.web.filters.GZIPFilter.doFilter(GZIPFilter.java:39)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.UTFDataFormatException: encoded string too long: 270422 bytes
at java.io.DataOutputStream.writeUTF(DataOutputStream.java:347)
at java.io.DataOutputStream.writeUTF(DataOutputStream.java:306)
at org.jboss.serial.util.StringUtil.saveString(StringUtil.java:27)
at org.jboss.serial.objectmetamodel.DataContainer.saveString(DataContainer.java:987)
at org.jboss.serial.objectmetamodel.DataContainer.writeMyself(DataContainer.java:1056)
at org.jboss.serial.objectmetamodel.DataContainer.saveData(DataContainer.java:936)
at org.jboss.serial.io.JBossObjectOutputStream.writeObjectOverride(JBossObjectOutputStream.java:114)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:287)
at org.jboss.serial.io.MarshalledObject.(MarshalledObject.java:51)
at org.jboss.ejb3.SessionContainer.marshallResponse(SessionContainer.java:211)
at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:223)
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:55)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
at org.jboss.ejb3.stateless.StatelessClusteredProxy.invoke(StatelessClusteredProxy.java:100)
Can anyone help me to resolve this?
Here is my code
My Stateless bean interface:
public interface ReportManager {
|
| throws EJBException;
|
| public List<Response> readResult(String orderLineId);
| }
My Local interface:
@javax.ejb.Local
| public interface ReportManagerLocal extends ReportManager{
| }
My Remote interface:
@javax.ejb.Remote
| public interface ReportManagerRemote extends ReportManager{
| }
My Bean Impl:
@javax.ejb.Stateless
| @org.jboss.annotation.ejb.Clustered
| public class ReportManagerBean implements ReportManagerLocal, ReportManagerRemote{
| private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(ReportManagerBean.class);
|
| private ReportDAO reportDAO;
|
| public ReportManagerBean(){
| reportDAO = new ReportDAO();
| }
|
| public List<Response> readResult(String _orderLineId){
| try{
| return reportDAO.readResult(_orderLineId);
| } catch(Exception ex){
| logger.error("Error in reading result: ", ex);
| throw new EJBException("Error while reading result for line id "+_orderLineId, ex);
| }
| }
| }
My Response class:
import java.io.Serializable;
|
| public class Response implements Serializable {
| private String response;
|
| public Response(){}
|
| public Response(String _response){
| response = _response;
| }
|
| public String getResponse(){
| return response;
| }
|
| public void setResponse(String _response){
| response = _response;
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3999685#3999685
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3999685
19 years, 3 months