How to setup EJB3 development environment (Eclipse, JBoss 7.1)

7 February 2012 By Nithya Vasudevan 26,649 views 11 Comments
4 Flares Twitter 1 Facebook 2 Google+ 1 4 Flares ×

Environment Used

  • JDK 6 (Java SE 6)
  • EJB 3.0
  • Eclipse Indigo IDE for Java EE Developers (3.7.1)
  • JBoss Tools – Core 3.3.0 M5 for Eclipse Indigo (3.7.1)
  • JBoss Application Server (AS) 5.1.0

Installing JDK

JDK should be installed with proper environment set up. Read this page for installing the JDK and setting up the environment.

Installing Eclipse IDE

We use Eclipse IDE through out this tutorial. If you need to install Eclipse, you can read this page.

Installing JBoss Tools

JBoss Tools has set of Eclipse plug-ins that supports JBoss and related technology like Hibernate, JBoss AS, EJB and more… You can read this page to install JBoss Tools for Eclipse IDE.

Downloading JBoss Application Server (AS)

If you need to install JBoss AS, you can download it from this location:
http://www.jboss.org/jbossas/downloads/
NOTE:This tutorial uses “JBoss AS 7.1.0.CR1b” version.

Installing JBoss Application Server (AS)

To install JBoss AS, all you have to do is simply extract the downloaded (zip or tar formats) file to a safe location on your machine. You can install JBoss Application Server on any operating system that supports the zip or tar formats.

Configuring JBoss AS in Eclipse IDE

Open Eclipse IDE

Add Server

Make sure you are in Java EE perspective and in “Servers” area, right click -> New -> Server.

Here you will see list of servers that can be configured in the installed Eclipse version. You will find JBoss AS 7.1 under “JBoss Community” as shown below.

Select “JBoss AS 7.1” and click Next.

Configuring JBoss AS location

Select the JBoss Root folder which has bin folder.

and click Next.

Finish

Make sure the runtime information is correct and click Finish.
The configured JBoss AS will be displayed in the “Servers” view.

Start Server

It is easy to manage the server instance. Right-click on the server and start and stop it to ensure its proper working.

Test your Installation

Start the server and type http://localhost:8080 in your browser and you should able to see the JBoss AS Welcome screen.

Tags: , , , , , , , ,

  • Pingback: JavaPins

  • biman

    Thank you for explaining in such minute detail. Its very helpful for beginners.

  • Abhishek D

    I’m using Eclipse Juno. I installed JBoss AS 7 successfully via Eclipse itself, and I was able to see JBoss AS 7 in the list. Now the Dialog Box of Install repository asks for the path of the jBoss installation.

    I searched my entire computer, but could not find the path where it was installed. Any help in this regard will be great.

    • http://theopentutorials.com Praveen Macherla

      See step 5, you have to download JBoss AS 7 and extract.

  • Abhishek D

    Thanks for replying. I used the option “Install new software” within Eclipse itself to download. The AS 7 also shows in the list of options ‘Define a new server’. Yet it asks for some path, which I can’t find.

    I’m trying to download JBoss ver 4.0 as that is the version that works in Juno. Let’s see how it works out.

  • Abhishek D

    No I’m out of ideas. I see the list of JBoss AS servers, but in the next step which asks to fill the path, I cna’t find it.

    I search the entire hard disk, but there is no path which has JBoss (except org.eclipse.plugin..blah…blah…blah).

    • http://theopentutorials.com Praveen Macherla

      JBoss AS and tools are different. What you installed inside eclipse is a tool which can integrate the JBoss AS server into eclipse so that we can start and stop server inside eclipse. The tool does not contain the server. So download JBoss AS from their website and extract it. Give this path in the eclipse “Define New Server”.

      Hope this is clear.

  • kristi

    EJBs shall be deployed on JBOSS 7.1 application server
    Servlet shall be deployed on JBOSS 7.1 application server
    How can i write test case for this two not sure at all.

  • sk patnaik

    I am getting the following error while running the server:

    ———————————–

    Exception in thread “main” java.lang.ExceptionInInitializerError
    at org.jboss.as.server.Main.main(Main.java:92)
    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.modules.Module.run(Module.java:248)
    at org.jboss.modules.Main.main(Main.java:313)
    Caused by: java.lang.IllegalStateException: The LogManager was not properly installed (you must set the “java.util.logging.manager” system property to “org.jboss.logmanager.LogManager”)
    at org.jboss.logmanager.Logger.getLogger(Logger.java:60)
    at org.jboss.logmanager.log4j.BridgeRepositorySelector.(BridgeRepositorySelector.java:42)
    … 7 more
    ——————————————————————
    helps in this will be appreciable….

    • Praveen

      Hope your issue got resolved, if not you can try this:

      updated runtime configurations for jboss server in eclipse as below:

      -mp “D:/Development2/jboss-as-7.1.0.CR1b/modules” -jaxpmodule javax.xml.jaxp-provider -logmodule org.jboss.logmanager org.jboss.as.standalone -b 0.0.0.0 –server-config=standalone.xml

  • Pingback: EJB 3.0 review