Hi Halas,

Is the 'java.naming.factory.url.pkgs' property is correctly set 
in your jndi.properties file ?
        java.naming.factory.url.pkgs    org.objectweb.jonas.naming

Kind regards.
H�l�ne.

"Halas, Miroslav" wrote:
> 
> Well, RMI din't work either so it is not probably problem of Jeremie.
> If I get trace from JOnas and debug the startup portion, I can see, that the
> property is read from the XML file and bind.
> 
> Deployment Descriptor of 'aqp.beans.busreq.BusinessRequirement' is read
> 
> getDisplayName()=null
> getEjbName()=aqp.beans.busreq.BusinessRequirement
> getJndiName()=aqp.beans.busreq.BusinessRequirement
> getHomeClass()=interface aqp.beans.busreq.BusinessRequirementHome
> getRemoteClass()=interface aqp.beans.busreq.BusinessRequirement
> getEjbClass()=class aqp.beans.busreq.BusinessRequirementBean
> getEnvEntryDesc(0)=getName()=DOCUMENT_DB_TABLE getType()=class
> java.lang.String getValue()=T_BUSINESS_REQUIREMENT...
> 
> ...
> 
> JEntityHome constructor for aqp.beans.busreq.BusinessRequirement
> JBeanMetaData.JBeanMetaData(ejbHome,aqp.beans.busreq.BusinessRequirementHome
> , aqp.beans.busreq.BusinessRequirement, aqp.beans.id.InTypeID, false, false)
> JBeanHome.setEJBMetaData()
> JOnASBusinessRequirementBeanBusinessRequirementHome(aqp.beans.busreq.Busines
> sRequirement)
> EJBHome:aqp.beans.busreq.JOnASBusinessRequirementBeanBusinessRequirementHome
> for aqp.beans.busreq.BusinessRequirement available
> NamingManager: setBeanEnvironment
> NamingManager: setComponentContext: aqp.beans.busreq.BusinessRequirement
> NamingManager: Binding object DOCUMENT_DB_TABLE -> T_BUSINESS_REQUIREMENT
> CompNamingContext rebind DOCUMENT_DB_TABLE
> NamingManager: setComponentContext: reset to null
> createEJBContainer()
> ...
> 
> do you haveany other clue, where could be the problem? The strange thing is
> that the previous values are looked up correctly, it is just his environment
> propery (and before the resource factory for DataSources) which is causing
> us this showstopper
> 
> in setSessionContext
> 
> this passes
>          ctcContext            = new InitialContext();
>          m_dcDocControlHome    = (DocumentControllerHome)ctcContext.lookup(
> 
> "aqp.beans.document.DocumentController");
>          m_qrcQueryControlHome = (QueryControllerHome)ctcContext.lookup(
>                                     "aqp.beans.query.QueryController");
> 
>          // Lookup data source for this bean
>          m_dsDataSource = (DataSource)ctcContext.lookup("aqpjdbc");
> 
> this fails
>          objDocDBTable =
> ctcContext.lookup("java:comp/env/DOCUMENT_DB_TABLE");
> 
> Best Regards,
> 
> Miro
> 
> -----Original Message-----
> From: Halas, Miroslav [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 15, 2000 3:51 PM
> To: 'Philippe Coq'
> Cc: [EMAIL PROTECTED]
> Subject: RE: Can't read bean environment properties
> 
> Hi Philippe,
> 
> I don't understand either. We have system with something over 40 beans so
> far and everything was working without any problems. Initially I copied the
> code you have mentioned from Jonas examples to our beans and it didn't work.
> They are tried to investigate. I still cannot find out what is wrong. I have
> tried debugging, but our JBuilder3 always throws an GPF inside our beans. As
> the last chance I have tried to run Jonas examples.
> 
> I always get following error message from clients
> Getting a UserTransaction object from JNDI
> Cannot lookup UserTransaction: javax.naming.NameNotFoundException: name
> "javax.transaction.UserTransaction" not bound
> 
> If I run JonasAdmin to check exported names, UserTransaction is not there
> Current EJBServer : jonas
> JonasAdmin (jonas) > jndi
> TMFactory
> aqpjdbc
> OpHome
> java:comp
> jonas_Adm
> JonasAdmin (jonas) > quit
> 
> BTW. I forgot to mention, that we are using Jonas 2.0 with Jeremie. When I
> have tried lookup using
> lookup("DOCUMENT_DB_TABLE") I have got expected exception, so it looks like
> lookup works
> 
> java.rmi.RemoteException: JDNI error. Original message: name
> "DOCUMENT_DB_TABLE"
>  not bound; nested exception is:
>         javax.naming.NameNotFoundException: name "DOCUMENT_DB_TABLE" not
> bound
> javax.naming.NameNotFoundException: name "DOCUMENT_DB_TABLE" not bound
>         at
> org.objectweb.jeremie.libs.services.registry.jndi.JRMIRegistryContext
> .lookup(JRMIRegistryContext.java:166)
>         at
> org.objectweb.jeremie.libs.services.registry.jndi.JRMIRegistryContext
> .lookup(JRMIRegistryContext.java:185)
>         at javax.naming.InitialContext.lookup(InitialContext.java:354)
>         at
> aqp.beans.core.CoreDocumentStatelessControllerBean.setSessionContext(
> CoreDocumentStatelessControllerBean.java:155)
>         at
> org.objectweb.jonas.container.JBeanSession.createContext(JBeanSession
> .java:218)
>         at
> aqp.beans.user.JOnASUserControllerBeanUserControllerHome.create(JOnAS
> UserControllerBeanUserControllerHome.java:34)
>         at
> aqp.servlets.session.LoginServlet.getController(LoginServlet.java:469
> )
>         at
> aqp.servlets.session.LoginServlet.verifyLogin(LoginServlet.java:358)
>         at
> aqp.servlets.session.SessionServlet.service(SessionServlet.java:169)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
>         at
> com.mortbay.HTTP.Handler.ServletHolder.service(ServletHolder.java, Co
> mpiled Code)
>         at
> com.mortbay.HTTP.Handler.ServletHandler.handle(ServletHandler.java:18
> 4)
>         at com.mortbay.HTTP.HttpServer.handle(HttpServer.java, Compiled
> Code)
>         at com.mortbay.HTTP.HttpListener.handleConnection(HttpListener.java,
> Com
> piled Code)
>         at com.mortbay.Util.ThreadedServer.run(ThreadedServer.java, Compiled
> Cod
> e)
>         at java.lang.Thread.run(Thread.java:479)
> 
> This made me think if the problem is not in our code or Jonas but maybe in
> Jeremie. I don't have source code for Jeremie to see how you handle
> "java:comp/env" names so now I am trying to rebuild our application under
> RMI to see if this helps. I will let you know about progress, right now this
> is the last thing I can think off to find out what is the problem.
> 
> Best Regards
> 
> Miro
> 
> -----Original Message-----
> From: Philippe Coq [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 15, 2000 11:02 AM
> To: Halas, Miroslav
> Cc: [EMAIL PROTECTED]
> Subject: Re: Can't read bean environment properties
> 
> "Halas, Miroslav" wrote:
> >
> > We were still unable to resolve this. Just one question, is anybody out
> > there using environment properties using XML deployment descriptors with
> > Jonas 2.0. Does it work? Can you send us and example? Thanks,
> >
> Hi Halas,
> I don't understand why you cannot resolve any names in java:comp/env
> context.
> Have you succeeded to run the $JONAS_ROOT/examples/src/eb example?
> As you can see in AccountExplBean.java the getConection method obtains
> the datasource via a lookup :
> initialContext.lookup("java:comp/env/jdbc/AccountExplDs");
> 
> Here is an example from our test suite where we use the environement
> naming context:
> 
> In a Session Bean we have :
> 
>         // Check from initial Context
>         try {
>             String value = (String) ictx.lookup("java:comp/env/myname");
>             if (!value.equals("mysession")) {
>                 Trace.errln("NSession: "+method+": ictx.lookup failed:
> myname="+value);
>                 throw new EJBException("NSession 6: "+method);
>             }
>         } catch (NamingException e) {
>             Trace.errln("NSession: "+method+": ictx.lookup raised
> exception:\n"+e);
>             throw new EJBException("NSession 7: "+method);
>         }
> 
> the corresponding part of the DD is:
>   <enterprise-beans>
>     <session>
>       <ejb-name>NSession</ejb-name>
>       <home>tests.ejb.naming.NSessionHome</home>
>       <remote>tests.ejb.naming.NSession</remote>
>       <ejb-class>tests.ejb.naming.NSessionBean</ejb-class>
>       <session-type>Stateful</session-type>
>       <transaction-type>Container</transaction-type>
>       <env-entry>
>         <env-entry-name>myname</env-entry-name>
>         <env-entry-type>java.lang.String</env-entry-type>
>         <env-entry-value>mysession</env-entry-value>
>       </env-entry>
> 
> JOnAS supports also the deprecated EJBContext.getEnvironment() method
> Here is an example that is running:
> 
>         // Test old method (EJB 1.0 - deprecated but must be supported)
>         try {
>             String oldvalue =
> ejbContext.getEnvironment().getProperty("old-prop");
>             if (oldvalue == null) {
>                 Trace.errln("NSession: "+method+": myEnv.lookup failed:
> old-prop=null");
>                 throw new EJBException("NSession 5a: "+method);
>             }
>             if (!oldvalue.equals("old-prop value")) {
>         Trace.errln("NSession: "+method+":myEnv.lookup
> failed:old-prop="+oldvalue);
>                 throw new EJBException("NSession 5b: "+method);
>             }
>         } catch (Exception e) {
>             Trace.errln("NSession: "+method+": \n"+e);
>             throw new EJBException("NSession 5c: "+method);
>         }
> 
> The corresponding part of the DD is:
> 
>       <env-entry>
>         <env-entry-name>ejb10-properties/old-prop</env-entry-name>
>         <env-entry-type>java.lang.String</env-entry-type>
>         <env-entry-value>old-prop value</env-entry-value>
>       </env-entry>
> 
> I Hope it helps
> 

-- 
-=- H�l�ne JOANIN -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  mailto:[EMAIL PROTECTED]    http://www-frec.bull.com
  Phone: 33.4.76.29.73.53          Fax: 33.4.76.29.76.00
 Download our EJB Server JOnAS at http://www.bullsoft.com/ejb
_______________________________________________________________
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to