Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Injection exception, session bean not bound

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you used JNDIView to determine the exact JNDI name for your EJB?
 
Hernán Quevedo
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...?
 
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic