Advertisement

05.07.2004 at 08:43AM PDT, ID: 20981683
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

javax.naming.NameNotFoundException: ejb not bound. URGENT PLEASE!!!
Tags: bound
Hi,

I have a problem locating the home interface of an stateless session bean. The application server is JBoss. The beans seem to

deploy without errors on the app server. I have been fighting with problem for 2 days now.

Following is the code i am using

try {
     Context context = new InitialContext();
     Object ref = context.lookup("ejb/Lego");
     home = (LegoHome)PortableRemoteObject.narrow(ref,LegoHome.class);
} catch (NamingException e) {
    e.printStackTrace();
}

I have also tried using
Object ref = context.lookup("java:comp/env/ejb/Lego");
to lookup the EJB.

The Output from server on deployment is:

[EjbModule] Deploying Lego
[StatelessSessionInstancePool] Started jboss.j2ee:jndiName=ejb/Lego,plugin=pool,service=EJB
[StatelessSessionContainer] Started jboss.j2ee:jndiName=ejb/Lego,service=EJB
[EjbModule] Started jboss.j2ee:module=LegoEJB.jar,service=EjbModule

Contents of my jndi.properties file:

[EjbModule] Deploying Lego
[StatelessSessionInstancePool] Started jboss.j2ee:jndiName=ejb/Lego,plugin=pool,service=EJB
[StatelessSessionContainer] Started jboss.j2ee:jndiName=ejb/Lego,service=EJB
[EjbModule] Started jboss.j2ee:module=LegoEJB.jar,service=EjbModule

Contents of application.xml are:
<application>
      <display-name>My Test Application</display-name>
      <module>
            <ejb>LegoEJB.jar</ejb>
      </module>
      <module id="WarModule_1">
            <web>
                  <web-uri>LegoWeb.war</web-uri>
                  <context-root>/test</context-root>
            </web>
      </module>
      <module id="EjbModule_1">
            <ejb>LegoEJB.jar</ejb>
      </module>
</application>

When I try to access it from Servlet I get Following Error on JBOSS Console:
javax.naming.NameNotFoundException: ejb not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)

It Seems I am messing up with some configuration problem somewhere. Please Help Urgent
Please Let me know what all do i have to configure to get this running.
Start your free trial to view this solution
Question Stats
Zone: Software
Question Asked By: sjhamb
Solution Provided By: vzilka
Participating Experts: 2
Solution Grade: C
Views: 692
Translate:
Loading Advertisement...
05.10.2004 at 02:33AM PDT, ID: 11029716

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.11.2004 at 01:47AM PDT, ID: 11038463

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.11.2004 at 01:50AM PDT, ID: 11038476

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.11.2004 at 05:45AM PDT, ID: 11039818

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.11.2004 at 05:49AM PDT, ID: 11039848

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.11.2004 at 06:14AM PDT, ID: 11040092

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.11.2004 at 07:03AM PDT, ID: 11040621

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.11.2004 at 07:06AM PDT, ID: 11040647

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.11.2004 at 08:04AM PDT, ID: 11041242

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.11.2004 at 08:08AM PDT, ID: 11041292

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.11.2004 at 09:03AM PDT, ID: 11041931

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.11.2004 at 01:45PM PDT, ID: 11044539

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.11.2004 at 11:15PM PDT, ID: 11047181

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.11.2004 at 11:44PM PDT, ID: 11047307

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2004 at 02:43AM PDT, ID: 11048226

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2004 at 02:58AM PDT, ID: 11048311

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2004 at 05:11AM PDT, ID: 11049061

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2004 at 05:12AM PDT, ID: 11049066

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2004 at 05:13AM PDT, ID: 11049080

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2004 at 06:15AM PDT, ID: 11049537

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2004 at 01:46PM PDT, ID: 11053785

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.13.2004 at 12:19AM PDT, ID: 11056876

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.13.2004 at 03:47AM PDT, ID: 11057760

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.13.2004 at 05:18AM PDT, ID: 11058309

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.13.2004 at 11:23PM PDT, ID: 11065701

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.18.2005 at 09:59AM PST, ID: 13576848

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
05.10.2004 at 02:33AM PDT, ID: 11029716

Rank: Master

Please post your ejb-jar.xml and jboss.xml files in here.
 
05.11.2004 at 01:47AM PDT, ID: 11038463
contents of jboss.xml

      <session>
         <ejb-name>Lego</ejb-name>
         <jndi-name>ejb/Lego</jndi-name>
      </session>

Contents of ejb-jar.xml

      <session>
         <description><![CDATA[1st Stateless Session Bean]]></description>
         <display-name>First_Stateless_Bean</display-name>

         <ejb-name>Lego</ejb-name>

         <home>test.interfaces.LegoHome</home>
         <remote>test.interfaces.Lego</remote>
         <ejb-class>test.ejb.LegoBean</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>
            
      </session>

 
05.11.2004 at 01:50AM PDT, ID: 11038476

Rank: Master

Open your jmx console (http://localhost:8080/jmx-console) and check the JNDI service.
Run the list method of the service, to see the JNDI tree of your server. Does the Lego EJB appears there?
 
05.11.2004 at 05:45AM PDT, ID: 11039818
I don't see anything like "list method" there ....

I can see following enteries in jmx-console under jboss.j2ee head:

jndiName=ejb/Lego,plugin=pool,service=EJB
jndiName=ejb/Lego,service=EJB
module=LegoEJB.jar,service=EjbModule

and have tried using Invoke against start/ cerate etc... it works fine but still am facing this problem.
 
05.11.2004 at 05:49AM PDT, ID: 11039848

Rank: Master

It means your EJB is succesfully deployed.
Can you try:
Object ref = context.lookup("ejb/Lego");
Instead of your own lookup line?
 
05.11.2004 at 06:14AM PDT, ID: 11040092
Have tried that ... doesn't work...
 
05.11.2004 at 07:03AM PDT, ID: 11040621
Anyone Else ... ??
 
05.11.2004 at 07:06AM PDT, ID: 11040647

Rank: Master

Are you using ejb-references?
Which JBoss version is that?
 
05.11.2004 at 08:04AM PDT, ID: 11041242
JBOSS Version 3.2.3

I did not get your first question though
 
05.11.2004 at 08:08AM PDT, ID: 11041292

Rank: Master

Are you using ejb-ref in your web.xml?
Can you access other ejbs/remote objects from your servlet? Can you access a data source for example?
I try to narrow down your problem, since the EJB is deployed, it is not clear why the name not found exception
 
05.11.2004 at 09:03AM PDT, ID: 11041931
No, I am not using that....i tried using that but then i get errors while deployment...

org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (javax.naming.NamingException: ejb-ref: ejb/Lego, no ejb-link in web.xml and no jndi-name in jboss-web.xml)
 
05.11.2004 at 01:45PM PDT, ID: 11044539

Rank: Master

OK. Let's try another thing.
The context has a list() method. Can you print it to the screen (system.out.println, or to the output html page) and then we'll see what is defined in your context?
It returns a NamingEnumeration object, it should be easy to print.
 
05.11.2004 at 11:15PM PDT, ID: 11047181
I get javax.naming.NotContextException at line 2

I have written following code to check what you suggested:

Context context = new InitialContext();
                                    
NamingEnumeration nE = context.list("ejb/Lego");

while(nE.hasMoreElements()){
      System.out.println(nE.toString());
      nE.nextElement();
}
 
05.11.2004 at 11:44PM PDT, ID: 11047307

Rank: Master

Just context.list() without the ejb/Lego as a parameter
 
05.12.2004 at 02:43AM PDT, ID: 11048226
list method requires a parameter.
I tried calling it like:
NamingEnumeration nE = context.list("");

Result:
[STDOUT] org.jnp.interfaces.NamingEnumerationImpl@1c37b8f

21 times on console
 
05.12.2004 at 02:58AM PDT, ID: 11048311

Rank: Master

You need to iterate the items in the enumeration.

Try this code piece, it prints the entire JNDI tree.

  void printTree(Context c,Context subContext, String contextName, JspWriter out, String prefix) throws NamingException, IOException {
    System.out.println(contextName);
   
    NamingEnumeration ne = c.listBindings(contextName);
     
    while (ne.hasMore()) {
      Binding b = (Binding)ne.next();

      if (b.getObject() instanceof Context) {
        out.println(prefix + "<b>" + b.getName() + "<b><BR>");
        printTree(subContext,(Context)b.getObject(),b.getName(),out,"--\\" + prefix);
      } else {      
        out.println(prefix + b.getName() + "<BR>");
      }
    }
  }

main() {
  InitialContext ic = new InitialContext();

  printTree(ic,ic,"",out, "");
}

Where out is an outputstream.
 
05.12.2004 at 05:11AM PDT, ID: 11049061
I ran the code you had sent and "Lego" was there in the output.
 
05.12.2004 at 05:12AM PDT, ID: 11049066
What Next? Any Clues?
 
05.12.2004 at 05:13AM PDT, ID: 11049080

Rank: Master

Just lookup Lego instead of ejb/Lego, it looks like it should work.
 
05.12.2004 at 06:15AM PDT, ID: 11049537
javax.naming.NameNotFoundException: Lego not bound
 
05.12.2004 at 01:46PM PDT, ID: 11053785

Rank: Master

Can you post the entire output of the method?
 
05.13.2004 at 12:19AM PDT, ID: 11056876
Sure, Here it is:

jmx
jmx
invoker
invoker
RMIAdaptor
rmi
rmi
RMIAdaptor
OIL2XAConnectionFactory
HTTPXAConnectionFactory
ConnectionFactory
UserTransactionSessionFactory
HTTPConnectionFactory
XAConnectionFactory
invokers
invokers
0.0.0.0
0.0.0.0
pooled
wks_05
wks_05
jrmp
http
UserTransaction
RMIXAConnectionFactory
UILXAConnectionFactory
UIL2XAConnectionFactory
queue
queue
A
testQueue
ex
DLQ
D
C
B
topic
topic
testDurableTopic
testTopic
securedTopic
console
console
PluginManager
UIL2ConnectionFactory
UILConnectionFactory
RMIConnectionFactory
ejb
ejb
Lego
OIL2ConnectionFactory
UUIDKeyGeneratorFactory
 
05.13.2004 at 03:47AM PDT, ID: 11057760
It started working on its own...
I don't know what ....
It Just Worked ... All of a sudden
 
05.13.2004 at 05:18AM PDT, ID: 11058309

Rank: Master

OK. That's odd.
Have you changed anything?
Congratulations, anyway.
Accepted Solution
 
05.13.2004 at 11:23PM PDT, ID: 11065701
Nope... Thanks for your patience and support ...
 
03.18.2005 at 09:59AM PST, ID: 13576848
could you please send me what you did to run the bean
 
 
20080236-EE-VQP-29