Hi,
how do you connect to the server ? If you are running a real java client
(dont know, if it works from jsp...), try the following to retrieve the
InitialContext:
m_Factory = "com.evermind.server.rmi.RMIInitialContextFactory";
// The application-name is the one you specify in the orion
server.xml
m_Url = "ormi://<host>/<application-name>";
try
{
// You could change the environment for the process
permanently, too...
Hashtable h = new Hashtable();
h.put(Context.INITIAL_CONTEXT_FACTORY,m_Factory);
h.put(Context.PROVIDER_URL, m_Url);
if (m_User != null)
{
h.put(Context.SECURITY_PRINCIPAL, m_User);
if (m_Password == null)
m_Password = "";
h.put(Context.SECURITY_CREDENTIALS, m_Password);
}
m_jndiContext = new InitialContext(h);
}
catch (NamingException ne)
{
// TODO: Check for type of error and distinguish...
}
catch (javax.ejb.EJBException ee)
{
// TODO: Check for type of error and distinguish...
}
And ensure, that in your ejb-jar.xml is the following
<enterprise-beans>
<entity>
<description>no description</description>
<display-name>[Bean name to be displayed]</display-name>
<ejb-name>[JNDI Name for the home]</ejb-name>
<home>[Full qualified home class]</home>
<remote>[Full qualified remote class]</remote>
<ejb-class>[Full qualified implementation class]</ejb-class>
<persistence-type>[Bean / Container]</persistence-type>
<prim-key-class>[Full qualified primary key class]</prim-key-class>
<reentrant>False</reentrant>
</entity>
...
</enterprise-beans>
and in your application.xml something like
<application>
<display-name>file:/opt/java/orion/applications/BaseModule/</display-name>
<description>Application description</description>
<module>
<ejb>[either the ejb.jar or the folder where the unpacked
bean(s) are placed]</ejb>
</module>
</application>
and in the server xml
<application name="[Application name]" path="../applications/[folder
or ear]" />
On server start, orion should print something like:
Auto-deploying [application name]...
Auto-deploying [module name]... done.
Orion/0.9.4 initialized
I'm not sure, but i think, orion is placing the JNDI bindings for each
application in an own context, so on connect you have to give the
application name in the uri.
Hope that helps !
Jens Stutte
-----Urspr�ngliche Nachricht-----
Von: ALLEN FOGLESON [mailto:[EMAIL PROTECTED]]
Gesendet am: Donnerstag, 23. M�rz 2000 12:26
An: Orion-Interest
Betreff: RE: Please help, with deploying EJB bean....
Alex;
All I can say is WHEW! I am still feeling out the 1.1 spec and I was
afraid maybe I had missed something really important. Now at least I know I
am not going crazy. I have been pulling my hair out on exactly the same
problem.
Al
-----Original Message-----
From: Alex Paransky
To: Orion-Interest
Sent: 3/22/00 6:01 PM
Subject: RE: Please help, with deploying EJB bean....
My SERVER.XML contains:
<application name="citysearch" path="../../citysearch" />
My ../../citysearch/META-INF/application.xml contains:
<xmlheader...>
<application>
<display-name>CitySearch</display-name>
<module>
<ejb>com/citysearch/ejb/ClassType</ejb>
</module>
</application>
My com/citysearch/ejb/ClassType/META-INF contains:
<xmlheader...>
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>ClassType</ejb-name>
<home>com.citysearch.ejb.ClassType.ClassTypeHome</home>
<remote>com.citysearch.ejb.ClassType.ClassType</remote>
<ejb-class>com.citysearch.ejb.ClassType.ClassTypeEJB</ejb-class>
<primkey-class>java.lang.Integer</primkey-class>
<reentrant>False</reentrant>
<persistence-type>Bean</persistence-type>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>ClassType</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
What else do I need to do? Are there any other files to configure?
Thanks
-AP_
-----Original Message-----
From: Alex Paransky
Sent: Wednesday, March 22, 2000 3:04 PM
To: Alex Paransky; Orion-Interest
Subject: RE: Please help, with deploying EJB bean....
I tried to bind something else into the naming registry with:
Context
context = new InitialContext();
Integer test = new Integer(23);
context.bind("test", test);
list(context, 0);
and it works ok. So I know it's not the registry that is having
problem.
What could be the problem? Are there any logs? This is all I get from
ORION:
E:\work\orion>java -jar d:\java\orion\orion.jar
Auto-deploying com/citysearch/ejb/ClassType... done.
Orion/0.9.4 initialized
No exceptions, no error messages NOTHING TO GO ON!
-AP_
-----Original Message-----
From: Alex Paransky [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 22, 2000 11:46 AM
To: Orion-Interest
Subject: RE: Please help, with deploying EJB bean....
I wrote a program that iterates the registry. I see the following:
Context: jdbc
Binding: DefaultPooledDS -->
com.evermind.sql.DefaultConnectionPoolDataSource
Context: xa
Binding: DefaultXADS --> com.evermind.sql.DefaultXADataSource
Binding: DefaultDS --> com.evermind.sql.ConnectionDataSource
Context: java:comp
Binding: ServerAdministrator --> Proxy0
Binding: Administrator --> Proxy1
Binding: ResourceFinder --> Proxy2
When I try to bind to java:comp/env/ejb/MyBean I get an exception:
javax.naming.NameNotFoundException: java:comp/env/ejb/MyBean not found
at com.evermind.server.rmi.RMIContext.lookup(JAX)
at javax.naming.InitialContext.lookup(InitialContext.java:354)
at
com.citysearch.ejb.ClassType.ClassTypeClient.main(ClassTypeClient.java,
Compiled Code)
I don't think the home is binding to the naming registry since it is not
under java:comp.
Any thing else I can look at?
Thanks.
-AP_
-----Original Message-----
From: Vasilenko, Dmitry [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 22, 2000 11:33 AM
To: 'Alex Paransky'
Subject: RE: Please help, with deploying EJB bean....
Try to use fully qualified JNDI name, i.e. instead of ejb/MyBean use
java:comp/env/ejb/MyBean.
I had the similar problem and that was the solution, kind of confusing,
though...
Please, let me know if it did not work for you ;-]
-----Original Message-----
From: Alex Paransky [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 22, 2000 12:46 PM
To: Orion-Interest
Subject: Please help, with deploying EJB bean....
Everything is deployed but, the home is not bound to the registry, or I
cannot find the home in the registry.
What configuration file do I need to check?
Thanks.
-AP_