7 Replies Latest reply on Nov 11, 2005 12:54 PM by Khoya Raaz

    JBoss EJB 3.0 tutorial problems and solutions

    Marcel Marcel Newbie

      Hi

      i just want to report the troubles i had when trying to run the
      JBossIDE - TrailBlazer tutorial on my Linux box,
      with the mentioned steps it finally run fine.


      -> JBossIDE-1.5M2-ALL+EJB3
      -> jboss-4.0.3RC2
      -> jboss-EJB-3.0_RC1
      -> java 1.5.0_04-b05
      -> eclipse 3.1.0
      -> Linux kernel 2.6.11.4 (KDE)


      1) Install JBOSS
      ----------------
      export JBOSS_HOME=/opt/jboss-4.0.3RC2


      2) Install EJB3
      ---------------
      -> Install EJB3 as described in jboss-EJB-3.0_RC1/INSTALL.html into jboss
      (Missing jboss-ejb3x.jar for javax.ejb.* annotations)

      -> Add server/all/deploy/jboss-hibernet.deployer/ejb3-persistence.jar
      to eclipse IDE -> Properties -> Java Build Path -> Libraries
      to have annotations


      3) run.sh -c all
      -----------------------------------------
      Edit $JBOSS_HOME/bin/run.sh and add at the end

      -Djava.net.preferIPv4Stack=true \

      to avoid

      java.net.SocketException: bad argument for IP_MULTICAST_IF: address not bound to any interface

      on jboss startup (for Linux with IP6 enabled only).
      Do the same if you start jboss from inside eclipse.


      4) Inject
      ---------
      javax.ejb.Inject is not existing anymore,
      use
      @PersistenceContext
      instead (AuthorsBean.java)


      5) Author.java
      --------------
      Fix '@Column (name = "articleId")' to

      @Id (generate = GeneratorType.AUTO)
      @Column (name = "authorId")
      public int getAuthorId() {
      return authorId;
      }


      6) Serializable problem
      -----------------------
      I had to add 'implements Serializable' to Author.java and Article.java
      to get the servlet running


      Hopefully this saves others some time,
      estimated saving: 1000 users * 4 hours = 4000 hours = 500 man days = 2 man years :-)

      rgds
      Marcel