Hi,
Stripping to the relevant parts your mail leaves:
try using:
http://localhost:8082/InvokeAction//DefaultDomain%3Aservice%3DJNDIView/actio
n=list?action=list&param0%2Bboolean=true
this will show you how everything isregistered in the JNDI namespace.
You will find that your Hello Bean is bound to hello/Hello, thus can't be
found by anyone.
change jboss.xml to
> jboss.xml
> ===============================================
> <?xml version="1.0" encoding="UTF-8"?>
> <jboss>
>   <enterprise-beans>
>     <session>
>       <ejb-name>Hello</ejb-name>
>       <jndi-name>ejb/Hello</jndi-name>
>     </session>
>   </enterprise-beans>
> </jboss>
this should make Hello available at comp/env/ejb/Hello.
now for your web app, this change should remove the
> [Auto deploy] javax.naming.NamingException: ejb-ref:
> ejb/Hello, expected jndi-name in jboss-web.xml
Exception. With
> jboss-web.xml
> ===============================================
> <?xml version="1.0" encoding="UTF-8"?>
>
> <jboss-web>
>     <ejb-ref>
>         <ejb-ref-name>Hello</ejb-ref-name>
>         <jndi-name>ejb/Hello</jndi-name>
>     </ejb-ref>
> </jboss-web>
you now make the Bean available through comp/env/Hello to the web-app, so
AFAIK you should be happier whitout a jboss-web.xml, as you declare a
referece to ejb/Hello in
> web.xml
> ===================================================
> <?xml version="1.0" encoding="UTF-8"?>
>
> <web-app>
[SNIP]
> <!-- ### EJB References (java:comp/env/ejb) -->
>     <ejb-ref>
>         <ejb-ref-name>ejb/Hello</ejb-ref-name>
>         <ejb-ref-type>Session</ejb-ref-type>
>         <home>org.jbar.test.HelloHome</home>
>         <remote>org.jbar.test.Hello</remote>
>     </ejb-ref>
>
> </web-app>
So change some, have a look at JNDIView and tell us where you get.
Burkhard

----- Original Message -----
From: "Jaime Barciela" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 11:19 PM
Subject: [JBoss-user] NamingException killing me softly


> hi everybody
> the other day i joined the forum but there are not too
> many people there and is slow (for me), so i switch to
> the old and proven mail method
> i'm new with jboss and ejb and i'm trying to use an
> EJB (stateless session) from a servlet but it doesn't
> work, i can use it from a stand-alone java program
> succesfully
>
> even if i point the browser to
> http://localhost:8080/hello/HelloServlet
> i get this error
>
> ===================================================
> Error: 500
> Location: /hello/HelloServlet
> Internal Servlet Error:
>
> javax.servlet.ServletException: Failed to lookup
> java:comp/env/ejb/Hello, this is wrong
[snip]
> Root cause:
> javax.naming.NameNotFoundException: Hello not bound
> at
> ===================================================
>
> and at deploy time i get this error:
>
> ===============================================
> [Auto deploy] javax.naming.NamingException: ejb-ref:
> ejb/Hello, expected jndi-name in jboss-web.xml
>
> i'm using JBoss-2.2.2_Tomcat-3.2.2, jdk1.3.1, and
> win98
> and these are my config files
>
>
> jboss-web.xml
> ===============================================
> <?xml version="1.0" encoding="UTF-8"?>
>
> <jboss-web>
>     <ejb-ref>
>         <ejb-ref-name>Hello</ejb-ref-name>
>         <jndi-name>ejb/Hello</jndi-name>
>     </ejb-ref>
> </jboss-web>
>
>
> jboss.xml
> ===============================================
> <?xml version="1.0" encoding="UTF-8"?>
> <jboss>
>   <enterprise-beans>
>     <session>
>       <ejb-name>Hello</ejb-name>
>       <jndi-name>hello/Hello</jndi-name>
>     </session>
>   </enterprise-beans>
> </jboss>
>
>
> ejb-jar.xml
> ===============================================
> <?xml version="1.0" encoding="UTF-8"?>
>
> <ejb-jar>
>      <description>JBoss Hello jaime Sample
> Application</description>
>      <display-name>Hello EJB</display-name>
>      <enterprise-beans>
>        <session>
>          <ejb-name>Hello</ejb-name>
>          <home>org.jbar.test.HelloHome</home>
>          <remote>org.jbar.test.Hello</remote>
>
> <ejb-class>org.jbar.test.HelloBean</ejb-class>
>          <session-type>Stateless</session-type>
>          <transaction-type>Bean</transaction-type>
>        </session>
>      </enterprise-beans>
> </ejb-jar>
>
>
> application.xml
> ===============================================
> <?xml version="1.0" encoding="UTF-8"?>
>
> <application>
>     <display-name>Hello Tutorial</display-name>
>
>     <module>
>     <web>
>         <web-uri>hello.war</web-uri>
>         <context-root>/hello</context-root>
>     </web>
>     </module>
>
>     <module>
>         <ejb>hello.jar</ejb>
>     </module>
>
> </application>
>
>
> web.xml
> ===================================================
> <?xml version="1.0" encoding="UTF-8"?>
>
> <web-app>
> <!-- ### Servlets -->
>     <servlet>
>         <servlet-name>HelloServlet</servlet-name>
>
> <servlet-class>org.jbar.test.HelloServlet</servlet-class>
>     </servlet>
>     <servlet-mapping>
>         <servlet-name>HelloServlet</servlet-name>
>         <url-pattern>/HelloServlet</url-pattern>
>     </servlet-mapping>
>
>     <welcome-file-list>
>       <welcome-file>home.html</welcome-file>
>     </welcome-file-list>
>
> <!-- ### EJB References (java:comp/env/ejb) -->
>     <ejb-ref>
>         <ejb-ref-name>ejb/Hello</ejb-ref-name>
>         <ejb-ref-type>Session</ejb-ref-type>
>         <home>org.jbar.test.HelloHome</home>
>         <remote>org.jbar.test.Hello</remote>
>     </ejb-ref>
>
> </web-app>
>
>
>
> after two days of this i still don't know what i'm
> doing wrong
> i hope somebody can help me here
> thanks a lot in advance
> jaime
> p.s. sorry for the length fo the mail
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to