JBoss3.0 & Tomcat4 server error
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   zhi_chou
Posted On:   Monday, April 1, 2002 06:10 PM

Hello, when i run jsp file in Tomcat, the error is following, i had put jndi connection in jsp file source code in JSP file: < Properties props = new Properties(); props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); props.put(Context.PROVIDER_URL, "localhost:1099"); java.lang.String value = "firstone"; Context ctx = new InitialContext(props); DocSettingEJBTableHome home = (DocSettingEJBTableHome)ctx.lookup("ejb/DocSettingEJBTable"); DocSettingEJBTableBean bean = (DocSettingEJBTableBean)home.create("first","myone",2); > javax.naming.CommunicationEx   More>>

Hello, when i run jsp file in Tomcat, the error is following, i had put jndi connection in jsp file
source code in JSP file:
<

Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
props.put(Context.PROVIDER_URL, "localhost:1099");
java.lang.String value = "firstone";
Context ctx = new InitialContext(props);
DocSettingEJBTableHome home = (DocSettingEJBTableHome)ctx.lookup("ejb/DocSettingEJBTable");
DocSettingEJBTableBean bean = (DocSettingEJBTableBean)home.create("first","myone",2);

>



javax.naming.CommunicationException: org.jboss.ha.framework.interfaces.HARMIProxy. Root exception is java.lang.ClassNotFoundException: org.jboss.ha.framework.interfaces.HARMIProxy


how to solve the problem. Thank you.

   <<Less

Re: JBoss3.0 & Tomcat4 server error

Posted By:   Cindy_Zhang  
Posted On:   Tuesday, April 23, 2002 07:02 AM

Try this:



Properties prop = new Properties();

try{

   
prop.put(Context.INITIAL_CONTEXT_FACTORY,

   
   
"org.jnp.interfaces.NamingContextFactory");

   
prop.put(Context.PROVIDER_URL, "jnp://localhost:1099");

   
/** if the application server requires username and
   
password, add the PRINCIPAL AND CREDENTIALS **/

   
prop.put(Context.SECURITY_PRINCIPAL,"username");

   
prop.put(Context.SECURITY_CREDENTIALS,"password");

}catch(Exception e){

   
e.printStackTrace();

}

try{

   
InitialContext ic = new InitialContext(prop);

   
java.lang.Object objref = ic.lookup
("ejb/DocSettingEJBTable");

   
DocSettingEJBTableHome home =

        (DocSettingEJBTableHome)
        
PortableRemoteObject.narrow

         
(objref, DocSettingEJBTableHome.class);

   
DocSettingEJBTableBean bean = home.create();

}catch(Exception e){

   
e.printStackTrace();

}



Make sure that you have the beans deployed and created a jar file for the remote interface, and import the jar file in your ejb connector.

Hope the above helps a bit.



Good luck



Cindy
About | Sitemap | Contact