Advertisement

09.28.2005 at 11:52PM PDT, ID: 21577998
[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!

JNDI and JBoss

Tags: jboss, jndi
hi friend,
How to configure JNDI.
Well I am not having jboss.jcml on my system.
Please give me proper details so that I can configure my JNDI in JBoss 4.0.
thanks,
Dinesh
Start your free trial to view this solution
Question Stats
Zone: Networking
Question Asked By: dinesh_bali
Solution Provided By: ramazanyich
Participating Experts: 2
Solution Grade: A
Views: 126
Translate:
Loading Advertisement...
09.30.2005 at 08:02AM PDT, ID: 14992936

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.

 
10.02.2005 at 10:34PM PDT, ID: 15004456

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.

 
10.10.2005 at 02:13PM PDT, ID: 15055658

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.

 
12.26.2005 at 11:35AM PST, ID: 15551794

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.

 
12.30.2005 at 05:12AM PST, ID: 15577379

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
 
09.30.2005 at 08:02AM PDT, ID: 14992936

Rank: Master

Hi,

First:
Configure a Datasource for Example for Oracle, create a file called oracle-ds.xml for example contains:

 <?xml version="1.0" encoding="UTF-8"?>
   <datasources>
      <local-tx-datasource>
         <jndi-name>java:/OracleDS</jndi-name>
         <connection-url>jdbc:oracle:thin:@oracle.somewhere.com:1521:DB</connection-url>
         <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
         <user-name>dev</user-name>
         <password>secret</password>
      </local-tx-datasource>
   </datasources>
then copy this file to:
$JBOSS_HOME/server/default/deploy

Second:
in ur Web Application at {WebAppRoot}/WEB-INF their suppose to be 2 files, Web.xml and jboss-web.xml
In ur Web.xml u must have a resource reference to ur Datasource like this:

   <resource-ref>
        <description>The DS</description>
        <res-ref-name>jdbc/myDS</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>

and in ur  jboss-web.xml the resource-ref  <--> JNDI name MAP like this:

    <resource-ref>
        <res-ref-name>jdbc/myDS</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <jndi-name>java:/OracleDS</jndi-name>
    </resource-ref>

Third:
from ur Servlet or JSP call like this:

      Context initCtx = new InitialContext();
      DataSource dataSource=(javax.sql.DataSource)(initCtx.lookup("java:comp/env/jdbc/myDS"));
      Connection conn = dataSource.getConnection();

Now it should work, refer to these sites for support:

jboss/online_manual/3.0/ch07s22.html">http://www.huihoo.com/jboss/online_manual/3.0/ch07s22.html
http://www.developer.com/java/ent/print.php/10933_3071661_2

Good Luck

R.K
 
10.02.2005 at 10:34PM PDT, ID: 15004456
Thanks for your reply please read my problem and help to solve my problem

I am making simple stateless bean. Which prints only Hello World. Code given in Willey's Mastering Enterprise JavaBeans
What I am doing is given below:
My Files is stored in location:
/src/examples/Hello.java
/src/examples/HelloHome.java
/src/examples/HelloBean.java
/src/examples/HelloLocal.java
/src/examples/HelloLocalHome.java

My Client file through which I am calling the Bean is stored in:
/src/examples/HelloClient.java

My JBoss and Ejb-Jar.xml files are stored in Location:
/src/META-INF/ejb-jar.xml
/src/META-INF/jboss.xml

I am using Eclipse3.1 and Jboss4.0

Codes are given below:

Hello.java

package examples;
import javax.ejb.EJBObject;
import java.rmi.RemoteException;
public interface Hello extends EJBObject
{
    public String hello() throws RemoteException;    
}

HelloHome.java

package examples;
import javax.ejb.EJBHome;
import javax.ejb.CreateException;
import java.rmi.RemoteException;

public interface HelloHome extends EJBHome
{    
      public Hello create() throws CreateException,RemoteException;
}


HelloBean.java

package examples;

import java.rmi.RemoteException;
import javax.ejb.EJBException;
import javax.ejb.SessionContext;

public class HelloBean implements javax.ejb.SessionBean
{
    private SessionContext ctx;
   
    public void ejbCreate()
    {
        System.out.println("ejbCreate");
    }
    public void ejbActivate() throws EJBException, RemoteException
    {
        System.out.println("ejbActivate");  
    }

    public void ejbPassivate() throws EJBException, RemoteException
    {
        System.out.println("ejbPassivate");
    }

    public void ejbRemove() throws EJBException, RemoteException
    {
        System.out.println("ejbRemove");        
    }

    public void setSessionContext(SessionContext ctx) throws EJBException, RemoteException
    {
        this.ctx=ctx;
    }
   
    public String hello()
    {
        System.out.println("hello()");
        return "Hello, World!";
    }        
}

HelloLocal.java

package examples;

public interface HelloLocal extends javax.ejb.EJBLocalObject
{
    public String hello();
}


HelloLocalHome.java

package examples;

public interface HelloLocalHome extends javax.ejb.EJBLocalHome
{
    HelloLocal create() throws javax.ejb.CreateException;
}


HelloClient.java

package examples;
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import java.util.Properties;
import java.util.*;


public class HelloClient
{      
      public static void main (String[] args) throws Exception
      {
            
        //Properties props= new Properties();
        
        //Properties props = System.getProperties();
      
       Hashtable env = new Hashtable();
         env.put("java.naming.factory.initial",
            "org.jnp.interfaces.NamingContextFactory");
         env.put("java.naming.factory.url.pkgs",
            "org.jboss.naming:org.jnp.interfaces");
         env.put("java.naming.provider.url",
            "localhost");       
         InitialContext context = new InitialContext(env);
      //  Context ctx = new InitialContext(env);
       // Object obj=ctx.lookup("java:comp/env/Hello");
        //HelloHome home=(HelloHome)PortableRemoteObject.narrow(obj,HelloHome.class);
       HelloHome home = (HelloHome) context.lookup("Hello");
        Hello hello=home.create();
        System.out.println(hello.hello());      
        hello.remove();
      }      
}

ejb-jar.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

<ejb-jar >
   <enterprise-beans>  
      <session >
         <ejb-name>Hello</ejb-name>
         <home>examples.HelloHome</home>
         <remote>examples.Hello</remote>
         <local-home>examples.HelloLocalHome</local-home>
         <local>examples.HelloLocal</local>
         <ejb-class>examples.HelloBean</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>
      </session>
    </enterprise-beans>  
</ejb-jar>

jboss.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "C:/jboss_4_0.dtd">

<jboss>

   <enterprise-beans>    
      <session>
         <ejb-name>Hello</ejb-name>
         <jndi-name>Hello</jndi-name>
         <local-jndi-name>HelloLocal</local-jndi-name>

        <method-attributes>
        </method-attributes>
      </session>
   </enterprise-beans>
   <resource-managers>
   </resource-managers>
</jboss>

After all this I am simply deploying my bean which gets deployed in Jboss.
But When I am running my client file HelloClient.java from Command Prompt  or from Eclipse I am getting the error given below

C:\jboss-4.0.0\server\default\deploy>java examples.HelloClient
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/logging/Log
ger
        at org.jnp.interfaces.NamingContext.<clinit>(NamingContext.java:101)
        at org.jnp.interfaces.NamingContextFactory.getInitialContext(NamingConte
xtFactory.java:41)
        at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
        at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
        at javax.naming.InitialContext.init(Unknown Source)
        at javax.naming.InitialContext.<init>(Unknown Source)
        at examples.HelloClient.main(HelloClient.java:25)
can some body help me
 
10.10.2005 at 02:13PM PDT, ID: 15055658
add $JBOSS_HOME/client/jbossall-client.jar to your client classpath
Accepted Solution
 
12.26.2005 at 11:35AM PST, ID: 15551794
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Accept: ramazanyich {http:#15055658}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Venabili
EE Cleanup Volunteer
 
12.30.2005 at 05:12AM PST, ID: 15577379
Forced accept.

Computer101
EE Admin
 
 
20080236-EE-VQP-29