Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Embedded container example in EJB Cookbook does not work

 
Ranch Foreman
Posts: 1897
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying the embedded container example in EJB 3.1 Cookbook by Reese.
I think it may be because NetBean platform's embedded container cannot look up the bean.


When I ran it on NetBean Platform 8 , it says


CapitalApplication was successfully deployed in 4,976 milliseconds.
javax.naming.NamingException: Lookup failed for 'java:global/CapitalApplication/CapitalBean'
in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl} [Root exception is javax.naming.NameNotFoundException: CapitalBean not found]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:491)
....
Caused by: javax.naming.NameNotFoundException: CapitalBean not found
at com.sun.enterprise.naming.impl.TransientContext.doLookup(TransientContext.java:237)
...8)


fileStructure.jpg
[Thumbnail for fileStructure.jpg]
File Struture of the Bean and embedded container application
 
Himai Minh
Ranch Foreman
Posts: 1897
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also tried a different approach based on the JSR 318 chapter 21.
I guess the embedded container in Glassfish does not work.


I got a different error message:


properties: {javax.ejb.embeddable.modules=C:\Downloads\2381_Code\2381_01_Code\CapitalApplication\dist\CapitalApplication.jar}
Feb 28, 2015 11:27:11 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl createContainer
INFO: [EJBContainerProviderImpl] Using installation location C:\Program Files\glassfish-4.1\glassfish
Feb 28, 2015 11:27:11 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl createContainer
...
INFO: Authorization Service has successfully initialized.
....
...
Exception in thread "main" javax.ejb.EJBException: Modules: [CapitalApplication] do not match an entry in the classpath
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.addModules(EJBContainerProviderImpl.java:297)
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:130)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:127)
at embeddablecontainerapp.Main.main(Main.java:30)
Java Result: 1
BUILD SUCCESSFUL (total time: 6 seconds)

 
Their achilles heel is the noogie! Give them noogies tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic