4 Replies Latest reply on Apr 16, 2007 10:55 AM by fulig jimmy

    own beans

    fulig jimmy Newbie

      How can I use my own beans in a xhtml file, that belongs to a process?

        • 1. Re: own beans
          fulig jimmy Newbie

          I have compiled the file User.java:

          package org.jbpm.webapp.bean;
          
          public class User
           {
           String firstName;
           String lastName;
           String phone;
           String email;
          
           public User()
           {
           }
          
           public void setFirstName(String firstName)
           {
           this.firstName = firstName;
           }
          
           public String getFirstName()
           {
           return firstName;
           }
          
           public void setLastName(String lastName)
           {
           this.lastName = lastName;
           }
          
           public String getLastName()
           {
           return lastName;
           }
          
           public void setPhone(String phone)
           {
           this.phone = phone;
           }
          
           public String getPhone()
           {
           return phone;
           }
          
           public void setEmail(String email)
           {
           this.email = email;
           }
          
           public String getEmail()
           {
           return email;
           }
          }
          to User.class. This file i have copied in jbpm-war\WEB-INF\classes\org\jbpm\webapp\bean and add tag:
          <managed-bean>
          <managed-bean-name>UserBean</managed-bean-name>
          <managed-bean-class>org.jbpm.webapp.bean.User</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
          </managed-bean>
          

          to the faces-config.xml.

          But the server in this way can't boot.
          What could be the problem?
          Thanks!

          • 2. Re: own beans
            fulig jimmy Newbie

            server log:

            at $Proxy0.start(Unknown Source)
             at org.jboss.system.ServiceController.start(ServiceController.java:417)
             at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
             at java.lang.reflect.Method.invoke(Unknown Source)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
            er.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
            java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy30.start(Unknown Source)
             at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:46
            6)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
             at java.lang.reflect.Method.invoke(Unknown Source)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
            er.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
            or.java:133)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
            BeanOperationInterceptor.java:142)
             at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor
            .java:97)
             at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(Intercepto
            rServiceMBeanSupport.java:238)
             at org.jboss.ws.server.WebServiceDeployer.start(WebServiceDeployer.java:
            117)
             at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.
            start(SubDeployerInterceptorSupport.java:188)
             at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterce
            ptor.java:95)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
            java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy31.start(Unknown Source)
             at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
             at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
             at java.lang.reflect.Method.invoke(Unknown Source)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
            er.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
            or.java:133)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
            BeanOperationInterceptor.java:142)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
            java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy8.deploy(Unknown Source)
             at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
            tScanner.java:421)
             at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
            canner.java:634)
             at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
            doScan(AbstractDeploymentScanner.java:263)
             at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
            bstractDeploymentScanner.java:336)
             at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
            upport.java:289)
             at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
            eanSupport.java:245)
             at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
             at java.lang.reflect.Method.invoke(Unknown Source)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
            er.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
            java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
            ler.java:978)
             at $Proxy0.start(Unknown Source)
             at org.jboss.system.ServiceController.start(ServiceController.java:417)
             at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
             at java.lang.reflect.Method.invoke(Unknown Source)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
            er.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
            java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy4.start(Unknown Source)
             at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
             at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
             at java.lang.reflect.Method.invoke(Unknown Source)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
            er.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
            or.java:133)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
            BeanOperationInterceptor.java:142)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
            java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy5.deploy(Unknown Source)
             at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
             at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
             at org.jboss.Main.boot(Main.java:200)
             at org.jboss.Main$1.run(Main.java:464)
             at java.lang.Thread.run(Unknown Source)
            15:27:25,354 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../dep
            loy/jmx-console.war/
            15:27:25,525 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
            
            --- Packages waiting for a deployer ---
            org.jboss.deployment.DeploymentInfo@2b15dd8a { url=file:/C:/Program Files/Java/j
            bpm-jpdl-3.2.GA/server/server/jbpm/deploy/jbpm.mail.templates.xml }
             deployer: null
             status: null
             state: INIT_WAITING_DEPLOYER
             watch: file:/C:/Program Files/Java/jbpm-jpdl-3.2.GA/server/server/jbpm/deploy/
            jbpm.mail.templates.xml
             altDD: null
             lastDeployed: 1176470845525
             lastModified: 1176470845525
             mbeans:
            
            --- Incompletely deployed packages ---
            org.jboss.deployment.DeploymentInfo@96e1ca49 { url=file:/C:/Program Files/Java/j
            bpm-jpdl-3.2.GA/server/server/jbpm/deploy/jbpm-console.war }
             deployer: MBeanProxyExt[jboss.web:service=WebServer]
             status: Deployment FAILED reason: URL file:/C:/Program Files/Java/jbpm-jpdl-3.
            2.GA/server/server/jbpm/tmp/deploy/tmp46290jbpm-console-exp.war/ deployment fail
            ed
             state: FAILED
             watch: file:/C:/Program Files/Java/jbpm-jpdl-3.2.GA/server/server/jbpm/deploy/
            jbpm-console.war
             altDD: null
             lastDeployed: 1176470840604
             lastModified: 1176470840557
             mbeans:
            
            org.jboss.deployment.DeploymentInfo@2b15dd8a { url=file:/C:/Program Files/Java/j
            bpm-jpdl-3.2.GA/server/server/jbpm/deploy/jbpm.mail.templates.xml }
             deployer: null
             status: null
             state: INIT_WAITING_DEPLOYER
             watch: file:/C:/Program Files/Java/jbpm-jpdl-3.2.GA/server/server/jbpm/deploy/
            jbpm.mail.templates.xml
             altDD: null
             lastDeployed: 1176470845525
             lastModified: 1176470845525
             mbeans:
            
            --- MBeans waiting for other MBeans ---
            ObjectName: jboss.ejb:service=EJBTimerService,persistencePolicy=database
             State: CONFIGURED
             I Depend On:
             jboss.jca:service=DataSourceBinding,name=DefaultDS
            
            ObjectName: jboss.mq:service=InvocationLayer,type=HTTP
             State: CONFIGURED
             I Depend On:
             jboss.mq:service=Invoker
             jboss.web:service=WebServer
            
            ObjectName: jboss:service=KeyGeneratorFactory,type=HiLo
             State: CONFIGURED
             I Depend On:
             jboss:service=TransactionManager
             jboss.jca:service=DataSourceBinding,name=DefaultDS
            
            ObjectName: jboss.mq:service=StateManager
             State: CONFIGURED
             I Depend On:
             jboss.jca:service=DataSourceBinding,name=DefaultDS
             Depends On Me:
             jboss.mq:service=DestinationManager
            
            ObjectName: jboss.mq:service=DestinationManager
             State: CONFIGURED
             I Depend On:
             jboss.mq:service=MessageCache
             jboss.mq:service=PersistenceManager
             jboss.mq:service=StateManager
             jboss.mq:service=ThreadPool
             jboss:service=Naming
             Depends On Me:
             jboss.mq.destination:service=Queue,name=JbpmCommandQueue
             jboss.mq.destination:service=Queue,name=JbpmJobQueue
             jboss.mq:service=SecurityManager
             jboss.mq.destination:service=Queue,name=DLQ
            
            ObjectName: jboss.mq:service=PersistenceManager
             State: CONFIGURED
             I Depend On:
             jboss.jca:service=DataSourceBinding,name=DefaultDS
             Depends On Me:
             jboss.mq:service=DestinationManager
            
            ObjectName: jboss.mq.destination:service=Queue,name=JbpmCommandQueue
             State: CONFIGURED
             I Depend On:
             jboss.mq:service=DestinationManager
            
            ObjectName: jboss.mq.destination:service=Queue,name=JbpmJobQueue
             State: CONFIGURED
             I Depend On:
             jboss.mq:service=DestinationManager
            
            ObjectName: jboss.mq:service=Invoker
             State: CONFIGURED
             I Depend On:
             jboss.mq:service=TracingInterceptor
             jboss:service=Naming
             Depends On Me:
             jboss.mq:service=InvocationLayer,type=HTTP
             jboss.mq:service=InvocationLayer,type=JVM
             jboss.mq:service=InvocationLayer,type=UIL2
            
            ObjectName: jboss.mq:service=TracingInterceptor
             State: CONFIGURED
             I Depend On:
             jboss.mq:service=SecurityManager
             Depends On Me:
             jboss.mq:service=Invoker
            
            ObjectName: jboss.mq:service=SecurityManager
             State: CONFIGURED
             I Depend On:
             jboss.mq:service=DestinationManager
             Depends On Me:
             jboss.mq:service=TracingInterceptor
             jboss.mq.destination:service=Queue,name=DLQ
            
            ObjectName: jboss.mq.destination:service=Queue,name=DLQ
             State: CONFIGURED
             I Depend On:
             jboss.mq:service=DestinationManager
             jboss.mq:service=SecurityManager
            
            ObjectName: jboss.mq:service=InvocationLayer,type=JVM
             State: CONFIGURED
             I Depend On:
             jboss.mq:service=Invoker
            
            ObjectName: jboss.mq:service=InvocationLayer,type=UIL2
             State: CONFIGURED
             I Depend On:
             jboss.mq:service=Invoker
            
            ObjectName: jboss.web.deployment:war=jbpm-console.war,id=-1763587511
             State: FAILED
             Reason: org.jboss.deployment.DeploymentException: URL file:/C:/Program Files/J
            ava/jbpm-jpdl-3.2.GA/server/server/jbpm/tmp/deploy/tmp46290jbpm-console-exp.war/
             deployment failed
            
            --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
            ObjectName: jboss.jca:service=DataSourceBinding,name=DefaultDS
             State: NOTYETINSTALLED
             Depends On Me:
             jboss.ejb:service=EJBTimerService,persistencePolicy=database
             jboss:service=KeyGeneratorFactory,type=HiLo
             jboss.mq:service=StateManager
             jboss.mq:service=PersistenceManager
            
            ObjectName: jboss.web.deployment:war=jbpm-console.war,id=-1763587511
             State: FAILED
             Reason: org.jboss.deployment.DeploymentException: URL file:/C:/Program Files/J
            ava/jbpm-jpdl-3.2.GA/server/server/jbpm/tmp/deploy/tmp46290jbpm-console-exp.war/
             deployment failed
            
            
            15:27:25,619 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0
            -8080
            15:27:25,775 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
            15:27:25,775 INFO [JkMain] Jk running ID=0 time=0/62 config=null
            15:27:25,791 INFO [Server] JBoss (MX MicroKernel) [4.0.4.GA (build: CVSTag=JBos
            s_4_0_4_GA date=200605151000)] Started in 19s:938ms
            


            • 3. Re: own beans
              Peter Johnson Master

              Two problems here. First, you placed jbpm.mail.templates.xml in the deploy directory, there is no deployer that knows what to do with this file.

              Second, it would appear that you removed the hsqldb-ds.xml file (or made some changes to it), which it preventing a myriad of things from loading.

              Also, you have not posted the significant parts of the console log. Usually the full stack trace of the first exception is the most significant. The deployment failures report, which you did post, is just a summary of what did not get deployed, and does not indicate why those things failed to deploy.

              Finally, none of this have anything to do with your JavaBeans, as far as I can tell.

              • 4. Re: own beans
                fulig jimmy Newbie

                Thanks for reply!

                I have installed JDK 6 and now it works fine.
                I would like to write a bean, that query datas from the database. Is somewhere examples or info how could i do that?

                Thanks!