[JBossWS] - JBOSS-WS Client not sending COOKIE after 2 calls
by fredash
Hi,
I just tested under JBoss AS 4.0.5 & JBossWS 1.2.1 a session mecanism based on the HTTP Session Cookie (with a code sample from Rama Pulavarthi's blog).
Here is the Web Service code:
| @WebService
| public class Hello {
| @Resource
| private WebServiceContext wsContext;
| public int getCounter(){
| MessageContext mc = wsContext.getMessageContext();
| HttpSession session = ((javax.servlet.http.HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST)).getSession();
| // Get a session property "counter" from context
| if (session == null)
| throw new WebServiceException("No session in WebServiceContext");
| Integer counter = (Integer)session.getAttribute("counter");
| if (counter == null) {
| counter = new Integer(0);
| System.out.println("Starting the Session");
| }
| counter = new Integer(counter.intValue() + 1);
| session.setAttribute("counter", counter);
| return counter;
| }
| }
|
Here is the Web Service Client code:
| Hello proxy = new HelloService().getHelloPort();
| ((BindingProvider)proxy).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,true);
| int result = proxy.getCounter();
| System.out.println(result);
| result = proxy.getCounter();
| System.out.println(result);
| result = proxy.getCounter();
| System.out.println(result);
|
The first 2 calls to proxy.getCounter() method just worked as expected : On the first call, a new session is created by the Web-Service and a SET-COOKIE is sent by the HTTP transport layer to the Client.
The second call to proxy.getCounter() generates a SOAP message with the COOKIE received after the first call.
BUT, when a 3rd call is fired, the client do not send anymore the COOKIE and then the server re-creates a new session.
The problem seems to be at the client level, when the client stops to send the COOKIE value after the second call.
** BTW, this code is for testing purpose and i know that the session mecanism in Web Services should ideally be implemented with the WS-Addressing mecanism.
Thanks in advance for your suggestions.
Fred.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060524#4060524
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060524
18Â years, 9Â months
[JBoss Seam] - Re: Why doesn't this h:message work for the h:selectOneMenu?
by grettke_spdr
"pete.muir(a)jboss.org" wrote : Whats the message (aka where is it originating)
Hi Pete,
I was looking at one approach to doing custom validations, and testing out how the error messages show up. The approach in this system is the "form" and "action" style. I added messages in the action. Here is how it looks:
| @Name("inspectionSearchAction")
| @Scope(ScopeType.SESSION)
| public class InspectionSearchActionImpl implements InspectionSearchAction {
|
| @Logger
| Log log;
|
| @In
| FacesMessages facesMessages;
|
| public void search() {
| try {
| facesMessages.addToControl("territoryNumber","territoryNumber");
| facesMessages.addToControl("riskControlRepNumber","riskControlRepNumber");
| facesMessages.addToControl("accountNumber","accountNumber");
| facesMessages.addToControl("selectedPriority","selectedPriority");
| facesMessages.addToControl("companyName","companyName");
| facesMessages.addToControl("selectedState","selectedState");
| facesMessages.addToControl("city","city");
| facesMessages.addToControl("county","county");
| facesMessages.addToControl("zipCode","zipCode");
| facesMessages.addToControl("surveyRangeStart","surveyRangeStart");
| facesMessages.addToControl("surveyRangeEnd","surveyRangeEnd");
| facesMessages.addToControl("inspectionCompleteRangeStart","inspectionCompleteRangeStart");
| facesMessages.addToControl("inspectionCompleteRangeEnd","inspectionCompleteRangeEnd");
| } catch (Exception e) {
| log.error(e);
| }
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060516#4060516
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060516
18Â years, 9Â months
[JBoss jBPM] - Problems with running the websale example
by petia
Hi again,
Finally, I succeeded to install jbpm-jpdl-3.2.1 (through the jbpm-jpdl-suite-3.2.1.zip file). It is simple, but the installation direction in the jbpm-jpdl-3.2.1/designer/readme.html file could be improved by properly outlining the two installation options, i.e. ?run ant install? is only needed if one goes for the installation through ?run download eclipse? option.
Anyway, now I am running into a new problem. I am executing the websale process provided with the installation. When I reach the ?deferred choice? i.e. I need to select between the alternatives ?End: More information needed? and ?End: OK? and I select one of them, I get the Exception report attached below.
I assume the example is correct and that I am doing something wrong. What am I doing wrong? (If more information is needed I am happy to provide it.)
Kind regards, Petia
PS I am also getting the following warnings when starting the server.
[FromElementType] Using non-qualified column reference [processInstance ->([PROCESSINSTANCE_])
[FromElementType] Using non-qualified column reference [isSuspended -> ([ISSUSPENDED_])
[FromElementType] Using non-qualified column reference [tiken -> ([TOKEN_])
[FromElementType] Using non-qualified column reference [id -> ([ID_])
[FromElementType] Using non-qualified column reference [processInstance -> ([PROCESSINSTANCE_])
[FromElementType] Using non-qualified column reference [isSuspended -> ([ISSUSPENDED_])
[FromElementType] Using non-qualified column reference [tiken -> ([TOKEN_])
[FromElementType] Using non-qualified column reference [processInstance -> ([PROCESSINSTANCE_])
Maybe, I still have not got the installation right.
I am grateful for any help.
----- Exception report ------
The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exception
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause
java.lang.UnsupportedClassVersionError: org/jbpm/websale/ShipItem (Unsupported major.minor version 49.0)
java.lang.ClassLoader.defineClass0(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:539)
java.lang.ClassLoader.defineClass(ClassLoader.java:448)
org.jbpm.instantiation.ProcessClassLoader.findClass(ProcessClassLoader.java:60)
java.lang.ClassLoader.loadClass(ClassLoader.java:289)
java.lang.ClassLoader.loadClass(ClassLoader.java:235)
org.jbpm.instantiation.Delegation.instantiate(Delegation.java:140)
org.jbpm.instantiation.Delegation.getInstance(Delegation.java:125)
org.jbpm.instantiation.Delegation$$FastClassByCGLIB$$6bae1598.invoke()
net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
org.jbpm.instantiation.Delegation$$EnhancerByCGLIB$$d6a04f9f.getInstance()
org.jbpm.graph.def.Action.execute(Action.java:121)
org.jbpm.graph.def.Action$$FastClassByCGLIB$$7876e90e.invoke()
net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
org.jbpm.graph.def.Action$$EnhancerByCGLIB$$520793a1.execute()
org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:255)
org.jbpm.graph.def.Node.execute(Node.java:338)
org.jbpm.graph.def.Node.enter(Node.java:318)
org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke()
net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
org.jbpm.graph.def.Node$$EnhancerByCGLIB$$589d9a45.enter()
org.jbpm.graph.def.Transition.take(Transition.java:151)
org.jbpm.graph.def.Node.leave(Node.java:393)
org.jbpm.graph.def.Node.leave(Node.java:368)
org.jbpm.graph.node.Fork.execute(Fork.java:140)
org.jbpm.graph.def.Node.enter(Node.java:318)
org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke()
net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
org.jbpm.graph.def.Node$$EnhancerByCGLIB$$589d9a45.enter()
org.jbpm.graph.def.Transition.take(Transition.java:151)
org.jbpm.graph.def.Node.leave(Node.java:393)
org.jbpm.graph.node.TaskNode.leave(TaskNode.java:209)
org.jbpm.graph.node.TaskNode$$FastClassByCGLIB$$923668a4.invoke()
net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
org.jbpm.graph.node.TaskNode$$EnhancerByCGLIB$$94a14a03.leave()
org.jbpm.graph.exe.Token.signal(Token.java:194)
org.jbpm.graph.exe.Token.signal(Token.java:165)
org.jbpm.graph.exe.Token$$FastClassByCGLIB$$74df1c6e.invoke()
net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$87f707c1.signal()
org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:479)
org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:418)
org.jbpm.jsf.core.action.CompleteTaskActionListener.handleAction(CompleteTaskActionListener.java:52)
org.jbpm.jsf.core.impl.JbpmActionListenerWrapper.processAction(JbpmActionListenerWrapper.java:82)
javax.faces.event.ActionEvent.processListener(ActionEvent.java:77)
javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:758)
javax.faces.component.UICommand.broadcast(UICommand.java:368)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:448)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060511#4060511
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060511
18Â years, 9Â months