[jboss-user] [EJB 3.0] - how to start!
woodmawa
do-not-reply at jboss.com
Mon Jan 1 12:09:16 EST 2007
I've been having a play with hibernate entity manager, and annotations in standalone mode,
I then thought i'd make the next step the embedded ejb3 server - but still without a full AS. (take things small step at a time).
I got the ejb3 RC9 and RC9.1 zips and unzipped them into a jboss root folder.
I then included all the jars in the /lib and ejb3.deployer foolders into the eclipse class path
I then tried to but i cant figure out what next. I tried to copy some sample programme from the hibernate persistence chapter 2 thats on the web.
| public class NeilsApp2 {
|
| import org.jboss.ejb3.embedded.EJB3StandaloneBootstrap;
| import javax.naming.InitialContext;
| public class HelloWorld {
| public static void main(String[] args) throws Exception {
| // Boot the JBoss Microcontainer with EJB3 settings, automatically
| // loads ejb3-interceptors-aop.xml and embedded-jboss-beans.xml
| EJB3StandaloneBootstrap.boot(null);
| // Deploy custom stateless beans (datasource, mostly)
| EJB3StandaloneBootstrap
| .deployXmlResource("META-INF/helloworld-beans.xml");
| // Deploy all EJBs found on classpath (slow, scans all)
| // EJB3StandaloneBootstrap.scanClasspath();
| // Deploy all EJBs found on classpath (fast, scans build directory)
| // This is a relative location, matching the substring end of one
| // of java.class.path locations. Print out the value of
| // System.getProperty("java.class.path") to see all paths.
| EJB3StandaloneBootstrap.scanClasspath("helloworld-ejb3/bin");
| // Create InitialContext from jndi.properties
| Listing 2.16 ?Hello World? main application code, calling EJBs
| Starting a Java Persistence project 85
| InitialContext initialContext = new InitialContext();
| // Look up the stateless MessageHandler EJB
| MessageHandler msgHandler = (MessageHandler) initialContext
| .lookup("MessageHandlerBean/local");
| // Call the stateless EJB
| msgHandler.saveMessages();
| msgHandler.showMessages();
| // Shut down EJB container
| EJB3StandaloneBootstrap.shutdown();
| }
|
this as cut and pasted. Eclipse says it cant find resolution for the imports. In particular i cant find any jar file with an org.jboss.ejb3.embedded package in it.
I dont understand what else i'm missing.
I downloaded the jboss5 beta - however if i try and use jboss IDE to create a server it only sees version4. I pointed it at the jboss5 server anyhow in default and all modes. HOwever if i try and create an ejb3 project in eclipse - it says the server doesnt have the required ejb3 jars. so i've gone no further down this route at present.
Any how i wanted the embbedded version outside of an AS first. So what am i supposed to do to get the ejb3 embedded version up and running.
The chapter2 words imply their is an embedded-jboss-beans.xml file but i cant find that in the rc9.1 extract. Do you have to have the full AS as well as the ejb3 files?
Any help?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997109#3997109
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997109
More information about the jboss-user
mailing list