LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 02: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



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-23-2005 11:16 PM
Problem deploying EJBs on JBoss eantoranz Programming 1 04-15-2005 01:46 PM
EJB: Problem with concurrent calls to EJBs (according to JBoss) eantoranz Programming 0 03-14-2005 11:10 AM
Why the hell is linux running so slow! plz help sendas4 Linux - General 9 08-02-2004 08:00 PM
Where are EJBs classes defined? eantoranz Programming 2 04-25-2004 11:01 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:51 PM.

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
Open Source Consulting | Domain Registration