1 2 3 Previous Next 40 Replies Latest reply on Sep 11, 2008 7:37 PM by theben Go to original post
      • 30. Re: EJB/War deployer ordering problem

         

        "alesj" wrote:
        "scott.stark@jboss.org" wrote:
        I don't think we should have to do that? The deployment context state should not reach DeploymentState.DEPLOYED unless all its components are installed, right?

        Hmm, I don't think we currently introduce any dependencies between deployment context and its components.
        I'll have a look, but I don't remember seeing any dependency items being put on DeploymentControllerContext.


        If any sub deployment "fails" then the whole deployment (top level
        and subdeployments) is unravelled.

        But that is different from a dependency being missing.
        That is just something that can be satisifed by deploying the missing dependency.

        It the ServiceMetaData that represents the war that should have the depends
        not the deployment context.

        You're going to get into all sorts of cirucular reference problems if you want
        the war to add dependencies to the deployment context that is a reference
        to an ejb in the same ear.

        The DeploymentControllerContext is per top level deployment,
        you can't move individual subdeployments to different deployment stages,
        the whole thing moves together (including uninstalling to the ERROR stage
        if one of the subdeployments produces an error).

        e.g. war -> depends -> ejb1

        my.ear -> myejbs.jar -> ejb1
        my.ear -> my.war -> servlet1 -> ejb-ref -> ejb1

        There is only one DeploymentControllerContext for my.ear
        so making my.ear depend on ejb1 is a cirucular reference that will
        never be satisied.

        i.e. my.ear won't reach the REAL stage until ejb1 is installed
        ejb1 won't be installed because my.ear never reaches the REAL stage

        • 31. Re: EJB/War deployer ordering problem
          pmuir

          Carlo explained to me why this no longer works. In essence, the spec says that if you are accessing EJBs from a servlet, then you must declare your EJBs in web.xml (this is true for all other EJB3 implementations).

          JBoss EJB3/AS4/AS4.2 provided an extension to this, such that EJBs were available in global JNDI, and you didn't have to type them all out in web.xml. This was a (nice) piece of value add that JBoss EJB3 provided, and Seam took advantage of.

          Carlo, correct me if I'm wrong :)

          So, taking this forward - without this, there are no Seam examples that are guaranteed to work in AS5. We'll add a jboss5 configuration to the port of booking example to jee5 so that we have at least one example that runs. And I guess we start converting our examples over to be non-EJB3 so that they run on both JBoss 4.2 and 5.

          • 32. Re: EJB/War deployer ordering problem
            wolfc

             

            "EE.5.2.1" wrote:
            The container implements the application component's environment, and provides it to the application component instance as a JNDI naming context.

            How the naming context is used by the different JavaEE roles is defined in EE.5.3.
            An application component is allowed to:
            1. use annotations to get an EJB
            2. do a JNDI lookup in the naming context
            3. use the descriptor to inject the EJB

            So by omission it's not allowed to do a global JNDI lookup.

            • 33. Re: EJB/War deployer ordering problem
              starksm64

              Why can't use just use the @EJBs on the servlet class as a hint about the ordering requirements?

              • 34. Re: EJB/War deployer ordering problem
                gavin.king

                 

                "scott.stark@jboss.org" wrote:
                Why can't use just use the @EJBs on the servlet class as a hint about the ordering requirements?


                There are no @EJB annotations why using Seam.

                • 35. Re: EJB/War deployer ordering problem
                  gavin.king

                  This was a (nice) piece of value add that JBoss EJB3 provided, and Seam took advantage of.

                  This was not just "nice", but essential to the usability of Seam. Without it, we can't say that Seam requires no XML. Basically, I'm not happy to say that Seam supports JBoss5 until this feature is back in. So if you want Seam to be in the next release of JBoss5, we need it back in *now*.

                  This is important.

                  • 36. Re: EJB/War deployer ordering problem

                    I don't understand what the issue is here?

                    You've always been able to override the order that ejbs/wars get deployed in.

                    This is the "relativeOrder" property on the ContextInfo
                    http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jboss-deployers/trunk/deployers-core-spi/src/main/org/jboss/deployers/spi/structure/ContextInfo.java?revision=70650&view=markup
                    and works the same way as the old suffix ordering in jboss4.x

                    It's just that the WarStructure deployer doesn't set it.

                    Of course this doesn't work (in the same way it didn't work in jboss-4.x)
                    if the war has external dependencies that aren't satisifed immediately.

                    But then that's the problem with using "heuristics" instead of real dependencies. :-)

                    • 37. Re: EJB/War deployer ordering problem

                       

                      "gavin.king@jboss.com" wrote:
                      "scott.stark@jboss.org" wrote:
                      Why can't use just use the @EJBs on the servlet class as a hint about the ordering requirements?


                      There are no @EJB annotations why using Seam.


                      I suspect that longer term we'll want some way of retrieving what Seam does
                      to resolve the ejb so we can properly manage cross deployment
                      dependencies that Seam creates.

                      e.g. a standalone seam war referencing a different ejb deployment will need to know
                      when that ejb deployment gets recycled.
                      The bootstrap (initial deployment) is just a special case of this.

                      • 38. Re: EJB/War deployer ordering problem
                        dimitris

                        This discussion has been going on since xmas(!) and we still don't have a solution.

                        Can Adrian or Ales take the following jira and implement the relativeOrder solution proposed by Adrian?

                        http://jira.jboss.com/jira/browse/JBAS-5190


                        • 39. Re: EJB/War deployer ordering problem
                          alesj

                           

                          "adrian@jboss.org" wrote:

                          I suspect that longer term we'll want some way of retrieving what Seam does
                          to resolve the ejb so we can properly manage cross deployment
                          dependencies that Seam creates.

                          The only thing that I can see us doing is checking to what all we can map @In annotation.
                          e.g. is there some existing EJB that we can map to using field's name
                          public class SomeSeamComponent
                          {
                           @In
                           private PaymentManager manager;
                          }
                          

                          and then use AnnotationEnvironment.classHasFieldAnnotatedWith(In.class)
                          (where In.class must come from unit's classloader).
                          Then we iterate over all fields, checking if we can do some mapping.

                          • 40. Re: EJB/War deployer ordering problem
                            theben

                            Perhaps related. We are testing a Seam 2.0.1.GA app in production on 4.2.EAP now on jboss-5.0.0.CR1 and it is so close. Seam components relying on the entityManager fail to load, but the entityManager then loads thereafter.


                            16:33:31,685 INFO [Component] Component: viewBalanceDto, scope: CONVERSATION, type: JAVA_BEAN, class: com.alliancedata.ecis.dto.paymentarrangement.ViewBalanceDto
                            16:33:31,732 INFO [Component] Component: workZoneBean, scope: APPLICATION, type: JAVA_BEAN, class: com.alliancedata.ecis.reference.WorkZoneBean
                            16:33:31,732 INFO [Contexts] starting up: persistenceBean
                            16:33:31,779 INFO [Contexts] starting up: adsTime
                            16:33:31,779 INFO [Contexts] starting up: org.jboss.seam.bpm.jbpm
                            16:33:31,826 INFO [StaleObjectLogConfigurer] stale object exceptions will be hidden from logging
                            16:33:33,732 INFO [Contexts] starting up: buildInfo
                            16:33:33,764 INFO [BuildInfo] creating BuildInfo
                            16:33:33,951 INFO [Version] Hibernate Annotations 3.4.0.CR1
                            16:33:33,967 INFO [Environment] Hibernate 3.3.0.CR1
                            16:33:33,982 INFO [Environment] hibernate.properties not found
                            16:33:33,998 INFO [Environment] Bytecode provider name : javassist
                            16:33:33,998 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
                            16:33:34,154 INFO [Version] Hibernate Commons Annotations 3.1.0.CR1
                            16:33:34,154 INFO [Version] Hibernate EntityManager 3.4.0.CR1
                            16:33:34,310 ERROR [BuildInfo] javax.persistence.PersistenceException: No Persistence provider for EntityManager named entityManagerFactory
                            16:33:34,326 ERROR [BuildInfo] java.lang.IllegalArgumentException: EntityManagerFactory not found in JNDI : java:/EntityManagerFactories/servicesDatasource
                            16:33:34,326 INFO [Contexts] starting up: contactLetterService
                            16:33:34,342 ERROR [[/nextgen]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
                            java.lang.IllegalArgumentException: EntityManagerFactory not found in JNDI : java:/EntityManagerFactories/servicesDatasource
                            at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:247)


                            ... but then later we see the persistence unit load:


                            16:33:35,576 INFO [TomcatDeployment] deploy, ctxPath=/jbossws, vfsUrl=jbossws.sar/jbossws-management.war
                            16:33:35,686 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=ServicesDS' to JNDI name 'java:ServicesDS'
                            16:33:35,686 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
                            16:33:36,186 WARN [QuartzTimerServiceFactory] sql failed: CREATE TABLE QRTZ_JOB_DETAILS(JOB_NAME VARCHAR(80) NOT NULL, JOB_GROUP VARCHAR(80) NOT NULL, DESCRIPTION VARCHAR(120) NULL, JOB_CLASS_NAME VARCHAR(128) NOT NULL, IS_DURABLE VARCHAR(1) NOT NULL, IS_VOLATILE VARCHAR(1) NOT NULL, IS_STATEFUL VARCHAR(1) NOT NULL, REQUESTS_RECOVERY VARCHAR(1) NOT NULL, JOB_DATA BINARY NULL, PRIMARY KEY (JOB_NAME,JOB_GROUP))
                            16:33:36,233 INFO [SimpleThreadPool] Job execution threads will use class loader of thread: main
                            16:33:36,233 INFO [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
                            16:33:36,233 INFO [JobStoreCMT] Using db table-based data access locking (synchronization).
                            16:33:36,248 INFO [JobStoreCMT] Removed 0 Volatile Trigger(s).
                            16:33:36,248 INFO [JobStoreCMT] Removed 0 Volatile Job(s).
                            16:33:36,248 INFO [JobStoreCMT] JobStoreCMT initialized.
                            16:33:36,248 INFO [StdSchedulerFactory] Quartz scheduler 'JBossEJB3QuartzScheduler' initialized from an externally provided properties instance.
                            16:33:36,248 INFO [StdSchedulerFactory] Quartz scheduler version: 1.5.2
                            16:33:36,248 INFO [JobStoreCMT] Freed 0 triggers from 'acquired' / 'blocked' state.
                            16:33:36,248 INFO [JobStoreCMT] Recovering 0 jobs that were in-progress at the time of the last shut-down.
                            16:33:36,248 INFO [JobStoreCMT] Recovery complete.
                            16:33:36,248 INFO [JobStoreCMT] Removed 0 'complete' triggers.
                            16:33:36,248 INFO [JobStoreCMT] Removed 0 stale fired job entries.
                            16:33:36,264 INFO [QuartzScheduler] Scheduler JBossEJB3QuartzScheduler_$_NON_CLUSTERED started.
                            16:33:36,483 INFO [ServerPeer] JBoss Messaging 1.4.1.CR1 server [0] started
                            16:33:36,608 INFO [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
                            16:33:36,733 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
                            16:33:36,733 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@1ef4049 started
                            16:33:36,748 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
                            16:33:36,748 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@48b622 started
                            16:33:36,748 WARN [ConnectionFactoryJNDIMapper] supportsFailover attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support failover
                            16:33:36,748 WARN [ConnectionFactoryJNDIMapper] supportsLoadBalancing attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support load balancing
                            16:33:36,764 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
                            16:33:36,764 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@d60482 started
                            16:33:36,764 INFO [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
                            16:33:36,779 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
                            16:33:37,451 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.units:ear=nextgen.ear,unitName=entityManager
                            16:33:38,123 WARN [Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
                            16:33:38,155 INFO [AnnotationConfiguration] Mapping package hq2d6049x1.bvws
                            16:33:38,436 INFO [STDOUT] CUSTOM ECISEmptyNullInterceptor OF com.alliancedata.ecis.hibernate.ECISEmptyNullInterceptor
                            16:33:38,483 WARN [EJB3OverridenAnnotationReader] Property com.alliancedata.ecis.persistence.UtilityContactInterface.SequenceId not found in class but described in <mapping-file/> (possible typo error)
                            16:33:38,483 WARN [EJB3OverridenAnnotationReader] Property com.alliancedata.ecis.persistence.CashInterface.SequenceId not found in class but described in <mapping-file/> (possible typo error)
                            16:33:38,561 INFO [AnnotationBinder] Binding entity from annotated class: com.alliancedata.ecis.persistence.DegreeDay
                            16:33:38,592 INFO [EntityBinder] Bind entity com.alliancedata.ecis.persistence.DegreeDay on table UDGD

                            1 2 3 Previous Next