aspose file tools*
The moose likes JBoss/WildFly and the fly likes Injection exception, session bean not bound Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Injection exception, session bean not bound" Watch "Injection exception, session bean not bound" New topic
Author

Injection exception, session bean not bound

Hernán Quevedo
Ranch Hand

Joined: Mar 18, 2009
Posts: 31
Hey, all.

I'm having this terrible problem... I created a new Enterprise Application project in Eclipse, with two other modules, web and ejb but... using JEE EJB3 annotations, I have this bean made in the faces-config.xml editor in Ganymede - windows vista:

The managed bean:



The session-bean:



The local interface:



The session-bean comes from an EJB 3.0 project packed in a JAR inside the WAR which comes from a Dynamic Web project, both inside an EAR, deployed on JBoss 5.0, and then it goes:



Any help... really appreciated.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5843
    
    7

Have you used JNDIView to determine the exact JNDI name for your EJB?


JBoss In Action
Hernán Quevedo
Ranch Hand

Joined: Mar 18, 2009
Posts: 31
Thanks.

Well, I had to make a properties object and pass it on the new InitialContext( properties ) to lookup. The session bean is been located correctly but the managed bean is still missing in a NameNotFoundException, strangely because is a managed bean defined in the faces-config.xml file.

On the other hand, I changed my EJB project for a JPA project with a connection to mysql. And when I deploy it says:



SessionAcceser.java on line 50 says:



I'm supposed to be using jdk 1.5... I don't why this is happening... any ideas??
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5843
    
    7

Are you using JPA or plain Hibernate? If JPA, then what is in your persistence.xml file, and where is that file located (relative to your apps base directory)? The error states that the persistent unit named 'factory' cannot be found and the name should be declared in persistence.xml.
Hernán Quevedo
Ranch Hand

Joined: Mar 18, 2009
Posts: 31
Done.

I'm using JPA and I relocated the persistence.xml plus corrected the references of persistence unit.

It is binding OK now, but... it says:



Line 48 says:


And I declared emf as:


As it is declared on persistence.xml.

Do I have to look up the persistence unit on JNDI or...?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Injection exception, session bean not bound