• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error, executing client for entity bean

 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello, help please, any idea why my client program returns this:

will appreciate comments

(this is from 'ejb kick start' book)

---------------------

C:\bookeaz>java com.bookeaz.admin.BookAdministrator books.dat
establishing a connection through url http://localhost:1059
java.io.FileNotFoundException: C:\bookeaz\config\security.properties (The system
cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at com.sun.enterprise.util.Utility.getPropertiesFromFile(Utility.java:42
)
at com.sun.enterprise.iiop.POAEJBORB.<clinit>(POAEJBORB.java:78)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.omg.CORBA.ORB.create_impl(Unknown Source)
at org.omg.CORBA.ORB.init(Unknown Source)
at com.sun.enterprise.util.ORBManager.createORB(ORBManager.java:138)
at com.sun.enterprise.util.ORBManager.init(ORBManager.java:65)
at com.sun.enterprise.naming.SerialInitContextFactory.<init>(SerialInitC
ontextFactory.java:31)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at com.bookeaz.admin.BookAdministrator.establishBookHome(BookAdministrat
or.java:90)
at com.bookeaz.admin.BookAdministrator.main(BookAdministrator.java:51)
java.io.FileNotFoundException: C:\bookeaz\config\ejb.properties (The system cann
ot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at com.sun.enterprise.util.Utility.getPropertiesFromFile(Utility.java:42
)
at com.sun.enterprise.iiop.J2EEInitializer.<init>(J2EEInitializer.java:5
4)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at com.sun.corba.ee.internal.Interceptors.PIORB.registerORBInitializers(
PIORB.java:377)
at com.sun.corba.ee.internal.Interceptors.PIORB.parseProperties(PIORB.ja
va:347)
at com.sun.corba.ee.internal.TxPOA.TxPIORB.parseProperties(TxPIORB.java:
116)
at com.sun.corba.ee.internal.corba.ORB.set_parameters(ORB.java:461)
at com.sun.corba.ee.internal.POA.POAORB.set_parameters(POAORB.java:156)
at com.sun.corba.ee.internal.Interceptors.PIORB.set_parameters(PIORB.jav
a:336)
at org.omg.CORBA.ORB.init(Unknown Source)
at com.sun.enterprise.util.ORBManager.createORB(ORBManager.java:138)
at com.sun.enterprise.util.ORBManager.init(ORBManager.java:65)
at com.sun.enterprise.naming.SerialInitContextFactory.<init>(SerialInitC
ontextFactory.java:31)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at com.bookeaz.admin.BookAdministrator.establishBookHome(BookAdministrat
or.java:90)
at com.bookeaz.admin.BookAdministrator.main(BookAdministrator.java:51)

Warning: unable to read transaction.interoperability config property
java.io.FileNotFoundException: C:\bookeaz\config\security.properties (The system
cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at com.sun.enterprise.util.Utility.getPropertiesFromFile(Utility.java:42
)
at com.sun.enterprise.iiop.security.SecurityMechanismSelector.<clinit>(S
ecurityMechanismSelector.java:102)
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.getEndPointInfo(IIOPSSLS
ocketFactory.java:211)
at com.sun.corba.ee.internal.iiop.ConnectionTable.getConnection(Connecti
onTable.java:73)
at com.sun.corba.ee.internal.iiop.ConnectionTable.getConnection(Connecti
onTable.java:68)
at com.sun.corba.ee.internal.iiop.GIOPImpl.getConnection(GIOPImpl.java:7
0)
at com.sun.corba.ee.internal.corba.InitialNamingClient.locateObject(Init
ialNamingClient.java:769)
at com.sun.corba.ee.internal.corba.InitialNamingClient.getIORUsingHostIn
fo(InitialNamingClient.java:597)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolveCorbaloc(I
nitialNamingClient.java:573)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolveUsingORBIn
itRef(InitialNamingClient.java:544)
at com.sun.corba.ee.internal.corba.InitialNamingClient.cachedInitialRefe
rences(InitialNamingClient.java:1080)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolve_initial_r
eferences(InitialNamingClient.java:981)
at com.sun.corba.ee.internal.corba.ORB.resolve_initial_references(ORB.ja
va:2425)
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.jav
a:52)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120
)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.bookeaz.admin.BookAdministrator.establishBookHome(BookAdministrat
or.java:94)
at com.bookeaz.admin.BookAdministrator.main(BookAdministrator.java:51)
caught an exception processing file books.dat:javax.naming.NameNotFoundException
: BookHome not found
 
Raju Mittal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

try accessing the file using C:\\bookeaz\\config\\security.properties.
or you can specify the c:\bookeaz\config in classpath and access security.properties using InputStreams and aftewards using load method of properties file to read this property file.

I hope this helps

Rajesh
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do not use InputStream as this means using the java.io package (prohibited in the EJB spec). Use ResourceBundle instead.
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
roger, the client being external to the ejb, maybe it can use the file stream? just thinking...coz it can be anything, any client...what do you think
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aahhh!!! finally it ran...

warning on this book, lots of complain on errors on this book...you can see amazon

good thing is, it has a format that suits some learning conditions...

its for beginners handson.

'ejb 2.1 kick start' its for 2.1 but im using it only to get a feel of the handson.

i recommend this book to anyone who wants to apply beginning ejb stuff.

but dont blame me if you end up pulling out all your hair or say that using this book is same as root canal, because of book and book code errors.

i created empty securities.properties, and ejb.properties, as the code looked for it(i didnt write the code, the book supplied it)....also another bug in the book, the jndi should be BookHome, not BookBean...
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
roger, the client being external to the ejb, maybe it can use the file stream? just thinking...coz it can be anything, any client...what do you think

That's fine, but consider that the client of an EJB can be another EJB. So, get accustomed to programming without breaking the EJB programming restrictions.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic