Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

EJB Local Session state less bean

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Below is my 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>
<display-name>TestEJB</display-name>
<enterprise-beans>
<session>
<ejb-name>TestSessionLocal</ejb-name>
<local-home>com.test.ejb.sessionfacade.TestSessionFacadeLocalHome</local-home>
<local>com.test.ejb.sessionfacade.TestSessionFacadeLocal</local>
<ejb-class>com.test.ejb.sessionfacade.TestSessionFacadeBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>

</enterprise-beans>
</ejb-jar>

Below is my weblogic-ejb-jar.xml

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

<weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/90″" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee”" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=“http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd”;">
<weblogic-enterprise-bean>
<ejb-name>TestSessionLocal</ejb-name>
<stateless-session-descriptor>
<stateless-clustering>
<stateless-bean-is-clusterable>false</stateless-bean-is-clusterable>
</stateless-clustering>
</stateless-session-descriptor>
<local-jndi-name>TEST_FACADE_LOCAL_JNDI</local-jndi-name>
</weblogic-enterprise-bean>

</weblogic-ejb-jar>

WEblogic version 12.1.3 and ejb 2.1.

When i try to deploy my application i get below error


weblogic.ejb.container.compliance.ComplianceException: In EJB TestSessionLocal, method create() on the local home interface throws java.rmi.RemoteException. Methods on the local home interface must not throw java.rmi.RemoteException.
at weblogic.ejb.container.compliance.HomeInterfaceChecker.checkMethodsThrowRemoteException(HomeInterfaceChecker.java:140)
at weblogic.ejb.container.compliance.SessionHomeInterfaceChecker.checkMethodsThrowRemoteException(SessionHomeInterfaceChecker.java:14)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at weblogic.ejb.container.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:100)
at weblogic.ejb.container.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:90)
at weblogic.ejb.container.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:81)
at weblogic.ejb.container.ejbc.EJBCompiler.doCompile(EJBCompiler.java:172)
at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:346)
at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:314)
at weblogic.ejb.container.deployer.EJBDeployer.compileJar(EJBDeployer.java:429)
at weblogic.ejb.container.deployer.EJBDeployer.compileIfNecessary(EJBDeployer.java:355)
at weblogic.ejb.container.deployer.EJBDeployer.prepare(EJBDeployer.java:723)
at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:439)
at weblogic.application.internal.ExtensibleModuleWrapper$PrepareStateChange.next(ExtensibleModuleWrapper.java:295)
at weblogic.application.internal.ExtensibleModuleWrapper$PrepareStateChange.next(ExtensibleModuleWrapper.java:285)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
at weblogic.application.internal.ExtensibleModuleWrapper.prepare(ExtensibleModuleWrapper.java:109)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:175)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:170)
at weblogic.application.utils.StateMachineDriver$ParallelChange.run(StateMachineDriver.java:80)
at weblogic.work.ContextWrap.run(ContextWrap.java:40)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:548)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)


All my classes implement proper local classes EJBLocalHome and EJBLocalObject.

This configuration used to work fine in JBOSS 5.1.0 GA

Where am i doing wrong
 
Saloon Keeper
Posts: 25467
180
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Ajay!

The key message is this:


Methods on the local home interface must not throw java.rmi.RemoteException.



In EJB Versions 1 and 2, there are Home and Remote Interfaces that define what methods are accesible via direct Java call (local) or from an foreign (remote) JVM (remote, via RMI).

The methods defined in the Home Interface are not supposed to contain the "throws RMIException" clause in their method prototypes. An RMIException is something that happens when there's an infrastructure failure in a Remote call (for example, no network connection) and therefore not only will never happen on a local method, but it is actually meaningless in the context of a local method.
 
expectation is the root of all heartache - shakespeare. tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic