hi,
Its me again. I forgot to attach the following information:
ejb-jar.xml file:
...
<entity>
<ejb-name>ProfileProperties</ejb-name>
<home>com.agentscape.cymon.profile.ProfilePropertiesHome</home>
<remote>com.agentscape.cymon.profile.ProfileProperties</remote>
<ejb-class>com.agentscape.cymon.profile.ProfilePropertiesBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Long</prim-key-class>
<reentrant>False</reentrant>
<cmp-field><field-name>id_</field-name></cmp-field>
<cmp-field><field-name>name</field-name></cmp-field>
<cmp-field><field-name>properties_</field-name></cmp-field>
<cmp-field><field-name>profile_</field-name></cmp-field>
<primkey-field>id_</primkey-field>
<env-entry>
<description>Foo property</description>
<env-entry-name>foo</env-entry-name>
<env-entry-value>value</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
</entity>
...
the java code to access the foo environment variable:
public Long ejbCreate(Long key) throws CreateException {
try {
Context ctx = (Context)new InitialContext().lookup("java:comp/env");
Hashtable hash = ctx.getEnvironment();
Enumeration en = hash.keys();
while (en.hasMoreElements())
System.out.println("\t Key: " + en.nextElement());
Object val = new InitialContext().lookup("java:comp/env/foo");
System.out.println("\t--- Foo lookup = " + val);
} catch (Exception e) {
e.printStackTrace();
}
the result:
...
[Container factory] Deployed application: file:/C:/Programme/jboss-2.0b3/deploy/
classes.jar
[ProfileProperties] Key: java.naming.factory.initial
[ProfileProperties] Key: java.naming.factory.url.pkgs
[ProfileProperties] javax.naming.NameNotFoundException: foo not bound
[ProfileProperties] at
org.jnp.server.NamingServer.getBinding(NamingServer.java:340)
...
So where is the failure that I've done ??
Thank you.
Bye.
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]