LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 12-15-2003, 03:01 PM   #1
juby
Member
 
Registered: Dec 2002
Location: Bangalore, India
Distribution: Ubuntu 5.*
Posts: 241

Rep: Reputation: 30
Angry Jboss hell with ejbs plz help


Hi
i am trying to call a stateless EJB from a ActionServlet (struts) the app
server i use is jboss 2.4.x, I dont know what is wrong but .. the application
throws error during startup :'(


this is the relevant log...

[01:11:11,562,EmbeddedCatalinaServiceSX] linkEjbRefs
[01:11:11,573,EmbeddedCatalinaServiceSX] Linking ejb-ref: ejb/LoginBean to JNDI
name: null
[01:11:11,601,EmbeddedCatalinaServiceSX] Failed to setup web application ENC
javax.naming.NamingException: ejb-ref: ejb/LoginBean, expected jndi-name in
jboss-web.xml

the commands i used to make the ejb-jar, war and ear files are

jar cvfM rave.war WEB-INF/ images/ *.jsp *.css

jar cvfM rave-ejb.jar META-INF/ejb-jar.xml raveEjb/*.class

jar cvfM rave.ear META-INF/application.xml META-INF/jboss.xml
META-INF/jboss-web.xml rave.war rave-ejb.jar

the contents of the XML files are
EJB-JAR.xml
===========
<ejb-jar>
<description>EJBs for Rave</description>
<display-name>Rave EJB</display-name>
<enterprise-beans>
<session>
<ejb-name>LoginBean</ejb-name>
<home>raveEjb.LoginHome</home>
<remote>raveEjb.Login</remote>
<ejb-class>raveEjb.LoginEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>LoginBean</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>


JBOSS.XML
=========
<?xml version="1.0" encoding="Cp1252"?>
<jboss>
<enterprise-beans>
<session>
<ejb-name>ejb/LoginBean</ejb-name>
<jndi-name>ejb/LoginBean</jndi-name>
</session>
<secure>false</secure>
</enterprise-beans>
</jboss>

JBOSS-WEB.XML
============
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<ejb-ref>
<ejb-ref-name>ejb/LoginBean</ejb-ref-name>
<jndi-name>ejb/LoginBean</jndi-name>
</ejb-ref>
</jboss-web>

WEB.XML(relevant part)
=======
<ejb-ref>
<ejb-ref-name>ejb/LoginBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>raveEjb.LoginHome</home>
<remote>raveEjb.Login</remote>
</ejb-ref>


this is my ejb access code
=========================

//Properties for jboss
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
props.put(Context.PROVIDER_URL, "localhost:1099");

//obtain a jndi server reference
Context ctx = new InitialContext(props);

//Get a home Interface reference
Object loginEjbObj = ctx.lookup("java:comp/env/ejb/LoginBean");

//Typecast this object into a home interface type
//use this if we use remote home method
LoginHome home =
(LoginHome)PortableRemoteObject.narrow(loginEjbObj,LoginHome.class);


//Obtain a remote interface
Login loginObj = home.create();

// Call the EJB's validation method

if(loginObj.validateUser(s_user_Name, s_password))
{


Can anyone tell me why on earth do i get the exception ?????
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to do this with EJBs? eantoranz Programming 1 04-24-2005 12:16 AM
Problem deploying EJBs on JBoss eantoranz Programming 1 04-15-2005 02:46 PM
EJB: Problem with concurrent calls to EJBs (according to JBoss) eantoranz Programming 0 03-14-2005 12:10 PM
Why the hell is linux running so slow! plz help sendas4 Linux - General 9 08-02-2004 09:00 PM
Where are EJBs classes defined? eantoranz Programming 2 04-25-2004 12:01 PM


All times are GMT -5. The time now is 01:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration