1 2 Previous Next 15 Replies Latest reply on Feb 17, 2010 4:03 PM by Gavin King

    I thought SFSBs did not need to implement java.io.Serializable?

    Arbi Sookazian Master

      So I was just playing around with Weld-1.0.1.CR2 and JRebel 3.0-M2-SNAPSHOT.


      Couple of interesting findings:


      1) I was able to add a method to the local interface of a EJB 3.0 SFSB and incrementally hot deploy using JRebel (this was not possible before).


      2) The class below is the code for the SFSB I injected into the Game managed bean.  Before ArbiTestBean implemented java.io.Serializable, I was seeing the following stack trace:


      22:22:04,437 ERROR [AbstractKernelController] Error installing to Start: name=vfsfile:/C:/Java/jboss-6.0.0.M1/server/default/deploy/weld-numberguess.war/_WeldBootstrapBean state=Create
      org.jboss.weld.UnserializableDependencyException: The bean org.jboss.weld.bean-flat-ManagedBean-class org.jboss.weld.examples.numberguess.Game declares a passivating scope but has non-serializable dependency: org.jboss.weld.bean-flat-ManagedBean-class org.jboss.weld.examples.numberguess.ArbiTestBean
           at org.jboss.weld.Validator.validateInjectionPointPassivationCapable(Validator.java:261)
           at org.jboss.weld.Validator.validateInjectionPoint(Validator.java:249)
           at org.jboss.weld.Validator.validateBean(Validator.java:80)
           at org.jboss.weld.Validator.validateRIBean(Validator.java:100)
           at org.jboss.weld.Validator.validateBeans(Validator.java:282)
           at org.jboss.weld.Validator.validateDeployment(Validator.java:268)
           at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:389)
           at org.jboss.weld.integration.deployer.env.helpers.BootstrapBean.boot(BootstrapBean.java:121)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
           at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
           at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:243)
           at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:111)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72)
           at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
           at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
           at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
           at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
           at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
           at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1633)
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:935)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1083)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:985)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:775)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
           at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
           at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
           at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
           at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
           at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1448)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1166)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1187)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1107)
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1633)
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:935)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1083)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:985)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:823)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:783)
           at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:699)
           at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
           at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
           at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
           at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403)
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1633)
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:935)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1083)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:985)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:775)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
           at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308)
           at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:258)
           at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:97)
           at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:860)
           at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:441)
           at java.lang.Thread.run(Thread.java:619)
      22:22:04,500 INFO  [TomcatDeployment] deploy, ctxPath=/weld-numberguess
      22:22:04,687 INFO  [config] Initializing Mojarra 2.0.1 (FCS b02) for context '/weld-numberguess'
      22:22:13,703 WARN  [Weld/Servlet] WELD-000700 Not starting Weld/Servlet integration as Weld failed to initialize
      22:22:13,765 INFO  [ProfileServiceBootstrap] Loading profile: ProfileKey@c33140[domain=default, server=default, name=default]
      22:22:13,765 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      DEPLOYMENTS MISSING DEPENDENCIES:
        Deployment "vfsfile:/C:/Java/jboss-6.0.0.M1/server/default/deploy/weld-numberguess.war/_WBInjector" is missing the following dependencies:
          Dependency "vfsfile:/C:/Java/jboss-6.0.0.M1/server/default/deploy/weld-numberguess.war/_WeldBootstrapBean" (should be in state "Installed", but is actually in state "**ERROR**")
      
      DEPLOYMENTS IN ERROR:
        Deployment "vfsfile:/C:/Java/jboss-6.0.0.M1/server/default/deploy/weld-numberguess.war/_WeldBootstrapBean" is in error due to the following reason(s): **ERROR**, org.jboss.weld.UnserializableDependencyException: The bean org.jboss.weld.bean-flat-ManagedBean-class org.jboss.weld.examples.numberguess.Game declares a passivating scope but has non-serializable dependency: org.jboss.weld.bean-flat-ManagedBean-class org.jboss.weld.examples.numberguess.ArbiTestBean
      
      



      I saw this stack trace before (when ArbiTestBean was a JavaBean) and after.  In the latter case it doesn't make sense to me however as I thought SFSBs don't need to implement Serializable.


      Here is an example from the distro which does not implement Serializable:


      @Stateful
      @RequestScoped
      @Named("translator")
      public class TranslatorControllerBean implements TranslatorController
      



      So what's the explanation for this?


      here's the injection in the Game class:


      @Inject ArbiTestBean arbi;



      I'm pretty happy about the JRebel EJB interface change hot deploy!

        • 1. Re: I thought SFSBs did not need to implement java.io.Serializable?
          Arbi Sookazian Master

          btw, it looks like JBoss 6.0.0.M1 ships with EJB 3.0 impl:


          Manifest-Version: 1.0
          Implementation-Title: JBoss EJB 3.0 Core
          Implementation-Version: 1.1.21
          Built-By: root
          Specification-Vendor: JBoss Inc.
          Created-By: Apache Maven
          Implementation-URL: http://labs.jboss.com/jbossejb3
          Implementation-Vendor: JBoss Inc.
          Implementation-Vendor-Id: org.jboss.ejb3
          Build-Jdk: 1.5.0_17
          Specification-Title: JBoss EJB 3.0 Core
          Specification-Version: 1.1.21
          Archiver-Version: Plexus Archiver
          
          



          When will EJB 3.1 be available (which JBoss 6 milestone?)

          • 4. Re: I thought SFSBs did not need to implement java.io.Serializable?
            John Ament Master

            I believe it depends on scope, but yeah any SFSB in SessionScoped should require it.

            • 5. Re: I thought SFSBs did not need to implement java.io.Serializable?
              Nicklas Karlsson Master

              I though all stateful session beans were automagically serializable (and serializable deps if injected).

              • 6. Re: I thought SFSBs did not need to implement java.io.Serializable?
                John Ament Master

                So I have thought it weird for a while that SFSB need to be serializable in certain cases.  But thinking about how it worked w/ servlet 2.5, it sort of makes sense.  Not sure if it requires a spec change or not to work properly.


                At some level, objects get crammed into the http session.  You could do this with an EJB ref, but it was never clear if it was due to it only being a reference (likely to a SLSB, as putting a SFSB in a servlet seems odd..) or it needing to be serializable.  the spec does say that http session works with a number of object types, ejb home, ejb object, serializable and ejb reference all being a part of them.  however, I don't see anything stating what should be the behavior of SFSB in request scope.  Other scopes should require serialization, but request scope should not, at least in my opinion.  passivation of the EJB does not require serializable as the ejb state (not the ejb itself) is what gets serialized, but now we have something weirder as we can now (easily) stuff the SFSB into an HTTP Session Scope directly.

                • 7. Re: I thought SFSBs did not need to implement java.io.Serializable?
                  Arbi Sookazian Master

                  I don't have access to the code/files currently (I'm at work).


                  But it basically looked like this (I re-created everything as close as possible from memory).


                  NOTE: I just realized that the SFSB impl and its local interface were packaged in the WAR directly, not even in a JAR, but I'm pretty sure that is not legal b/c ArbiTestBean is a EJB 3.0 SFSB, not EJB 3.1 SFSB and JBoss 6.0.0.M1 has a EJB 3.0-compatible container.  This is a new feature of EJB 3.1 spec (to be able to package your EJBs in a WAR, not an EAR, but I'm not sure if JARs are optional in EJB 3.1 or not).  So maybe that has something to do with the problem (I'm pretty sure I'm doing something illegal here!).  The interesting thing is the SFSB code in ArbiTestBean actually worked/executed properly without exceptions!


                  ArbiTestBeanLocal:


                  @Local
                  public interface ArbiTestBeanLocal {
                       public void setName(String name);
                       public String getName();     
                       /*public int getAge();
                       public void setAge(int age);*/
                  }



                  ArbiTestBean:


                  public class ArbiTestBean implements ArbiTestBeanLocal {
                  
                       private String name;
                       private int age;
                       
                       public String getName() {
                            return "George";
                       }
                  
                       public void setName(String name) {
                            this.name = name;
                       }
                  
                       /*public int getAge() {
                            return 22;
                       }
                  
                       public void setAge(int age) {
                            this.age = age;
                       }*/
                  
                  }



                  facelet (note the added getAge() for new h:commandButton):


                  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                  <html xmlns="http://www.w3.org/1999/xhtml"
                     xmlns:ui="http://java.sun.com/jsf/facelets"
                     xmlns:h="http://java.sun.com/jsf/html"
                     xmlns:f="http://java.sun.com/jsf/core">
                  
                     <ui:composition template="/template.xhtml">
                        <ui:define name="content">
                           <h1>Guess a number...</h1>
                           <h:form id="numberGuess">
                              <div style="color: red">
                                 <h:messages id="messages" globalOnly="false"/>
                                 <h:outputText id="Higher" value="Higher!" rendered="#{game.number gt game.guess and game.guess ne 0}"/>
                                 <h:outputText id="Lower" value="Lower!" rendered="#{game.number lt game.guess and game.guess ne 0}"/>
                              </div>
                      
                              <div>
                                 I'm thinking of a number between <span id="numberGuess:smallest">#{game.smallest}</span> and <span id="numberGuess:biggest">#{game.biggest}</span>. You have #{game.remainingGuesses} guesses remaining.
                              </div>
                         
                              <div>
                                 Your guess:
                                 <h:inputText id="inputGuess" value="#{game.guess}"
                                    required="true" size="3" disabled="#{game.number eq game.guess}" validator="#{game.validateNumberRange}"/>
                                 <h:commandButton id="guessButton" value="Guess" action="#{game.check}" disabled="#{game.number eq game.guess}"/>
                                 <h:commandButton id="arbiButton" value="getAge" action="#{game.getAge}"/>
                              </div>
                              <div>
                                 <h:commandButton id="restartButton" value="Reset" action="#{game.reset}" immediate="true"/>
                              </div>
                           </h:form>
                        </ui:define>
                     </ui:composition>
                  </html>



                  Game (note I changed the scope of this managed bean for facilitating testing of JRebel 3 via new tabs in browser):


                  @Named
                  //@SessionScoped
                  @ConversationScoped
                  public class Game implements Serializable
                  {
                     /**
                      * 
                      */
                     private static final long serialVersionUID = 991300443278089016L;
                  
                     private int number;
                     
                     private int guess;
                     private int smallest;
                     
                     @Inject @MaxNumber
                     private int maxNumber;
                     
                     private int biggest;
                     private int remainingGuesses;
                     
                     @Inject @Random Instance<Integer> randomNumber;
                     
                     @Inject
                     private ArbiTestBean arbiTest;
                     
                     public Game()
                     {
                     }
                  
                     public int getNumber()
                     {
                        return number;
                     }
                     
                     public int getGuess()
                     {
                        return guess;
                     }
                     
                     public void setGuess(int guess)
                     {
                        this.guess = guess;
                     }
                     
                     public int getSmallest()
                     {
                        return smallest;
                     }
                     
                     public int getBiggest()
                     {
                        return biggest;
                     }
                     
                     public int getRemainingGuesses()
                     {
                        return remainingGuesses;
                     }
                     
                     public void check()
                     {
                        if (guess > number)
                        {
                           biggest = guess - 1;
                        }
                        else if (guess < number)
                        {
                           smallest = guess + 1;
                        }
                        else if (guess == number)
                        {
                           FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Correct!"));
                        }
                        remainingGuesses--;
                     }
                     
                     @PostConstruct
                     public void reset()
                     {
                        this.smallest = 0;
                        this.guess = 0;
                        this.remainingGuesses = 10;
                        this.biggest = maxNumber;
                        this.number = randomNumber.get();
                     }
                     
                     public void validateNumberRange(FacesContext context,  UIComponent toValidate, Object value)
                     {
                        if (remainingGuesses <= 0)
                        {
                           FacesMessage message = new FacesMessage("No guesses left!");
                           context.addMessage(toValidate.getClientId(context), message);
                           ((UIInput) toValidate).setValid(false);
                           return;
                        }
                        int input = (Integer) value;
                  
                        if (input < smallest || input > biggest) 
                          {
                           ((UIInput) toValidate).setValid(false);
                  
                           FacesMessage message = new FacesMessage("Invalid guess");
                           context.addMessage(toValidate.getClientId(context), message);
                        }
                     }
                     
                     /*public void getAge() {
                          arbiTest.getAge();
                     }*/
                  }


                  • 8. Re: I thought SFSBs did not need to implement java.io.Serializable?
                    John Ament Master

                    I see a few issues with the code.  There's no @Stateless or @Stateful on the ArbiTestBean and the injection point should reference ArbiTestBeanLocal.  I don't see @Remove if it is stateful, so it won't load properly.

                    • 9. Re: I thought SFSBs did not need to implement java.io.Serializable?
                      Arbi Sookazian Master

                      Good comments.  Those were typos (or lack of typing?!)


                      IIRC, I did have this last night:


                      @Stateful
                      @RequestScoped
                      public class ArbiTestBean implements ArbiTestBeanLocal {
                      ...}



                      I did not have the @Remove method which was an oversight by me and/or the compiler (but I did not see any runtime or deployment exception regarding the lack of @Remove method which is required for SFSB as per JSR220).


                      So for the above, I'm sure that was the scenario.


                      As far as the injection is concerned, perhaps you're correct (and I know that what you say applies for @In injections for EJBs in Seam 2.x), but I'm pretty sure I did this:


                      @Inject
                         private ArbiTestBean arbiTest;



                      which did not cause any exception or compilation error that I noticed.  Anyways, the code definitely did work when I (during runtime test case execution) dynamically uncommented and saved the classes/interfaces and then JRebel dynamically reloading the classes/interfaces next time they were accessed which in my test scenario was when I opened a new tab and navigated to the home.xhtml again.


                      Interesting, no?

                      • 10. Re: I thought SFSBs did not need to implement java.io.Serializable?
                        John Ament Master

                        the only thing that sticks in my head as a likely scenario is that.


                        1. the EJB failed to deploy due to it being in a war, no errors printed
                        2. Weld bootstrapped a ManagedBean for ArbiTestBean, ignored the interface


                        I do believe that JB6M1 does not allow EJBs in WAR so the likely result is that it was ignored.

                        • 11. Re: I thought SFSBs did not need to implement java.io.Serializable?
                          Arbi Sookazian Master

                          Ok, so this is starting to make some sense now (although now I'm not as happy b/c it potentially means that the JRebel reload worked successfully for a JavaBean, not an EJB 3.0 component!)


                          Anyways, it's most likely the 2nd option you presented above.  The code is definitely working/running properly (I ran it in the debugger and saw console output).


                          Even after looking in the (still horrible!) AS 6 jmx-console (e.g. EJB3deployer) and the server.log, I was unable to see any references to the ArbiTestBean or Game.  One thing that would be useful is if Weld actually output the type of output I always see when Seam installs the @Name annotated Seam components and what scope they have, etc. in the console and server.log.  I don't see that happening in my log below.


                          btw, I'm wondering if Weld/EJB container should actually behave the way it does in my (illogical) scenario where the EJB impl and interface (for EJB 3.0 component) do not reside in a JAR in an EAR.  Shouldn't there be some deployment error or something??


                          WDYT?


                          10:32:01,294 INFO  [AbstractJBossASServerBase] Server Configuration:
                          
                               JBOSS_HOME URL: file:/C:/java/jboss-6.0.0.M1/
                               Bootstrap: $JBOSS_HOME\server/default/conf/bootstrap.xml
                               Common Base: $JBOSS_HOME\common/
                               Common Library: $JBOSS_HOME\common/lib/
                               Server Name: default
                               Server Base: $JBOSS_HOME\server/
                               Server Library: $JBOSS_HOME\server/default/lib/
                               Server Config: $JBOSS_HOME\server/default/conf/
                               Server Home: $JBOSS_HOME\server/default/
                               Server Data: $JBOSS_HOME\server/default/data/
                               Server Log: $JBOSS_HOME\server/default/log/
                               Server Temp: $JBOSS_HOME\server/default/tmp/
                          
                          10:32:01,310 INFO  [AbstractServer] Starting: JBossAS [6.0.0.M1 (build: SVNTag=JBoss_6_0_0_M1 date=200912040958)]
                          10:32:01,654 INFO  [AbstractMCServerBase] Starting Microcontainer, Main bootstrapURL=file:/C:/java/jboss-6.0.0.M1/server/default/conf/bootstrap.xml
                          10:32:02,029 INFO  [VFSCacheFactory] Initializing VFSCache [org.jboss.virtual.plugins.cache.CombinedVFSCache]
                          10:32:02,044 INFO  [VFSCacheFactory] Using VFSCache [CombinedVFSCache[real-cache: null]]
                          10:32:02,216 INFO  [CopyMechanism] VFS temp dir: C:\java\jboss-6.0.0.M1\server\default\tmp
                          10:32:02,216 INFO  [ZipEntryContext] VFS force nested jars copy-mode is enabled.
                          10:32:02,888 INFO  [ServerInfo] Java version: 1.6.0_17,Sun Microsystems Inc.
                          10:32:02,888 INFO  [ServerInfo] Java Runtime: Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
                          10:32:02,904 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Client VM 14.3-b01,Sun Microsystems Inc.
                          10:32:02,904 INFO  [ServerInfo] OS-System: Windows XP 5.1,x86
                          10:32:02,904 INFO  [ServerInfo] VM arguments: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:2865 -Dprogram.name=JBossTools: JBoss 5.1 Runtime -Xms256m -Xmx512m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.endorsed.dirs=C:\java\jboss-6.0.0.M1\lib\endorsed -Dfile.encoding=Cp1252 
                          10:32:02,919 INFO  [JMXKernel] Legacy JMX core initialized
                          10:32:05,044 INFO  [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml
                          10:32:05,107 INFO  [WebService] Using RMI server codebase: http://localhost:8083/
                          10:32:08,357 INFO  [AbstractServerConfig] JBoss Web Services - Native Server
                          10:32:08,357 INFO  [AbstractServerConfig] 3.2.1.GA
                          10:32:13,403 INFO  [LogNotificationListener] Adding notification listener for logging mbean "jboss.system:service=Logging,type=Log4jService" to server org.jboss.mx.server.MBeanServerImpl@53d4bf[ defaultDomain='null' ]
                          10:32:19,888 INFO  [JMXConnectorServerService] JMX Connector server: service:jmx:rmi://localhost/jndi/rmi://localhost:1090/jmxconnector
                          10:32:20,013 INFO  [MailService] Mail Service bound to java:/Mail
                          10:32:22,247 WARN  [JBossASSecurityMetadataStore] WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component which sucks messages from one node to another has not had its password changed from the installation default. Please see the JBoss Messaging user guide for instructions on how to do this.
                          10:32:22,388 INFO  [TransactionManagerService] JBossTS Transaction Service (JTA version - tag:JBOSSTS_4_6_1_GA) - JBoss Inc.
                          10:32:22,388 INFO  [TransactionManagerService] Setting up property manager MBean and JMX layer
                          10:32:22,607 INFO  [TransactionManagerService] Initializing recovery manager
                          10:32:22,716 INFO  [TransactionManagerService] Recovery manager configured
                          10:32:22,716 INFO  [TransactionManagerService] Binding TransactionManager JNDI Reference
                          10:32:22,732 INFO  [TransactionManagerService] Starting transaction recovery manager
                          10:32:23,278 INFO  [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_17\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jdk1.6.0_17\jre\bin;native
                          10:32:23,325 INFO  [Http11Protocol] Initializing Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080
                          10:32:23,341 INFO  [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-localhost%2F127.0.0.1-8009
                          10:32:23,357 INFO  [StandardService] Starting service jboss.web
                          10:32:23,357 INFO  [StandardEngine] Starting Servlet Engine: JBoss Web/2.1.6.GA
                          10:32:23,450 INFO  [Catalina] Server startup in 107 ms
                          10:32:23,466 INFO  [TomcatDeployment] deploy, ctxPath=/invoker
                          10:32:24,357 INFO  [TomcatDeployment] deploy, ctxPath=/jbossws
                          10:32:24,388 INFO  [TomcatDeployment] deploy, ctxPath=/web-console
                          10:32:24,732 INFO  [RARDeployment] Required license terms exist, view vfszip:/C:/java/jboss-6.0.0.M1/server/default/deploy/jboss-local-jdbc.rar/META-INF/ra.xml
                          10:32:24,732 INFO  [RARDeployment] Required license terms exist, view vfszip:/C:/java/jboss-6.0.0.M1/server/default/deploy/jboss-xa-jdbc.rar/META-INF/ra.xml
                          10:32:24,747 INFO  [RARDeployment] Required license terms exist, view vfszip:/C:/java/jboss-6.0.0.M1/server/default/deploy/jms-ra.rar/META-INF/ra.xml
                          10:32:24,747 INFO  [RARDeployment] Required license terms exist, view vfszip:/C:/java/jboss-6.0.0.M1/server/default/deploy/mail-ra.rar/META-INF/ra.xml
                          10:32:24,778 INFO  [RARDeployment] Required license terms exist, view vfszip:/C:/java/jboss-6.0.0.M1/server/default/deploy/quartz-ra.rar/META-INF/ra.xml
                          10:32:24,857 INFO  [SimpleThreadPool] Job execution threads will use class loader of thread: Thread-2
                          10:32:24,903 INFO  [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
                          10:32:24,903 INFO  [RAMJobStore] RAMJobStore initialized.
                          10:32:24,903 INFO  [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
                          10:32:24,903 INFO  [StdSchedulerFactory] Quartz scheduler version: 1.5.2
                          10:32:24,903 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
                          10:32:25,294 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
                          10:32:26,091 INFO  [ServerPeer] JBoss Messaging 1.4.3.GA server [0] started
                          10:32:26,200 INFO  [ConnectionFactory] Connector bisocket://localhost:4457 has leasing enabled, lease period 10000 milliseconds
                          10:32:26,200 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@1ed9911 started
                          10:32:26,216 INFO  [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
                          10:32:26,216 INFO  [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
                          10:32:26,216 INFO  [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
                          10:32:26,232 INFO  [ConnectionFactory] Connector bisocket://localhost:4457 has leasing enabled, lease period 10000 milliseconds
                          10:32:26,232 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@1e3f18b started
                          10:32:26,232 INFO  [ConnectionFactory] Connector bisocket://localhost:4457 has leasing enabled, lease period 10000 milliseconds
                          10:32:26,232 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@88c4d9 started
                          10:32:26,232 INFO  [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
                          10:32:26,357 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
                          10:32:26,513 INFO  [TomcatDeployment] deploy, ctxPath=/admin-console
                          10:32:26,575 ERROR [MyfacesConfig] Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations.
                          10:32:26,763 WARN  [LocaleUtils] Locale name in faces-config.xml null or empty, setting locale to default locale : en_US
                          10:32:28,638 INFO  [TomcatDeployment] deploy, ctxPath=/
                          10:32:28,778 INFO  [Weld/Version] WELD-000900 1.0 (0)
                          10:32:29,153 WARN  [InterceptionTypeRegistry] Class 'javax.interceptor.AroundTimeout' not found, interception based on it is not enabled
                          10:32:29,247 INFO  [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=#widgets
                          10:32:29,278 INFO  [Version] Hibernate Validator 4.0.2.GA
                          10:32:29,310 INFO  [DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
                          10:32:29,419 INFO  [Version] Hibernate Annotations 3.5.0.Beta1
                          10:32:29,435 INFO  [Environment] Hibernate 3.5.0-Beta-2
                          10:32:29,450 INFO  [Environment] hibernate.properties not found
                          10:32:29,450 INFO  [Environment] Bytecode provider name : javassist
                          10:32:29,481 INFO  [Environment] using JDK 1.4 java.sql.Timestamp handling
                          10:32:29,669 INFO  [Version] Hibernate Commons Annotations 3.2.0-SNAPSHOT
                          10:32:29,685 INFO  [Version] Hibernate EntityManager 3.5.0.Beta1
                          10:32:29,716 INFO  [Ejb3Configuration] Processing PersistenceUnitInfo [
                               name: widgets
                               ...]
                          10:32:29,763 ERROR [STDERR] URL: vfszip:/C:/java/jboss-6.0.0.M1/server/default/deploy/bar.war/WEB-INF/classes/
                            META-INF/orm.xml
                            **/*.hbm.xml
                          10:32:29,763 WARN  [Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
                          10:32:29,763 WARN  [Ejb3Configuration] Defining hibernate.transaction.flush_before_completion=true ignored in HEM
                          10:32:30,341 INFO  [AnnotationBinder] Binding entity from annotated class: org.example.bar.Widget
                          10:32:30,403 INFO  [EntityBinder] Bind entity org.example.bar.Widget on table Widget
                          10:32:30,497 INFO  [Version] Hibernate Validator 3.1.0.GA
                          10:32:30,528 INFO  [DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
                          10:32:30,591 INFO  [DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
                          10:32:30,606 INFO  [HibernateSearchEventListenerRegister] Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
                          10:32:30,606 INFO  [DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
                          10:32:30,731 INFO  [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
                          10:32:30,747 INFO  [InjectedDataSourceConnectionProvider] Using provided datasource
                          10:32:30,747 INFO  [SettingsFactory] RDBMS: HSQL Database Engine, version: 1.8.0
                          10:32:30,747 INFO  [SettingsFactory] JDBC driver: HSQL Database Engine Driver, version: 1.8.0
                          10:32:30,794 INFO  [Dialect] Using dialect: org.hibernate.dialect.HSQLDialect
                          10:32:30,810 INFO  [JdbcSupportLoader] createClob() method threw error : java.lang.reflect.InvocationTargetException
                          10:32:30,810 INFO  [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
                          10:32:30,810 INFO  [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
                          10:32:30,810 INFO  [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
                          10:32:30,810 INFO  [SettingsFactory] Automatic flush during beforeCompletion(): disabled
                          10:32:30,810 INFO  [SettingsFactory] Automatic session close at end of transaction: disabled
                          10:32:30,810 INFO  [SettingsFactory] JDBC batch size: 15
                          10:32:30,810 INFO  [SettingsFactory] JDBC batch updates for versioned data: disabled
                          10:32:30,825 INFO  [SettingsFactory] Scrollable result sets: enabled
                          10:32:30,825 INFO  [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
                          10:32:30,825 INFO  [SettingsFactory] Connection release mode: auto
                          10:32:30,825 INFO  [SettingsFactory] Default batch fetch size: 1
                          10:32:30,825 INFO  [SettingsFactory] Generate SQL with comments: disabled
                          10:32:30,825 INFO  [SettingsFactory] Order SQL updates by primary key: disabled
                          10:32:30,825 INFO  [SettingsFactory] Order SQL inserts for batching: disabled
                          10:32:30,825 INFO  [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
                          10:32:30,825 INFO  [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
                          10:32:30,825 INFO  [SettingsFactory] Query language substitutions: {}
                          10:32:30,825 INFO  [SettingsFactory] JPA-QL strict compliance: enabled
                          10:32:30,825 INFO  [SettingsFactory] Second-level cache: enabled
                          10:32:30,825 INFO  [SettingsFactory] Query cache: disabled
                          10:32:30,841 INFO  [SettingsFactory] Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
                          10:32:30,841 INFO  [RegionFactoryCacheProviderBridge] Cache provider: org.hibernate.cache.HashtableCacheProvider
                          10:32:30,841 INFO  [SettingsFactory] Optimize cache for minimal puts: disabled
                          10:32:30,841 INFO  [SettingsFactory] Cache region prefix: persistence.unit:unitName=#widgets
                          10:32:30,841 INFO  [SettingsFactory] Structured second-level cache entries: disabled
                          10:32:30,841 INFO  [SettingsFactory] Echoing all SQL to stdout
                          10:32:30,841 INFO  [SettingsFactory] Statistics: disabled
                          10:32:30,841 INFO  [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
                          10:32:30,841 INFO  [SettingsFactory] Default entity-mode: pojo
                          10:32:30,841 INFO  [SettingsFactory] Named query checking : enabled
                          10:32:30,841 INFO  [SettingsFactory] Check Nullability in Core (should be disabled when Bean Validation is on): disabled
                          10:32:30,903 INFO  [SessionFactoryImpl] building session factory
                          10:32:31,122 INFO  [SessionFactoryObjectFactory] Factory name: persistence.unit:unitName=#widgets
                          10:32:31,122 INFO  [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                          10:32:31,138 INFO  [SessionFactoryObjectFactory] Bound factory to JNDI name: persistence.unit:unitName=#widgets
                          10:32:31,138 WARN  [SessionFactoryObjectFactory] InitialContext did not implement EventContext
                          10:32:31,138 INFO  [DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
                          10:32:31,138 INFO  [DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
                          10:32:31,153 INFO  [SchemaExport] Running hbm2ddl schema export
                          10:32:31,153 INFO  [SchemaExport] exporting generated schema to database
                          10:32:31,153 INFO  [SchemaExport] Executing import script: /import.sql
                          10:32:31,153 INFO  [SchemaExport] schema export complete
                          10:32:31,153 INFO  [DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
                          10:32:31,153 INFO  [DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
                          10:32:31,153 INFO  [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                          10:32:31,388 INFO  [TomcatDeployment] deploy, ctxPath=/bar
                          10:32:31,481 INFO  [config] Initializing Mojarra 2.0.1 (FCS b02) for context '/bar'
                          10:32:36,638 INFO  [Weld/Version] WELD-000900 1.0 (0)
                          10:32:37,028 INFO  [TomcatDeployment] deploy, ctxPath=/foo
                          10:32:37,122 INFO  [config] Initializing Mojarra 2.0.1 (FCS b02) for context '/foo'
                          10:32:40,997 INFO  [TomcatDeployment] deploy, ctxPath=/jmx-console
                          10:32:41,106 INFO  [Weld/Version] WELD-000900 1.0 (0)
                          10:32:41,419 INFO  [TomcatDeployment] deploy, ctxPath=/weld-numberguess
                          10:32:41,497 INFO  [config] Initializing Mojarra 2.0.1 (FCS b02) for context '/weld-numberguess'
                          10:32:45,450 INFO  [ProfileServiceBootstrap] Loading profile: ProfileKey@2d2aca[domain=default, server=default, name=default]
                          10:32:45,466 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080
                          10:32:45,481 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-localhost%2F127.0.0.1-8009
                          10:32:45,481 INFO  [AbstractServer] JBossAS [6.0.0.M1 (build: SVNTag=JBoss_6_0_0_M1 date=200912040958)] Started in 44s:171ms
                          

                          • 12. Re: I thought SFSBs did not need to implement java.io.Serializable?
                            John Ament Master

                            Both are likely the issue, don't forget Weld doesn't deploy any EJBs, it delegates that to the EJB container.  That's why you see some of these issues right now, weld is using the EJB3 container and only knows about what the EJB 3 container knows.


                            As of right now, EJB3 Deployer doesn't scan WAR files, so it'll ignore them, even if the JAR is in the WAR.  It's still only going to look at modules listed in the EAR and ignore whatever's not there.  It's not actively just searching the way 3.1 describes.

                            • 13. Re: I thought SFSBs did not need to implement java.io.Serializable?
                              Arbi Sookazian Master

                              I appreciate your responses.  To be very clear, I am literally dropping the .class files for both the SFSB impl and interface directly here (exploded):


                              C:\java\jboss-6.0.0.M1\server\default\deploy\weld-numberguess.war\WEB-INF\classes\org\jboss\weld\examples\numberguess


                              which is obviously not recommended or legal.  I still think that a deployment error/exception should be thrown in this scenario but perhaps it's an issue/JIRA to take up with the JBoss AS team or the EJB 3.0 spec itself.


                              So I guess the bottom line in this case is that the ArbiTestBean is handled as a Weld managed bean, the EJB container knows or does nothing with it.


                              So if that's the case, is the Weld container then ignoring the @Stateful annotation?  Most likely yes as there are no exceptions thrown.

                              • 14. Re: I thought SFSBs did not need to implement java.io.Serializable?
                                John Ament Master

                                I fully understand how you are attempting to deploy your application.  However, the deployers will not handle what it doesn't know how to handle.  In the case of the EJB3 deployer, it's not going to understand how to read a WAR file.  The 3.1 deployer should.  There is no error that the app server should present, possibly a warning but really it shouldn't.  In EJB3, there are two possible ways to deploy an EJB JAR; either list the JAR file as an EJB module in application.xml or deploy the JAR file directly (note, this isn't always possible, depends on app server). 


                                Yes, the Weld container ignores EJB annotations.  It only understands a subset of annotations, named ManagedBean, life cycle and its own, as well as qualifiers.  Other annotations are handled by the appropriate containers (e.g. @PersistenceContext)

                                1 2 Previous Next