[jboss-user] [EJB 3.0] - Re: EntityManager Injection, Null Pointer Exception. (Sorry.
repkin
do-not-reply at jboss.com
Thu Jun 19 02:57:51 EDT 2008
I am so thankful for your helps, finally it worked.
This is the final situation:
I have changed ejb call part like that:
| Context context = new InitialContext();
| PrStaffInterface prstaff = (PrStaffInterface)context.lookup("surgeonfish/PrStaffHome/local");
| prstaff.findById(new Integer(username));
|
And I have changed little part of persistence.xml
| <persistence>
| <persistence-unit name="time_report_persistence_context">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/time_reporting_data_source</jta-data-source>
| <jar-file>/surgeonfish.jar</jar-file>-->this place changed
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
| <property name="hibernate.show_sql" value="true"/>
| <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
| <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
| </properties>
| </persistence-unit>
| </persistence>
|
I have thought, I dont need to lookup. The ejb container is injecting, or intercepting at the object initialization and giving already created ejb object.
Thanks again.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159169#4159169
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159169
More information about the jboss-user
mailing list