• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to invoke an EJB method from JSP Client

 
satheesh krishnaswamy
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have a design like this.All my jsp clients will talk to my Session Beans which inturn will delegate the call to the Entity Beans or the simple java classes based on the method.I have one Session Beans and Two entity Beans and one Plain Java classes which is responsible for displaying values in JSP.(i.e which is used only for display purpose (like findXXX).I have the entity Beans for update and insert into the database.

Now That my jar file is also deployed in Jboss 3.2.3 without any error.When I invoke the session Bean method from my JSP,through:
*************************************
java.util.Hashtable props = new java.util.Hashtable();
props.put(javax.naming.InitialContext.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
props.put(javax.naming.InitialContext.PROVIDER_URL, "jnp://127.0.0.1:1099");
javax.naming.InitialContext ctx = new javax.naming.InitialContext(props);
Object obj = ctx.lookup( "eServiceBean" );
eServiceHome home=(eServiceHome)javax.rmi.PortableRemoteObject.narrow(obj,eServiceHome.class);
eService myposb= home.create() ;
myposb.insertSR(CustName,Category,Item,Problem,Descr);
*********************************************************************************************************

I am getting org.apache.jasper.JasperException: eServiceBean not bound

Can anybody help me Please as the matter is so URGENT..I think there should be some problem in ejb-jar only..Please help me.I am giving my entire ejb-jar file for your reference.

ejb-jar.xml:
***************
<!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>eServiceBean</ejb-name>
<home>eservice.eServiceHome</home>
<remote>eservice.eService</remote>
<ejb-class>eservice.eServiceBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-ref>
<ejb-ref-name>ejb/eServiceBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>eservice/eServiceHome</home>
<remote>eservice/eService</remote>
<ejb-link>ServiceOrder</ejb-link>
</ejb-ref>
</session>
<entity>
<ejb-name>ServiceOrderBean</ejb-name>
<home>eservice.ServiceOrderHome</home>
<remote>eservice.ServiceOrder</remote>
<ejb-class>eservice.eServiceOrderBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<ejb-ref>
<ejb-ref-name>ejb/ServiceOrder</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>eservice/ServiceOrderHome</home>
<remote>eservice/ServiceOrder</remote>
<ejb-link>ServiceOrderBean</ejb-link>
</ejb-ref>
<resource-ref>
<res-ref-name>jdbc/ds</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>
<entity>
<ejb-name>FAQBean</ejb-name>
<home>eservice.FAQHome</home>
<remote>eservice.FAQ</remote>
<ejb-class>eservice.FAQBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<ejb-ref>
<ejb-ref-name>ejb/FAQ</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>eservice/FAQHome</home>
<remote>eservice/FAQ</remote>
<ejb-link>FAQBean</ejb-link>
</ejb-ref>
<resource-ref>
<res-ref-name>jdbc/ds</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>
</enterprise-beans>

<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>eServiceBean</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
<method>
<ejb-name>eServiceBean</ejb-name>
<method-intf>Home</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>ServiceOrderBean</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
<method>
<ejb-name>ServiceOrderBean</ejb-name>
<method-intf>Home</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>FAQBean</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
<method>
<ejb-name>FAQBean</ejb-name>
<method-intf>Home</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>

jboss.xml:
***********
<?xml version='1.0' ?>
<!DOCTYPE jboss PUBLIC
"-//JBoss//DTD JBOSS 3.2//EN"
"http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">

<!-- Version: $Id: jboss.xml,v 1.6.2.5 2003/11/23 22:49:29 slaboure Exp $ -->
<jboss>
<!--
<enterprise-beans>
<entity>
<ejb-name>ClusteredHTTPSession</ejb-name>
<jndi-name>clustering/HTTPSession</jndi-name>
<local-jndi-name>clustering/LocalHTTPSession</local-jndi-name>
<configuration-name>Clustered in-memory CMP EntityBean</configuration-name>
<invoker-bindings>
<invoker>
<invoker-proxy-binding-name>this-rmi-invoker</invoker-proxy-binding-name>
</invoker>
</invoker-bindings>
</entity>
</enterprise-beans>
-->
<enterprise-beans>
<session>
<ejb-name>eServiceBean</ejb-name>
<jndi-name>eServiceBean</jndi-name>
</session>
<entity>
<ejb-name>ServiceOrderBean</ejb-name>
<jndi-name>ServiceOrderBean</jndi-name>
</entity>
<entity>
<ejb-name>FAQBean</ejb-name>
<jndi-name>FAQBean</jndi-name>
</entity>
</enterprise-beans>
<invoker-proxy-bindings>
<invoker-proxy-binding>
<name>this-rmi-invoker</name>
<invoker-mbean>jboss:service=invoker,type=jrmp</invoker-mbean>
<proxy-factory>org.jboss.proxy.ejb.ProxyFactory</proxy-factory>
<proxy-factory-config>
<client-interceptors>
<home>
<interceptor>org.jboss.proxy.ejb.HomeInterceptor</interceptor>
<interceptor>org.jboss.ha.httpsession.beanimpl.ejb.ClientTCLInterceptor</interceptor>
<interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
</home>
<bean>
<interceptor>org.jboss.proxy.ejb.EntityInterceptor</interceptor>
<interceptor>org.jboss.ha.httpsession.beanimpl.ejb.ClientTCLInterceptor</interceptor>
<interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
</bean>
<list-entity>
<interceptor>org.jboss.proxy.ejb.ListEntityInterceptor</interceptor>
<interceptor>org.jboss.ha.httpsession.beanimpl.ejb.ClientTCLInterceptor</interceptor>
<interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
</list-entity>
</client-interceptors>
</proxy-factory-config>
</invoker-proxy-binding>
</invoker-proxy-bindings>

<container-configurations>
<container-configuration>
<container-name>Clustered in-memory CMP EntityBean</container-name>
<call-logging>false</call-logging>
<container-interceptors>
<interceptor>org.jboss.ha.httpsession.beanimpl.ejb.ServerTCLInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.EntityLockInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.EntityInstanceInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.EntitySynchronizationInterceptor</interceptor>
</container-interceptors>
<instance-pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool>
<instance-cache>org.jboss.ejb.plugins.ClusterSyncEntityInstanceCache</instance-cache>
<persistence-manager>org.jboss.ejb.plugins.CMPClusteredInMemoryPersistenceManager</persistence-manager>
<locking-policy>org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock</locking-policy>

<container-cache-conf>
<cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>
<cache-policy-conf>
<min-capacity>50</min-capacity>
<max-capacity>1000000</max-capacity>
<overager-period>300</overager-period>
<max-bean-age>600</max-bean-age>
<resizer-period>400</resizer-period>
<max-cache-miss-period>60</max-cache-miss-period>
<min-cache-miss-period>1</min-cache-miss-period>
<cache-load-factor>0.75</cache-load-factor>
</cache-policy-conf>
</container-cache-conf>
<container-pool-conf>
<MinimumSize>10</MinimumSize>
<MaximumSize>100</MaximumSize>
</container-pool-conf>
<commit-option>A</commit-option>
<cluster-config>
<partition-name>DefaultPartition</partition-name>
</cluster-config>
<depends>jboss:service=DefaultPartition</depends>
<depends>jboss:service=invoker,type=jrmp</depends>
</container-configuration>
</container-configurations>
</jboss>

ALSO SAY ME AS WHAT ENTRY NEEDS TO BE ADDED IN WEB.XML

Can anybody give me a solution to this problem.What ever I change I could not get it.
Thanks in advance
With kind REgds
SAtheesh.K
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the EJB forum.
 
Pradeep Ram
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try to lookup any other bean from the JNDI Context. Your mapping seems ok. Try to prefix the call with java:comp/ before providing the JNDI name.
--pradeeP
 
Tim Holloway
Bartender
Posts: 18416
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In some servers, you can't use a lower-case letter to start the classname of the EJB, so eServiceBean wouldn't always work. Try EServiceBean.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!