This content has been marked as final.
Show 3 replies
-
1. Re: How to access a Singleton Session Bean
hd0815 Feb 14, 2013 10:32 AM (in response to foutjo)If the class you are in is not by itself an EJB you will have to use a JNDI lookup.
Context context = new InitialContext();
MySessionBean mbean = (MySessionBean) context.lookup("java:global/MySessionBean");
Make sure that JBoss published the EJB under the name you use.
-
2. Re: How to access a Singleton Session Bean
rhusar Feb 14, 2013 11:29 AM (in response to foutjo)EJB Singleton session bean from a java program
If you by any chance mean an external Java program, running outside of the JBoss AS' JVM, then you will need to employ an EJB client to connect to the AS and call methods remotely. Of course, injection will not work in this case and you will have to manually perform a lookup.
-
3. Re: How to access a Singleton Session Bean
foutjo Feb 14, 2013 12:45 PM (in response to hd0815)Thank you hd0815. Worked like a charm.