tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Nordahl <>
Subject Re: Need advice on connecting up project
Date Sat, 07 Jul 2012 22:30:12 GMT
I was able to get TomEE working.. Looks like the lastest problem I was 
running into was because it was overriding my JDBCRealm defined in my 
project's context.xml and web.xml with the contents of it's tomee.xml 
file datasource settings.  Updated the datasource in the tomee.xml file 
and it is now working the same as Tomcat 7.0 w/ openejb.

Basically my question is how do I properly define and setup my EJB 
classes in a standard J2EE/JSP2.0 web app in netbeans now that I'm 
getting the initial context object.  I'm not finding the example 
projects straightforward or helpful in regard to the configuration 
aspect. I'm also not getting any error messages regarding a missing 
ejb-jar.xml, a missing openejb.xml, or problems loading the class files 
defined in my persistence.xml file that I can use to figure out what my 
next steps should be.

Attached are some bean class files, Apache TomEE output, ejb-jar.xml, 
and persistence.xml files if that is helpful.

Basically what I'm trying to accomplish is to be able to invoke objects 
in my JSP and java code which mirror my DB tables that modifications to 
are reflected in the DB with the least amount of drama, overhead, 
proprietary configurations, platform dependence, and developer learning 


On 7/7/2012 4:29 PM, Romain Manni-Bucau wrote:
> Hi,
> first why arent you using tomee (= don't include tomee jar in your webapp)
> then i'm sorry but what's your question? not sure i get it right?
> finally any clue on your app to see what your are using?
> - Romain
> 2012/7/7 David Nordahl<>
>> I've been trying to get OpenEJB hooked up to my web app project in
>> Netbeans and I've been having a lot of problems, but am making progress but
>> have spent almost 15 hours now looking at mailing list, forum, and
>> documentation stuff.
>> I successfully deployed the OpenEJB war with Tomcat after running into a
>> lot of issues trying to switch from Tomcat 7 to TomEE.
>> Basically my current status is:
>> 1. I can run all the example openejb junit cases successfully but I'm not
>> sure how to translate that success to my actual netbeans JSP 2.0 project.
>>   I'm not really familiar with how all the maven/junit stuff translates to
>> actual web app/IDE configurations.
>> 2. I can successfully get an openejb context using this command in my
>> servlet code:
>>          Properties properties = new Properties();
>>          properties.setProperty(**Context.INITIAL_CONTEXT_**FACTORY,
>> "org.apache.openejb.client.**LocalInitialContextFactory");
>>          InitialContext initialContext = new InitialContext(properties);
>> 3. The tomcat log seems to indicate that openejb it is successfully
>> loading my mysql datasource.
>> 3.  But I can't pull any bean objects out of the context.. this throws
>> exception:
>>            Object object = initialContext.lookup("**UserFacadeLocal");
>> 4. I probably don't have them properly defined, but I'm not getting any
>> errors about them being improperly defined to work with. So I'm not sure my
>> ejb-jar.xml is being discovered and I'm not sure how detailed a description
>> is necessary.  I don't get any thing in my tomcat log output saying it's
>> loading the ejb-jar.xml contents or saying that it is loading the<class>
>> elements contained in my persistence.xml file.
>> 5. I've tried putting a META-INF/ejb-jar.xml file about everywhere that is
>> recommended in my project folders on other discussion threads but the only
>> acknowledgement I get in the log output is that it is in the wrong place if
>> I put it in the root project folder.
>> 6. I'm working with Entity classes and facade/local interfaces created by
>> netbeans from my db schema.  They contain lots of this type stuff: @Entity,
>> @NamedQueries etc.. I'm wondering if this setup replaces the need for any
>> amount of explicit xml config file definitions.
>> 7. Last.. I find that you get namespace and other exceptions if you
>> include certain openejb/ejb jar files with your deployed project.  I found
>> a mailing list message saying to leave it out to avoid the errors, but it
>> didn't say how you'd then go about referencing any openejb library classes
>> in your project.
>> Thanks in advance..  It's been awhile since I've had to do a J2EE web
>> app.. Last time I used Jboss and some ide that just generated all the
>> classes and local and remote interfaces to persist class objects with my
>> DB.  I would like to keep things more simple and lightweight and stick with
>> tomcat on this project.
>> -David

View raw message