[JBoss jBPM] - How to get id of task
by jagr
Hi.
I'm trying to get the id of task.
My process start and in determinate node has ActionHandler.
In this action, i want to know task id.
I'm be able to get node id with context.getNode().getId()
and get token id with context.getToken().getId()
but if I try context.getTask().getId() process thrown exception
| 17:00:08,703 ERROR [GraphElement] action threw exception: null
| java.lang.NullPointerException
| at com.aixtelecom.actions.SaveOfferAction.execute(SaveOfferAction.java:47)
| at org.jbpm.graph.def.Action.execute(Action.java:122)
| at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:264)
| at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:220)
| at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:190)
| at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:174)
| at org.jbpm.graph.def.Node.leave(Node.java:382)
| at org.jbpm.graph.node.TaskNode.leave(TaskNode.java:209)
| at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke(<generated>)
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer
| .java:163)
In jbpm-consel if I enter on tasks process, i can see the task with his id.
How can I acces to this id?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136758#4136758
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136758
18 years, 1 month
[JBossWS] - Re: Call a web service
by PeterJ
Yes, you use the files generated by wsconsume in your client. As an example, say you have a hello web service (I am not sowing all the code):
class Hello {
| public String sayHello(String name) {...}
| }
wsconsume will create an interface named Hello and a class named HelloService (and possibly other classes). The code for the client is:
public class Client {
| public static void main(String[] args) {
| HelloService svc = new HelloService();
| Hello hello = svc.getHelloPort();
| System.out.println(hello.sayHello(args[0]));
| }
| }
Compile the client with the classes generated by wsconsume, and package the client and the wsconsume classes info a jar file. Then use wsrunclient to run it:
wsrunclient -classpath client.jar Hello me
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136757#4136757
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136757
18 years, 1 month
[Beginners Corner] - Creating a servlet
by tracker
I have a JBoss Seam project already in place, and I'm trying to add a service that will return a PDF from a URL request. It's my understanding that to do that I will need to modify the HTTP response, and to do that I need a component that extends HTTPServlet. I've tried to do that but I suspect that I'm missing some vital information. The code and error are below. If you read on, thank you, and prepare to be shocked by ignorance and apparently willful stupidity. But that's why I posted it in the Beginner's Corner.
The component code looks like this:
@Name("printServer")
| @Stateless
| @Scope(ScopeType.PAGE)
| public class PrintServer extends HttpServlet implements IPrintServer {
|
| private static final long serialVersionUID = 1278807414184735439L;
|
| @Logger
| private static Log log;
|
| public String test(String message) {
| log.info("Running printing test method", "Arg = " + message);
|
| return "Printing test message = " + message;
| }
| }
The interface code (do I even need to do that?) looks like this:
@Remote
| public interface IPrintServer {
| public String test(String message);
| }
The servlet mapping in web.xml looks like this:
<servlet>
| <servlet-name>Print Servlet</servlet-name>
| <servlet-class>com.mckesson.hbi.services.PrintServer</servlet-class>
| <load-on-startup>2</load-on-startup>
| </servlet>
| <servlet-mapping>
| <servlet-name>Print Servlet</servlet-name>
| <url-pattern>/services/pdf/*</url-pattern>
| </servlet-mapping>
|
The page I'm using it in looks like this:
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:rich="http://richfaces.org/rich"
| template="/layout/template.xhtml">
|
| <ui:define name="body">
|
| <h:messages globalOnly="true" styleClass="message"/>
|
| <rich:panel>
| <f:facet name="header">Printing test</f:facet>
| <div>Print: #{printServer.test("Hey Hey Kids")}</div>
| </rich:panel>
|
| </ui:define>
| </ui:composition>
The error looks like this:
SEVERE: Error Rendering View[/services/pdf/print.xhtml]
| javax.el.ELException: /services/pdf/print.xhtml: Could not instantiate Seam component: printServer
| at com.sun.facelets.compiler.TextInstruction.write(TextInstruction.java:50)
| at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39)
| at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:280)
| at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
| at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:220)
| at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:215)
| at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
| at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
| at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
| at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
| at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
| at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
| at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:143)
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:276)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: printServer
| at org.jboss.seam.Component.newInstance(Component.java:1962)
| at org.jboss.seam.Component.getInstance(Component.java:1865)
| at org.jboss.seam.Component.getInstance(Component.java:1832)
| at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
| at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
| at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
| at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
| at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
| at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
| at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
| at org.jboss.el.parser.AstValue.getValue(AstValue.java:63)
| at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
| at com.sun.facelets.el.ELText$ELTextVariable.writeText(ELText.java:184)
| at com.sun.facelets.el.ELText$ELTextComposite.writeText(ELText.java:108)
| at com.sun.facelets.compiler.TextInstruction.write(TextInstruction.java:45)
| ... 54 more
| Caused by: javax.naming.NameNotFoundException: local not bound
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
| at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at org.jboss.seam.Component.instantiateSessionBean(Component.java:1279)
| at org.jboss.seam.Component.instantiate(Component.java:1265)
| at org.jboss.seam.Component.newInstance(Component.java:1958)
| ... 68 more
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136751#4136751
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136751
18 years, 1 month