Weblogic 10.3 First EJB bean invocation is throwing NameNotFoundException

I'm gettting the below error, during the first invocation of the EJB session bean in weblogic 10.3. Please help on this.
org.springframework.remoting.RemoteLookupFailureException: Failed to locate remote EJB [TestSessionBean]; nested exception is javax.naming.NameNotFoundException: Unable to resolve 'TestSessionBean'. Resolved '' [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'TestSessionBean'. Resolved '']; remaining name 'TestSessionBean'
Caused by: javax.naming.NameNotFoundException: Unable to resolve 'TestSessionBean'. Resolved '' [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'TestSessionBean'. Resolved '']; remaining name 'TestSessionBean'
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
at weblogic.jndi.internal.ServerNamingNode_1030_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:392)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:380)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:123)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:121)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:146)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:91)
at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
at org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor.lookup(AbstractRemoteSlsbInvokerInterceptor.java:92)
at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.getHome(AbstractSlsbInvokerInterceptor.java:147)
at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.create(AbstractSlsbInvokerInterceptor.java:171)
at org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor.newSessionBeanInstance(AbstractRemoteSlsbInvokerInterceptor.java:205)
at org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.getSessionBeanInstance(SimpleRemoteSlsbInvokerInterceptor.java:108)
at org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.doInvoke(SimpleRemoteSlsbInvokerInterceptor.java:74)
at org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor.invoke(AbstractRemoteSlsbInvokerInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy60.loadMyData(Unknown Source)
at com.test.MyController.formBackingObject(MyController.java:74)
at org.springframework.web.servlet.mvc.AbstractFormController.getErrorsForNewForm(AbstractFormController.java:343)
at org.springframework.web.servlet.mvc.AbstractFormController.showNewForm(AbstractFormController.java:323)
at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:263)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:819)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:754)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:399)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:354)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:77)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(Unknown Source)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.execute(Unknown Source)
at weblogic.servlet.internal.ServletRequestImpl.run(Unknown Source)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: javax.naming.NameNotFoundException: Unable to resolve 'TestSessionBean'. Resolved ''
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:252)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
... 2 more
Edited by: 940874 on Jun 15, 2012 4:34 AM

ur prob has been resolved? I want to the resolution becoz m facing the same error for setting up proxy for RSS Feeds.
pls let me know the fix,
thanks, ripan

Similar Messages

  • CMT and using non-Weblogic JMS in a session bean

              I am writing a session bean which sends a JMS message using a non-weblogic JMS
              provider. This bean is marked for CMT and I want the JMS send to participate in
              this CMT as well. My understanding is that I should be able to do this by defining
              a <resource-ref> element in the ejb-jar.xml and a corresponding <resource-descriptor>
              element in the weblogic-ejb-jar.xml file. The bean would then use the <res-ref-name>
              defined under the <resource-ref> element to lookup the connection factory. What
              do I have to put in weblogic-ejb-jar.xml file to make sure that the connection
              factory specified in <res-ref-name> maps to a connection factory that is in a
              foreign JNDI provider (e.g. in the non-Weblogic JMS provider's JNDI) and not in
              Weblogic's JNDI?
              Thanks in advance for your help.
              

    It sounds like you're using Tibco JMS to receive messages from the MDB, and
              then to send out a message. WLS 7.0 will handle the transaction enlistment
              properly when it receives messages for the MDB, but you'll have to enlist
              the JMS provider yourself when you send the message, using the white paper
              that Tom pointed you to as a guide.
              In WLS 8.1, coming soon, we'll automatically enlist the provider in the
              transaction if you look it up using a "resource-ref" element in the EJB like
              you described. Today, you can use that element but no transaction
              enlistement is being done.
              greg
              "Venkat" <[email protected]> wrote in message
              news:[email protected]...
              >
              > We also need this feature.
              > We are using Weblogic 7.0 and Tibco JMS 3.0,
              > which supports XA.
              >
              > We are mainly interested in subscribing using MDB
              > and publishing using a session bean in one transaction.
              > Do you think by using resource-refs in conjunction
              > with registering with Weblogic JNDI during startup
              > can do the job?
              >
              > Or how about using XAConnectionFactory and XASession
              > classes for JMS publishing ?
              >
              > Thanks.
              >
              > Tom Barnes <[email protected]> wrote:
              > >Hi Mihir,
              > >
              > >Support for automatic enlistment of foreign JMS vendors
              > >via the resource-ref approach is not available in WLS.
              > >This support will be available in the next release:
              > >limited access beta is available now, public beta is available
              > >in 2-3 months. You are the first customer I've heard of that
              > >asked for this feature. Very cool. Good timing.
              > >
              > >As you are not using WebLogic JMS, you will need to do the
              > >transaction enlistment yourself. This isn't that hard
              > >to do. I suggest that you refer to the integrating foreign
              > >JMS vendor white-paper available on dev2dev.bea.com.
              > >Also, refer to the integrating transactions with
              > >MQSeries integration paper, which will likely serve your
              > >purposes better. Note that some JMS vendors
              > >have problems with concurrent transactions in a single
              > >JMS connection, or with transactions that attempt
              > >to switch threads (eg. suspend() in one thread
              > >and resume() in another).
              > >
              >
              >http://dev2dev.bea.com/resourcelibrary/whitepapersdetail.jsp?highlight=whit
              epapers&filePath=components%2Fdev2dev%2Fresourcelibrary%2Fwhitepapers%2Fwp_j
              msproviders.htm
              >
              >http://dev2dev.bea.com/resourcelibrary/whitepapersdetail.jsp?highlight=whit
              epapers&filePath=components%2Fdev2dev%2Fresourcelibrary%2Fwhitepapers%2Fwp_j
              tatransactions.htm
              > >
              > >Tom
              > >
              > >mihir sharma wrote:
              > >> I am writing a session bean which sends a JMS message using a
              non-weblogic
              > >JMS
              > >> provider. This bean is marked for CMT and I want the JMS send to
              participate
              > >in
              > >> this CMT as well. My understanding is that I should be able to do this
              > >by defining
              > >> a <resource-ref> element in the ejb-jar.xml and a corresponding
              <resource-descriptor>
              > >> element in the weblogic-ejb-jar.xml file. The bean would then use the
              > ><res-ref-name>
              > >> defined under the <resource-ref> element to lookup the connection
              factory.
              > >What
              > >> do I have to put in weblogic-ejb-jar.xml file to make sure that the
              > >connection
              > >> factory specified in <res-ref-name> maps to a connection factory that
              > >is in a
              > >> foreign JNDI provider (e.g. in the non-Weblogic JMS provider's JNDI)
              > >and not in
              > >> Weblogic's JNDI?
              > >>
              > >> Thanks in advance for your help.
              > >>
              > >
              >
              

  • First ejb

    hi everyone
    I am deploying my first EJB in weblogic 5.1 .When i try to load the jar
    file in weblogic's EJB deployer.I am getting the following errors.
    org.xml.sax.SAXParseException: Element "session" requires additional
    elements.
    at com.sun.xml.parser.Parser.error(Parser.java:2775)
    at
    com.sun.xml.parser.ValidatingParser$ChildrenValidator.done(ValidatingParser.
    java:322)
    at com.sun.xml.parser.Parser.maybeElement(Parser.java:1411)
    at com.sun.xml.parser.Parser.content(Parser.java:1498)
    at com.sun.xml.parser.Parser.maybeElement(Parser.java:1399)
    at com.sun.xml.parser.Parser.content(Parser.java:1498)
    at com.sun.xml.parser.Parser.maybeElement(Parser.java:1399)
    at com.sun.xml.parser.Parser.parseInternal(Parser.java:491)
    at com.sun.xml.parser.Parser.parse(Parser.java:283)
    at weblogic.xml.dom.SunDOMParser.getDocument(SunDOMParser.java:69)
    at weblogic.xml.dom.DOMParser.getDocument(DOMParser.java:102)
    at
    weblogic.ejb.deployment.dd.DescriptorLoader.<init>(DescriptorLoader.java:151
    at
    weblogic.ejb.ui.deployer.DeployerFrame.loadDeploymentUnit(DeployerFrame.java
    :1123)
    at
    weblogic.ejb.ui.deployer.AbstractProjectRootNode.loadDeploymentUnit(Abstract
    ProjectRootNode.java:161)
    at
    weblogic.ejb.ui.deployer.DeployerProjectRootNode.load(DeployerProjectRootNod
    e.java:120)
    at
    weblogic.ejb.ui.deployer.DeployerProjectRootNode.load(DeployerProjectRootNod
    e.java:101)
    at
    weblogic.ejb.ui.deployer.ProjectLoaderWorker$LoaderThread.run(ProjectLoaderW
    orker.java, Compiled Code)
    --------------- nested within: ------------------
    Received SAXParseException from Sun Parser at line 13, column -1:
    org.xml.sax.SAXParseException: Element "session" requires additional
    elements.
    at weblogic.xml.dom.SunDOMParser.getDocument(SunDOMParser.java:72)
    at weblogic.xml.dom.DOMParser.getDocument(DOMParser.java:102)
    at
    weblogic.ejb.deployment.dd.DescriptorLoader.<init>(DescriptorLoader.java:151
    at
    weblogic.ejb.ui.deployer.DeployerFrame.loadDeploymentUnit(DeployerFrame.java
    :1123)
    at
    weblogic.ejb.ui.deployer.AbstractProjectRootNode.loadDeploymentUnit(Abstract
    ProjectRootNode.java:161)
    at
    weblogic.ejb.ui.deployer.DeployerProjectRootNode.load(DeployerProjectRootNod
    e.java:120)
    at
    weblogic.ejb.ui.deployer.DeployerProjectRootNode.load(DeployerProjectRootNod
    e.java:101)
    at
    weblogic.ejb.ui.deployer.ProjectLoaderWorker$LoaderThread.run(ProjectLoaderW
    orker.java, Compiled Code)
    Unable to parse: null
    Failed to load C:\weblogic\examples\divya\session.jar
    Here are my java files
    1)home interface----------
    package examples.divya;
    import javax.ejb.*;
    import java.rmi.RemoteException;
    public interface HelloHome extends EJBHome{
    Hello create() throws RemoteException, CreateException;
    2)remote interface---------
    package examples.divya;
    import javax.ejb.*;
    import java.rmi.RemoteException;
    import java.rmi.Remote;
    public interface Hello extends EJBObject{
    public String hello() throws java.rmi.RemoteException;
    3)bean class-----
    package examples.divya;
    import javax.ejb.*;
    public class HelloBean implements SessionBean{
    public void ejbCreate(){
    System.out.println("ejbCreate()");
    public void ejbRemove(){
    System.out.println("ejbRemove()");
    public void ejbActivate(){
    System.out.println("ejbActivate()");
    public void ejbPassivate(){
    System.out.println("ejbPassivate()");
    public void setSessionContext(SessionContext ctx){
    System.out.println("setSessionContext()");
    public String hello(){
    System.out.println("hello()");
    return "Hello, World";
    xml file is-----
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise
    JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
    <ejb-jar>
    <enterprise-beans>
    <session>
    <ejb-name>divya</ejb-name>
    <home>examples.divya.HelloHome</home>
    <remote>examples.divya.Hello</remote>
    <ejb-class>examples.divya.HelloBean</ejb-class>
    <session-type>Stateless</session-type>
    </session>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>divya</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    please help.....thanks in advance
    divya

    Luca -
    I assume you are building EJBs using the older 2.1 specification? If so, you'll need to declare the name of your bean in a deployment descriptor. But if you are creating new EJBs, you might want to use EJB 3.0 instead - then you can just use the EntityManager to get hold of resources like other EJBs with no deployment descriptor needed. Regardless of the version you're developing, this article addresses the old way and the new way:
    http://www.onjava.com/pub/a/onjava/2006/01/04/dependency-injection-java-ee-5.html
    I found this linked from our EJB3 page, which has loads of information for EJB newbies:
    http://www.oracle.com/technology/tech/java/ejb30.html
    Hope this helps,
    Lynn Munsinger
    JDeveloper Product Management

  • Error building my first EJB

    I am trying to build my first EJB. However, everytime I giev the "ant build" command, I get an erro saying "Validation Problems Were Found". This is the only error i get and Not any syntax errors. Does this have something to do with my remote, local and Home interfaces, the Bean Class or Client, OR is it my build. xml file that has some error in it.

    Looks like your ejb-jar.xml is not correct (check the element
    <enterprise-beans>). You may post this file so that I can take a look at it.
    --Sathish
    <Waqar Ahmad> wrote in message news:[email protected]...
    Thanks for replying. Here is the build.xml file and the error output that
    I get when I execute the ant command. My BEAN here is called
    <b>SecuirtyEJB.java</b> and all the files including this BEAN are in a
    foler named SecuritySystem. Now, here is the build.xml file:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <project name="ejb20-basic-SecuritySystem" default="all" basedir=".">
    <!-- set global properties for this build -->
    <property environment="env"/>
    <property file="../../../../../examples.properties"/>
    <property name="build.compiler" value="${compiler}"/>
    <property name="source" value="${basedir}"/>
    <property name="bean.ear" value="ejb20StatelessEar"/>
    <property name="dist" value="${source}/${bean.ear}"/>
    <property name="ejb.name" value="ejb20StatelessEjb"/>
    <property name="package"
    value="examples/ejb/ejb20/basic/SecuritySystem"/>
    <property name="ejb.client.jar"
    value="ejb20_basic_SecuritySystem_client.jar"/>
    <target name="all" depends="build, deploy"/>
    <target name="build" depends="clean,
    prepare.example,
    build.ear,
    compile.client"/>
    <target name="clean">
    <delete dir="${dist}" failonerror="false"/>
    <delete dir="${examples.build.dir}/${bean.ear}" failonerror="false"/>
    <delete dir="${client.classes.dir}/${package}" failonerror="false"/>
    <delete dir="${client.classes.dir}/${ejb.client.jar}"
    failonerror="false"/>
    </target>
    <!-- prepare directories for split directory deployment -->
    <target name="prepare.example"
    description="Prepare the example for compilation and deployment.">
    <mkdir dir="${dist}"/>
    <mkdir dir="${dist}/META-INF"/>
    <mkdir dir="${dist}/${ejb.name}"/>
    <mkdir dir="${dist}/${ejb.name}/${package}"/>
    <antcall target="copy.files"/>
    </target>
    <!-- copy files for split directory deployment -->
    <target name="copy.files"
    description="Copy example files to distribution structure.">
    <copy todir="${dist}/META-INF">
    <fileset dir="${source}">
    <include name="*application.xml"/>
    </fileset>
    </copy>
    <copy todir="${dist}/${ejb.name}/${package}">
    <fileset dir="${source}">
    <include name="*.java"/>
    <exclude name="Client.java"/>
    </fileset>
    </copy>
    <!-- rename bean to .ejb so that wlcompile
    can recognize its to be EJBGen'd -->
    <copy file="${source}/SecurityEJB.java"
    tofile="${dist}/${ejb.name}/${package}/SecurityEJB.ejb"/>
    </target>
    <!-- compile EAR for split directory deployment -->
    <target name="build.ear">
    <wlcompile srcdir="${dist}" destdir="${examples.build.dir}/${bean.ear}"
    includes="${ejb.name}">
    <ejbgen source="${sourceVersion}"/>
    <javac deprecation="${deprecation}" />
    <javac debug="${debug}" />
    </wlcompile>
    <wlappc source="${examples.build.dir}/${bean.ear}"
    debug="${debug}" deprecation="${deprecation}"/>
    </target>
    <!-- deploy split directory application -->
    <target name="deploy"
    description="Deploy ear to WebLogic on ${wls.hostname}:${wls.port}.">
    <wldeploy
    user="${wls.username}"
    password="${wls.password}"
    adminurl="t3://${wls.hostname}:${wls.port}"
    debug="true"
    action="deploy"
    source="${examples.build.dir}/${bean.ear}"
    failonerror="${failondeploy}"/>
    </target>
    <!-- package the application a J2EE formatted exploded ear -->
    <target name="package.exploded.ear">
    <wlpackage srcdir="${dist}" destdir="${examples.build.dir}/${bean.ear}"
    toDir="${dist}" />
    </target>
    <!-- compile example client -->
    <target name="compile.client" description="Compile client.">
    <!--
    http://bugs.bea.com/WebClarify/CREdit?CR=CR199960
    <move file="${user.dir}/${ejb.client.jar}"
    tofile="${client.classes.dir}/${ejb.client.jar}"
    failonerror="false"/>
    -->
    <copy file="${user.dir}/${ejb.client.jar}"
    tofile="${client.classes.dir}/${ejb.client.jar}"/>
    <delete file="${user.dir}/${ejb.client.jar}"/>
    <javac srcdir="${source}" destdir="${client.classes.dir}"
    deprecation="${deprecation}" debug="${debug}"
    classpath="${ex.classpath};${client.classes.dir}/${ejb.client.jar}"
    includes="Client.java"/>
    </target>
    <!-- Run the example -->
    <target name="run">
    <java classname="examples.ejb.ejb20.basic.SecuritySystem.Client"
    fork="yes" failonerror="true">
    <arg value="t3://${wls.hostname}:${wls.port}"/>
    <classpath>
    <pathelement
    path="${ex.classpath};${client.classes.dir}/${ejb.client.jar}"/>
    </classpath>
    </java>
    </target>
    </project>
    Here is the output that I am getting:
    build.ear:
    [ejbgen] EJBGen 9.0
    [ejbgen] Creating
    C:\bea\weblogic90\samples\server\examples\build\ejb20State
    lessEar\ejb20StatelessEjb\\ejb-jar.xml
    [ejbgen] Creating
    C:\bea\weblogic90\samples\server\examples\build\ejb20State
    lessEar\ejb20StatelessEjb\\weblogic-ejb-jar.xml
    [ejbgen] Creating
    C:\bea\weblogic90\samples\server\examples\build\ejb20State
    lessEar\ejb20StatelessEjb\ejbgen-build.xml
    [move] Moving 2 files to
    C:\bea\weblogic90\samples\server\examples\build\ej
    b20StatelessEar\ejb20StatelessEjb\META-INF
    [javac] Compiling 1 source file to
    C:\bea\weblogic90\samples\server\examples
    \build\ejb20StatelessEar\ejb20StatelessEjb
    [javac] Compiling 5 source files to
    C:\bea\weblogic90\samples\server\example
    s\build\ejb20StatelessEar\ejb20StatelessEjb
    [wlappc] <Oct 28, 2005 8:51:48 PM EDT> <Info> <J2EE> <BEA-160186>
    <Compiling
    EAR module 'ejb20StatelessEjb'>
    [wlappc] <Oct 28, 2005 8:51:49 PM EDT> <Error> <J2EE> <BEA-160187>
    <weblogic.
    appc failed to compile your application. Recompile with the -verbose
    option for
    more details. Please see the error message(s) below.>
    <b>BUILD FAILED</b>
    C:\bea\weblogic90\samples\server\examples\src\examples\ejb\ejb20\basic\SecurityS
    ystem\build.xml:68: weblogic.utils.compiler.ToolFailureException:
    <b>VALIDATION PROBLEMS WERE FOUND</b>
    C:\bea\weblogic90\samples\server\examples\src\examples\ejb\ejb20\basic\Securit
    ySystem\ejb20StatelessEar\ejb20StatelessEjb\META-INF\ejb-jar.xml:13:6:13:6:
    prob
    lem: cvc-complex-type.2.4c: Expected elements
    'session@http://java.sun.com/xml/n
    s/j2ee entity@http://java.sun.com/xml/ns/j2ee
    message-driven@http://java.sun.com
    /xml/ns/j2ee' before the end of the content in element
    enterprise-beans@http://j
    ava.sun.com/xml/ns/j2ee:<C:\bea\weblogic90\samples\server\examples\src\examples\
    ejb\ejb20\basic\SecuritySystem\ejb20StatelessEar\ejb20StatelessEjb/META-INF/ejb-
    jar.xml:13:6>
    Total time: 2 minutes 8 seconds
    C:\bea\weblogic90\samples\server\examples\src\examples\ejb\ejb20\basic\SecurityS
    ystem>
    This is the part of the output whee the error message appears and I think
    this is the one you want. Hope you can figure out what the problem is here
    coz as I said, this is my first EJB program. Thanks

  • Noob Question: Problem with Persistence in First Entity Bean

    Hey folks,
    I have started with EJB3 just recently. After reading several books on the topic I finally started programming myself. I wanted to develop a little application for getting a feeling of the technology. So what I did is to create a AppClient, which calls a Stateless Session Bean. This Stateless Bean then adds an Entity to the Database. For doing this I use Netbeans 6.5 and the integrated glassfish. The problem I am facing is, that the mapping somehow doesnt work, but I have no clue why it doesn't work. I just get an EJBException.
    I would be very thankfull if you guys could help me out of this. And don't forget this is my first ejb project - i might need a very detailed answer ... I know - noobs can be a real ....
    So here is the code of the application. I have a few methods to do some extra work there, you can ignore them, there are of no use at the moment. All that is really implemented is testConnection() and testAddCompany(). The testconnection() Methode works pretty fine, but when it comes to the testAddCompany I get into problems.
    Edit:As I found out just now, there is the possibility of Netbeans to add a Facade pattern to an Entity bean. If I use this, everythings fine and it works out to be perfect, however I am still curious, why the approach without the given classes by netbeans it doesn't work.
    public class Main {
        private EntryRemote entryPoint = null;
        public static void main(String[] args) throws NamingException {
            Main main = new Main();
            main.runApplication();
        private void runApplication()throws NamingException{
            this.getContext();
            this.testConnection();
            this.testAddCompany();
            this.testAddShipmentAddress(1);
            this.testAddBillingAddress(1);
            this.testAddEmployee(1);
            this.addBankAccount(1);
        private void getContext() throws NamingException{
            InitialContext ctx = new InitialContext();
            this.entryPoint = (EntryRemote) ctx.lookup("Entry#ejb.EntryRemote");
        private void testConnection()
            System.err.println("Can Bean Entry be reached: " + entryPoint.isAlive());
        private void testAddCompany(){
            Company company = new Company();
            company.setName("JavaFreaks");
            entryPoint.addCompany(company);
            System.err.println("JavaFreaks has been placed in the db");
        }Here is the Stateless Session Bean. I added the PersistenceContext, and its also mapped in the persistence.xml file, however here the trouble starts.
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    @Stateless(mappedName="Entry")
    public class EntryBean implements EntryRemote {
        @PersistenceContext(unitName="PersistenceUnit") private EntityManager manager;
        public boolean isAlive() {
            return true;
        public boolean addCompany(Company company) {
            manager.persist(company);
            return true;
        public boolean addShipmentAddress(long companyId) {
            return false;
        public boolean addBillingAddress(long companyId) {
            return false;
        public boolean addEmployee(long companyId) {
            return false;
        public boolean addBankAccount(long companyId) {
            return false;
    }That you guys and gals will have a complete overview of whats really going on, here is the Entity as well.
    package ejb;
    import java.io.Serializable;
    import javax.persistence.*;
    @Entity
    @Table(name="COMPANY")
    public class Company implements Serializable {
        private static final long serialVersionUID = 1L;
        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        private Long id;
        @Column(name="COMPANY_NAME")
        private String name;
        public Long getId() {
            return id;
        public void setId(Long id) {
            this.id = id;
       public String getName() {
            return name;
        public void setName(String name) {
            this.name = name;
            System.err.println("SUCCESS:  CompanyName SET");
        @Override
        public int hashCode() {
            int hash = 0;
            hash += (id != null ? id.hashCode() : 0);
            return hash;
        @Override
        public boolean equals(Object object) {
            // TODO: Warning - this method won't work in the case the id fields are not set
            if (!(object instanceof Company)) {
                return false;
            Company other = (Company) object;
            if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
                return false;
            return true;
        @Override
        public String toString() {
            return "ejb.Company[id=" + id + "]";
    }And the persistence.xml file
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
      <persistence-unit name="PersistenceUnit" transaction-type="JTA">
        <provider>oracle.toplink.essentials.PersistenceProvider</provider>
        <jta-data-source>jdbc/sample</jta-data-source>
        <exclude-unlisted-classes>false</exclude-unlisted-classes>
        <properties>
          <property name="toplink.ddl-generation" value="create-tables"/>
        </properties>
      </persistence-unit>
    </persistence>And this is the error message
    08.06.2009 10:30:46 com.sun.enterprise.appclient.MainWithModuleSupport <init>
    WARNUNG: ACC003: Ausnahmefehler bei Anwendung.
    javax.ejb.EJBException: nested exception is: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.; nested exception is:
            javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.; nested exception is:
            javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.
            at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:243)
            at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:205)
            at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
            at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225)
            at ejb.__EntryRemote_Remote_DynamicStub.addCompany(ejb/__EntryRemote_Remote_DynamicStub.java)I spend half the night figuring out whats wrong, however I couldnt find any solution.
    If you have any idea pls let me know
    Best regards and happy coding
    Taggert
    Edited by: Taggert_77 on Jun 8, 2009 2:27 PM

    Well I don't understand this. If Netbeans created a Stateless Session Bean as a facade then it works -and it is implemented as a CMP, not as a BMP as you suggested.
    I defenitely will try you suggestion, just for curiosity and to learn the technology, however I dont have see why BMP will work and CMP won't.
    I also don't see why a stateless bean can not be a CMP. As far as I read it should not matter. Also on the link you sent me, I can't see anything related to that.
    Maybe you can help me answering these questions.
    I hope the above lines don't sound harsh. I really appreciate your input.
    Best regards
    Taggert

  • Binding stateful EJB bean

    Hi,
    I have a problem binding EJB bean (Stateful bean). Bean have two business methods:
    SendPacketToTRSM and GetData
    When I invoke SendPacketToTRSM method from process, application server create first instance of bean and invoke method SendPacketToTRSM
    Next I invoke GetData method in process, application server create second instance of bean and invoke method GetData.
    Every time, when I invoke method, application server create new instance of bean and don't remove it.
    Application server after passivation remove instance of bean from container.
    Environment: BPEL 10.0.2(OC4J), patch 4369818, 4406640, 4496111
    EJB bean on JBoss 4.0.2
    The following wsdl EJB binding:
    <?xml version="1.0" ?>
    <definitions targetNamespace="http://xmlns.unizeto.pl/TRSMBPEL"
    xmlns:tns="http://xmlns.unizeto.pl/TRSMBPEL"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:format="http://schemas.xmlsoap.org/wsdl/formatbinding/"
    xmlns:ejb="http://schemas.xmlsoap.org/wsdl/ejb/"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns="http://schemas.xmlsoap.org/wsdl/">
    <!-- message declns -->
    <message name="SendPacketToTRSMRequestMessage">
    <part name="sender" type="xsd:int"/>
    <part name="bufferToTRSM" type="xsd:string"/>
    </message>
    <message name="SendPacketToTRSMResponseMessage">
    <part name="result" type="xsd:int"/>
    </message>
    <message name="GetDataRequestMessage">
    </message>
    <message name="GetDataResponseMessage">
    <part name="result" type="xsd:string"/>
    </message>
    <message name="RemoveRequestMessage">
    </message>
    <message name="RemoveResponseMessage">
    </message>
    <message name="CreateRequestMessage">
    </message>
    <message name="CreateResponseMessage">
    </message>
    <!-- port type declns -->
    <portType name="TRSMService">
    <operation name="SendPacketToTRSM">
    <input name="SendPacketToTRSMRequest" message="tns:SendPacketToTRSMRequestMessage"/>
    <output name="SendPacketToTRSMResponse" message="tns:SendPacketToTRSMResponseMessage"/>
    </operation>
    <operation name="GetData">
    <input name="GetDataRequest" message="tns:GetDataRequestMessage"/>
    <output name="GetDataResponse" message="tns:GetDataResponseMessage"/>
    </operation>
    <operation name="Remove">
    <input name="RemoveRequest" message="tns:RemoveRequestMessage"/>
    <output name="RemoveResponse" message="tns:RemoveResponseMessage"/>
    </operation>
    <operation name="Create">
    <input name="CreateRequest" message="tns:CreateRequestMessage"/>
    <output name="CreateResponse" message="tns:CreateResponseMessage"/>
    </operation>
    <operation name="SSCDAuthorizedForget">
    </portType>
    <!-- binding declns -->
    <binding name="EJBBinding" type="tns:TRSMService">
    <ejb:binding/>
    <format:typeMapping encoding="Java" style="Java">
    <format:typeMap typeName="xsd:int" formatType="int"/>
    <format:typeMap typeName="xsd:string" formatType="java.lang.String"/>
    </format:typeMapping>
    <operation name="SendPacketToTRSM">
    <ejb:operation
    methodName="SendBase64PacketToTRSM"
    parameterOrder="sender bufferToTRSM"
    interface="remote"
    returnPart="result"/>
    <input name="SendPacketToTRSMRequest"/>
    <output name="SendPacketToTRSMResponse"/>
    </operation>
    <operation name="GetData">
    <ejb:operation
    methodName="GetBase64Data"
    parameterOrder=""
    interface="remote"
    returnPart="result"/>
    <input name="GetDataRequest"/>
    <output name="GetDataResponse"/>
    </operation>
    <operation name="Remove">
    <ejb:operation
    methodName="remove"
    interface="remote"/>
    </operation>
    <operation name="Create">
    <ejb:operation
    methodName="create"
    interface="home"/>
    </operation>
    </binding>
    <!-- service decln -->
    <service name="TRSMService">
    <port name="EJBPort" binding="tns:EJBBinding">
    <ejb:address className="pl.unizeto.pki.des.ssp.trsmd.TRSMDRemoteHome"
    jndiName="pl.unizeto.pki.des.ssp.trsmd.TRSMDBean"
    initialContextFactory="org.jnp.interfaces.NamingContextFactory"
         jndiProviderURL="192.168.129.202:1999"/>
    </port>
    </service>
    <!-- partner links -->
    <plnk:partnerLinkType name="TRSMService">
    <plnk:role name="TRSMServiceProvider">
    <plnk:portType name="tns:TRSMService"/>
    </plnk:role>
    </plnk:partnerLinkType>
    </definitions>
    and bpel source
    <process name="TRSMBPEL" targetNamespace="http://xmlns.unizeto.pl/TRSMBPEL" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:tns="http://xmlns.unizeto.pl/TRSMBPEL" xmlns:ns1="http://www.w3.org/2001/XMLSchema" xmlns:trsm="http://xmlns.unizeto.pl/TRSMBPEL" xmlns:ctask="http://services.oracle.com/bpel/task" xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:taskMgr="http://services.oracle.com/bpel/task" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"><!-- ================================================================= --><!-- PARTNERLINKS --><!-- List of services participating in this BPEL process --><!-- ================================================================= -->
    <partnerLinks><!--
    The 'client' role represents the requester of this service. It is
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    <partnerLink name="client" partnerLinkType="tns:TRSMBPEL" myRole="TRSMBPELProvider"/>
    <partnerLink name="TRSMService" partnerRole="TRSMServiceProvider" partnerLinkType="tns:TRSMService"/>
    <partnerLink myRole="TaskManagerRequester" name="userTask" partnerRole="TaskManager" partnerLinkType="taskMgr:TaskManager"/>
    </partnerLinks><!-- ================================================================= --><!-- VARIABLES --><!-- List of messages and XML documents used within this BPEL process --><!-- ================================================================= -->
    <variables><!-- Reference to the message passed as input during initiation -->
    <variable name="inputVariable" messageType="tns:TRSMBPELRequestMessage"/>
    <variable name="outputVariable" messageType="tns:TRSMBPELResponseMessage"/>
    <variable name="SendPacketToTRSM_SendPacketToTRSM_InputVariable" messageType="tns:SendPacketToTRSMRequestMessage"/>
    <variable name="SendPacketToTRSM_SendPacketToTRSM_OutputVariable" messageType="tns:SendPacketToTRSMResponseMessage"/>
    <variable name="GetData_GetData_InputVariable" messageType="tns:GetDataRequestMessage"/>
    <variable name="GetData_GetData_OutputVariable" messageType="tns:GetDataResponseMessage"/>
    <variable name="UserTask2.0Var1" element="ctask:task"/>
    <variable name="Invoke_1_Create_InputVariable" messageType="tns:CreateRequestMessage"/>
    <variable name="Invoke_1_Create_OutputVariable" messageType="tns:CreateResponseMessage"/>
    <variable name="removeTRSMD_Remove_InputVariable" messageType="tns:RemoveRequestMessage"/>
    <variable name="removeTRSMD_Remove_OutputVariable" messageType="tns:RemoveResponseMessage"/>
    </variables><!-- ================================================================= --><!-- ORCHESTRATION LOGIC --><!-- Set of activities coordinating the flow of messages across the --><!-- services integrated within this business process --><!-- ================================================================= -->
    <sequence name="main"><!-- Receive input from requestor.
    Note: This maps to operation defined in TRSMBPEL.wsdl
    -->
    <receive name="receiveInput" partnerLink="client" portType="tns:TRSMBPEL" operation="process" variable="inputVariable" createInstance="yes"/>
    <scope name="Scope_1">
    <variables>
    <variable name="Invoke_3_Create_InputVariable" messageType="tns:CreateRequestMessage"/>
    <variable name="Invoke_3_Create_OutputVariable" messageType="tns:CreateResponseMessage"/>
    <variable name="Invoke_1_Remove_InputVariable" messageType="tns:RemoveRequestMessage"/>
    </variables>
    <sequence name="Sequence_1">
    <assign name="Init">
    <copy>
    <from variable="inputVariable" part="payload" query="/tns:TRSMBPELProcessRequest/tns:sender"/>
    <to variable="SendPacketToTRSM_SendPacketToTRSM_InputVariable" part="sender"/>
    </copy>
    <copy>
    <from variable="inputVariable" part="payload" query="/tns:TRSMBPELProcessRequest/tns:buffer"/>
    <to variable="SendPacketToTRSM_SendPacketToTRSM_InputVariable" part="bufferToTRSM"/>
    </copy>
    </assign>
    <invoke name="create" partnerLink="TRSMService" portType="tns:TRSMService" operation="Create" inputVariable="Invoke_3_Create_InputVariable" outputVariable="Invoke_3_Create_OutputVariable"/>
    <invoke name="SendPacketToTRSM" partnerLink="TRSMService" portType="tns:TRSMService" operation="SendPacketToTRSM" inputVariable="SendPacketToTRSM_SendPacketToTRSM_InputVariable" outputVariable="SendPacketToTRSM_SendPacketToTRSM_OutputVariable"/>
    <invoke name="GetData" partnerLink="TRSMService" portType="tns:TRSMService" operation="GetData" inputVariable="GetData_GetData_InputVariable" outputVariable="GetData_GetData_OutputVariable"/>
    <invoke name="Remove" partnerLink="TRSMService" portType="tns:TRSMService" operation="Remove" inputVariable="Invoke_1_Remove_InputVariable"/>
    </sequence>
    </scope><!-- Generate reply to synchronous request -->
    <assign name="Result">
    <copy>
    <from variable="GetData_GetData_OutputVariable" part="result"/>
    <to variable="outputVariable" part="payload" query="/tns:TRSMBPELProcessResponse/tns:data"/>
    </copy>
    </assign>
    <reply name="replyOutput" partnerLink="client" portType="tns:TRSMBPEL" operation="process" variable="outputVariable"/>
    </sequence>
    </process>
    Could anyone explain, is it possible to binding stateful bean to process?
    Thanks
    Norbert

    Did some additional investigations and concluded"
    The (embedded) OTC uses default the empty to obtain the reference to a Session Bean (EJB). In my case I was using the Remote Interface and my Context was empty { }:
    Hashtable ht = ic.getEnvironment();
    System.out.println(ht.toString());
    When I supply the missing information, obtained via the Test Client that functions correctly, a new Bean instance was created for each Client. My getInitialContext() method looks like the example below.
    public InitialContext getInitialContext() throws NamingException {
    Properties p =new Properties();
    p.setProperty( "java.naming.factory.initial", "com.evermind.server.rmi.RMIInitialContextFactory");
    p.setProperty( "java.naming.provider.url", "ormi://localhost:23892/current-workspace-app" );
    I tried the ApplicationInitialContextFactory and again the same Bean instance was shared among all Clients. I did not try ApplicationClientInitialContextFactory, but I expect that the Remote interface will be used!
    Is it a Bug that ApplicationInitialContextFactory does not create a new instance for my Stateful Session Bean? I can use the Remote interface, but that would decrease the performance and it is less elegant...
    Michael

  • Javax.naming.NameNotFoundException: error in whil calling EJB Bean

    Dear friends,
    I have created (Bean Managed Entity) a remote,home and bean objects for adding a country in a database. When i convert
    into jar and and deploy means, its working fine. But if i put into a package means it does work
    and raise "javax.naming.NameNotFoundException" error.
    i keep my files as following folder structure
    d:\siva\projects\ShopCart\
    (under this )
    CountryMas.java
    CountryHome.java
    CountryBean.java
    CountryMasPK.java
    <meta-inf>
    ejb-jar.xml
    weblogic-ejb-jar.xml
    and deployed in weblogic 6.1 using console.
    i have copied the source code here with
    Remote interface
    package ShopCart;
    import javax.ejb.*;
    import javax.rmi.*;
    public interface CountryMas extends EJBObject {
    Home Interface
    package ShopCart;
    import javax.ejb.*;
    import java.rmi.*;
    public interface CountryHome extends EJBHome {
         public CountryMas create(String Cname) throws CreateException,RemoteException;
         public CountryMas findByPrimaryKey(CountryMasPK pk) throws      
    FinderException,RemoteException;
    BEAN OBJECT
    package ShopCart;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import javax.sql.*;
    import javax.ejb.*;
    import javax.naming.*;
    public class CountryBean implements EntityBean {
         private EntityContext ctx;
         private int CountryId;
         private String CountryName;
         public void setEntityContext(EntityContext ctx){
              this.ctx = ctx;
         public void unsetEntityContext(){
              this.ctx = null;
         public void ejbActivate(){
         public void ejbPassivate(){
         public void ejbLoad(){
         public void ejbStore(){
         public void ejbRemove(){
              Connection con = null;
              PreparedStatement ps = null ;
              try {
                   con = getConnection();
                   ps = con.prepareStatement("Delete from CountryMas where id=?");
                   ps.setInt(1,CountryId);
                   if (ps.executeUpdate() !=1) {
                        String Error = "JDBC did not create any row";
                        throw new CreateException (Error);
              }catch (Exception e){
                   System.out.println (e);
         public CountryMasPK ejbCreate(String Cname) throws CreateException {
              this.CountryName =Cname;
              Connection con = null;
              PreparedStatement ps = null ;
              try {
                   con = getConnection();
                   ps = con.prepareStatement("insert into CountryMas values(?)");
                   ps.setString (1,CountryName);
                   if (ps.executeUpdate() !=1) {
                        String Error = "JDBC did not delete any row";
                        throw new CreateException (Error);
                   con.commit();
              }catch (Exception e){
                   System.out.println (e);
              int PKid=0;
              ResultSet rs;
              PreparedStatement ps1 = null;
              try {
                   ps1 = con.prepareStatement("select max(id) as Mid from CountryMas");
                   rs = ps1.executeQuery();
                   PKid = rs.getInt("mid");
              }catch(Exception e){
                   System.out.println (e);
              return new CountryMasPK(PKid);
         public void ejbPostCreate(String Cname) throws CreateException {
         private Connection getConnection()throws SQLException {
              InitialContext initCtx = null;
              DataSource ds = null;
              try{
                   initCtx = new InitialContext ();
                   ds = (javax.sql.DataSource)
                        initCtx.lookup("java:comp/env/jdbc/ShopCartPool");
              }catch(Exception e){
                   System.out.println(e);
              return ds.getConnection();           
         public CountryMasPK ejbFindByPrimaryKey(CountryMasPK pk)throws ObjectNotFoundException {
              Connection con= null;
              PreparedStatement ps = null ;
              try{
                   con = getConnection();
                   ps = con.prepareStatement("select cname from CountryMas where id=?");
                   ps.setInt(1,pk.ID);
                   ps.executeQuery();
                   ResultSet rs= ps.getResultSet();
                   if (rs.next()){
                        this.CountryName = rs.getString(1);
              }catch(Exception e){
                   System.out.println(e);
              //return new CountryMasPK(pk.i);
              return pk;
    PRIMARY KEY OBJECT
    package ShopCart;
    import java.io.Serializable;
    public class CountryMasPK implements java.io.Serializable {
         public int ID;
         public CountryMasPK(int ID){
              this.ID =ID;
         public CountryMasPK(){
         public CountryMasPK(CountryMasPK pk){
                   this.ID = pk.ID;
         public String toString(){
                   return new Integer(ID).toString();
         public int hashCode(){
              return new Integer(ID).hashCode();
         public boolean equals(Object countrymas){
              //return ((CountryMasPK)countrymas).ID.equals(ID);
              return true;
    EJB-JAR.XML
    <?xml version="1.0"?>
    <!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>
    <entity>
    <ejb-name>ShopCart</ejb-name>
    <home>ShopCart.CountryHome</home>
    <remote>ShopCart.CountryMas</remote>
    <ejb-class>ShopCart.CountryBean</ejb-class>
    <persistence-type>Bean</persistence-type>
    <prim-key-class>ShopCart.CountryMasPK</prim-key-class>
    <reentrant>False</reentrant>
    <resource-ref>
    <res-ref-name>jdbc/ShopCartPool</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>ShopCart</ejb-name>
         <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    WEBLOGIC-EJB-JAR.XML
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC
    '-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN'
    'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>ShopCart</ejb-name>
    <reference-descriptor>
    <resource-description>
    <res-ref-name>jdbc/ShopCartPool</res-ref-name>
         <jndi-name>ShopCartDataSource</jndi-name>
    </resource-description>
    </reference-descriptor>
    <jndi-name>Country</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    i converted jar file like this
    d:\siva\projects\> set claapath=%classpath%;.;
    cd d:\siva\projects\ShopCart > javac *.java
    cd d:\siva\projects\ShopCart > jar -cvf Sh.jar *
    cd..
    d:\siva\projects> java weblogic.ejbc ShopCart\Sh.jar ShopCart\Shop.jar
    and deployed using weblogic 6.1 console
    and client code as follows
    Client.java
    import java.io.*;
    import javax.naming.*;
    import javax.ejb.*;
    import javax.rmi.*;
    import java.util.*;
    import ShopCart.*;
    class Client {
         public static void main(String args[]){
              Context ctx=null;
              try{
                   Properties pr = new Properties();
                   pr.put(Context.INITIAL_CONTEXT_FACTORY,
                        "weblogic.jndi.WLInitialContextFactory");
                   pr.put(Context.PROVIDER_URL,"t3://localhost:7001");
                   ctx= new InitialContext(pr);
                   Object obj = ctx.lookup("Country");
                   CountryHome cm = (CountryHome)
    javax.rmi.PortableRemoteObject.narrow(obj,CountryHome.class);
                   cm.create(args[0]);
                   System.out.println ("Creating Country " + args[0] +" ..... [Done]");          
              }catch (Exception e){
                   System.out.println(e);
    when i run this file it raise the error
    D:\Siva\Projects>java Client.java
    Exception in thread "main" java.lang.NoClassDefFoundError: Client/java
    D:\Siva\Projects>java Client
    javax.naming.NameNotFoundException: Unable to resolve Country. Resolved: '' Unre
    solved:'Country' ; remaining name ''
    D:\Siva\Projects>
    This is the error message. Please observe it and do let me know what would be the error. There
    would be small configuration error. But i couldn't locate it . plz help me somebody.
    Thanx & Regards,
    Siva.

    you need to use the name java:comp/env/Country in the client.
    and the client deployment descriptor will need an ejb-ref entry:
    <ejb-ref>
      <ejb-ref-name>
        Country
      </ejb-ref-name>
      <ejb-ref-type>
        Session
      </ejb-ref-type>
      <home>
        ShopCart.CountryHome
      </home>
      <remote>
        ShopCart.CountryMas
      </remote>
    </ejb-ref>toby

  • Stuck In the Mud with First EJB

    I am using the apress 'Beginning Java EE, from Novice to Professional' book. In its first EJB example it attempts to create am extremely simple stateless session bean. There are two classes and a remote interface as follows;
    package beans;
    import javax.ejb.Remote;
    @Remote
    public interface SimpleSession
    public String getEchoString(String clientString);
    package beans;
    import javax.ejb.Stateless;
    @Stateless
    public class SimpleSessionBean implements SimpleSession {
    public String getEchoString(String clientString) {
    return clientString + " - from session bean";
    package client;
    import beans.SimpleSession;
    import javax.naming.InitialContext;
    public class SimpleSessionClient {
    public static void main(String[] args) throws Exception
    InitialContext ctx = new InitialContext();
    SimpleSession simpleSession
    = (SimpleSession) ctx.lookup(SimpleSession.class.getName());
    for (int i = 0; i < args.length; i++) {
    String returnedString = simpleSession.getEchoString(args);
    System.out.println("sent string: " + args[i] +
    ", received string: " + returnedString);
    The directory structure is;
    SimpleSessionApp
    |-beans
    |-SimpleSession
    |-SimpleSessionBean
    |-client
    |-SimpleSessionClientThe tells you to add the following to your classpath;
    set CLASSPATH=.;C:\jboss\lib\concurrent.jar;
    C:\jboss\lib\jboss-common.jar;
    c:\jboss\client\jboss-j2ee.jar;
    c:\jboss\lib\commons-httpclient.jar;
    C:\jboss\server\all\lib\jboss.jar;
    C:\jboss\server\all\lib\jboss-remoting.jar;
    C:\jboss\server\all\lib\jboss-transaction.jar;
    C:\jboss\server\all\lib\jnpserver.jar;
    C:\jboss\server\all\deploy\ejb3.deployer\jboss-ejb3.jar;
    C:\jboss\server\all\deploy\ejb3.deployer\jboss-ejb3x.jar;
    C:\jboss\server\all\deploy\jboss-aop.deployer\
    jboss-aop.jar;
    C:\jboss\server\all\deploy\jboss-aop.deployer\
    jboss-aspect-library.jar
    The next step is to compile the java source  code;
    javac -d . client/*.java
    javac -d . beans/*.javaAfter this you create an ejb3 jar;
    jar cf SimpleSessionApp.ejb3 beans\*.javaAnd deploy this jar to your jboss deploy directory while jboss is running. Once this is done you run the client with the following arguments and switches while inside the client directory of SimpleSessionApp;
    java
    -Djava.naming.factory.initial=
    org.jnp.interfaces.NamingContextFactory
    -Djava.naming.factory.url.pkgs=
    org.jboss.naming:org.jnp.interfaces
    -Djava.naming.provider.url=
    localhost client.SimpleSessionClient
    Now is the time for all good men
    After having done all of this I get the following error
    +Exception in thread "main" java.lang.NoSuchMethodError: main+
    why is this? This is my first attempt at creating an ejb and I'm totally lost. Any help would be appreciated.
    Edited by: Jazman on Feb 19, 2008 2:42 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    if you turn the computer off and turn it back on while you hold down the mouse key that should get the disc out.

  • Stalling action-instance: with message: javax.ejb.TransactionRolledbackLocalException: Invocation error.; CausedByException is:

    Suddenly the server has started throwing an exception. I don't know what would have caused it. I also reverted all the changes from when the error started. The action stalls but it completes the process.
    Below are the logs
    2009-07-03 13:05:17,349 ERROR [com.adobe.workflow.AWS] stalling action-instance: 21772 with message: javax.ejb.TransactionRolledbackLocalException: Invocation error.; CausedByException is:
    Invocation error.
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:247)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor. java:122)
    at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
    at org.jboss.ejb.Container.invoke(Container.java:873)
    at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:415)
    at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:88)
    at $Proxy201.finalizeCompleteProcess(Unknown Source)
    at com.adobe.workflow.engine.SynchronousBranch.updateBranchInstanceStatus(SynchronousBranch. java:709)
    at com.adobe.workflow.engine.SynchronousBranch.execute(SynchronousBranch.java:887)
    at com.adobe.workflow.engine.ProcessEngineBMTBean.continueBranchAtAction(ProcessEngineBMTBea n.java:2773)
    at com.adobe.workflow.engine.ProcessEngineBMTBean.asyncContinueBranchCommand(ProcessEngineBM TBean.java:2528)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionConta iner.java:214)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:149)
    at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor. java:54)
    at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
    at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:1 58)
    at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance Interceptor.java:154)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor. java:122)
    at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
    at org.jboss.ejb.Container.invoke(Container.java:873)
    at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:415)
    at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:88)
    at $Proxy202.asyncContinueBranchCommand(Unknown Source)
    at com.adobe.workflow.engine.ProcessCommandControllerBean.doOnMessage(ProcessCommandControll erBean.java:144)
    at com.adobe.workflow.engine.ProcessCommandControllerBean.onMessage(ProcessCommandController Bean.java:99)
    at sun.reflect.GeneratedMethodAccessor547.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
    at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.j ava:475)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:149)
    at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterc eptor.java:101)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
    at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:94)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
    at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:389)
    at org.jboss.ejb.Container.invoke(Container.java:873)
    at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:1077)
    at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerI nvoker.java:1379)
    at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
    at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:904 )
    at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:160)
    at org.jboss.mq.SpySession.run(SpySession.java:333)
    at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
    at java.lang.Thread.run(Thread.java:595)
    ALC-DSC-003-000: com.adobe.idp.dsc.DSCInvocationException: Invocation error.
    at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.jav a:152)
    at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor. java:140)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(Transa ctionInterceptor.java:74)
    at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(EjbTr ansactionCMTAdapterBean.java:342)
    at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doSupports(Ej bTransactionCMTAdapterBean.java:212)
    at sun.reflect.GeneratedMethodAccessor338.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionConta iner.java:214)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:149)
    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance Interceptor.java:154)
    at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor. java:54)
    at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:363)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor. java:122)
    at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
    at org.jboss.ejb.Container.invoke(Container.java:873)
    at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:415)
    at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:88)
    at $Proxy169.doSupports(Unknown Source)
    at com.adobe.idp.dsc.transaction.impl.ejb.EjbTransactionProvider.execute(EjbTransactionProvi der.java:104)
    at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor.intercept(TransactionInt erceptor.java:72)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.InvocationStrategyInterceptor.intercept(InvocationStra tegyInterceptor.java:55)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.InvalidStateInterceptor.intercept(InvalidStateIntercep tor.java:37)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.AuthorizationInterceptor.intercept(AuthorizationInterc eptor.java:109)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.JMXInterceptor.intercept(JMXInterceptor.java:48)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.engine.impl.ServiceEngineImpl.invoke(ServiceEngineImpl.java:115)
    at com.adobe.idp.dsc.routing.Router.routeRequest(Router.java:118)
    at com.adobe.idp.dsc.provider.impl.base.AbstractMessageReceiver.routeMessage(AbstractMessage Receiver.java:91)
    at com.adobe.idp.dsc.provider.impl.vm.VMMessageDispatcher.doSend(VMMessageDispatcher.java:21 5)
    at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispat cher.java:57)
    at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)
    at com.adobe.idp.dsc.clientsdk.ServiceClient.sendInvocationResponse(ServiceClient.java:147)
    at com.adobe.workflow.engine.PEUtil.completeLongLivedJob(PEUtil.java:1156)
    at com.adobe.workflow.engine.ProcessEngineCMTBean.finalizeCompleteProcess(ProcessEngineCMTBe an.java:1163)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionConta iner.java:214)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:149)
    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance Interceptor.java:154)
    at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor. java:54)
    at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor. java:122)
    at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
    at org.jboss.ejb.Container.invoke(Container.java:873)
    at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:415)
    at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:88)
    at $Proxy201.finalizeCompleteProcess(Unknown Source)
    at com.adobe.workflow.engine.SynchronousBranch.updateBranchInstanceStatus(SynchronousBranch. java:709)
    at com.adobe.workflow.engine.SynchronousBranch.execute(SynchronousBranch.java:887)
    at com.adobe.workflow.engine.ProcessEngineBMTBean.continueBranchAtAction(ProcessEngineBMTBea n.java:2773)
    at com.adobe.workflow.engine.ProcessEngineBMTBean.asyncContinueBranchCommand(ProcessEngineBM TBean.java:2528)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionConta iner.java:214)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:149)
    at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor. java:54)
    at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
    at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:1 58)
    at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance Interceptor.java:154)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor. java:122)
    at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
    at org.jboss.ejb.Container.invoke(Container.java:873)
    at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:415)
    at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:88)
    at $Proxy202.asyncContinueBranchCommand(Unknown Source)
    at com.adobe.workflow.engine.ProcessCommandControllerBean.doOnMessage(ProcessCommandControll erBean.java:144)
    at com.adobe.workflow.engine.ProcessCommandControllerBean.onMessage(ProcessCommandController Bean.java:99)
    at sun.reflect.GeneratedMethodAccessor547.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
    at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.j ava:475)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:149)
    at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterc eptor.java:101)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
    at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:94)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
    at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:389)
    at org.jboss.ejb.Container.invoke(Container.java:873)
    at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:1077)
    at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerI nvoker.java:1379)
    at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
    at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:904 )
    at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:160)
    at org.jboss.mq.SpySession.run(SpySession.java:333)
    at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: com.adobe.idp.jobmanager.common.JobManagerException: ALC-EMP-001-000: com.adobe.idp.dsc.provider.ProviderRuntimeException: Error in sending results
    at com.adobe.idp.jobmanager.ejb.JobManagerBean.completeJob(JobManagerBean.java:531)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionConta iner.java:214)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:149)
    at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor. java:54)
    at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
    at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:1 58)
    at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance Interceptor.java:154)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor. java:122)
    at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
    at org.jboss.ejb.Container.invoke(Container.java:873)
    at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:415)
    at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:88)
    at $Proxy214.completeJob(Unknown Source)
    at com.adobe.idp.jobmanager.service.JobManagerService.completeJob(JobManagerService.java:115 )
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.jav a:118)
    ... 116 more
    Caused by: ALC-EMP-001-000: com.adobe.idp.dsc.provider.ProviderRuntimeException: Error in sending results
    at com.adobe.idp.dsc.provider.service.email.impl.write.EmailResultHandlerImpl.sendResults(Em ailResultHandlerImpl.java:363)
    at com.adobe.idp.dsc.provider.service.email.impl.write.EmailResultHandlerImpl.handleSuccess( EmailResultHandlerImpl.java:83)
    at com.adobe.idp.dsc.provider.service.email.impl.write.EmailResultHandlerImpl.handleSuccess( EmailResultHandlerImpl.java:72)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.jav a:118)
    at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor. java:140)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(Transa ctionInterceptor.java:74)
    at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(EjbTr ansactionCMTAdapterBean.java:342)
    at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doSupports(Ej bTransactionCMTAdapterBean.java:212)
    at sun.reflect.GeneratedMethodAccessor338.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionConta iner.java:214)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:149)
    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance Interceptor.java:154)
    at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor. java:54)
    at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:363)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor. java:122)
    at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
    at org.jboss.ejb.Container.invoke(Container.java:873)
    at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:415)
    at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:88)
    at $Proxy169.doSupports(Unknown Source)
    at com.adobe.idp.dsc.transaction.impl.ejb.EjbTransactionProvider.execute(EjbTransactionProvi der.java:104)
    at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor.intercept(TransactionInt erceptor.java:72)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.InvocationStrategyInterceptor.intercept(InvocationStra tegyInterceptor.java:55)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.InvalidStateInterceptor.intercept(InvalidStateIntercep tor.java:37)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.AuthorizationInterceptor.intercept(AuthorizationInterc eptor.java:132)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.JMXInterceptor.intercept(JMXInterceptor.java:48)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.engine.impl.ServiceEngineImpl.invoke(ServiceEngineImpl.java:115)
    at com.adobe.idp.dsc.routing.Router.routeRequest(Router.java:118)
    at com.adobe.idp.dsc.provider.impl.base.AbstractMessageReceiver.routeMessage(AbstractMessage Receiver.java:91)
    at com.adobe.idp.dsc.provider.impl.vm.VMMessageDispatcher.doSend(VMMessageDispatcher.java:21 5)
    at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispat cher.java:57)
    at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)
    at com.adobe.idp.jobmanager.ejb.JobManagerBean.processResponseCallBackInfo(JobManagerBean.ja va:1395)
    at com.adobe.idp.jobmanager.ejb.JobManagerBean.completeJob(JobManagerBean.java:511)
    ... 143 more
    Caused by: java.lang.NullPointerException
    at com.adobe.idp.dsc.provider.service.email.impl.write.EmailResultHandlerImpl.sendResults(Em ailResultHandlerImpl.java:194)
    ... 194 more

    hi experts,
        Am using Store Content - EMCDocumentumContentRepositoryConnector service in LC ES2 process. It gets stalled saying with the message:
    "javax.ejb.TransactionRolledbackLocalException
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:262)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor. java:138)
    at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
    at org.jboss.ejb.Container.invoke(Container.java:960)
    at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430)
    at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)
    at $Proxy223.finalizeCompleteProcess(Unknown Source)"
    I have configured the path and credentials properly but still i encounter this issue.
    Guys can you help me in this regard.?  Thanks
    Balaji

  • EJB local invocation with getEJBLocalObject()

    Hello,
    Imagine I have the following business service which is an EJB:
    @Stateless
    @Local
    public class Service1
         public void operation1()
              // Treatment started...
              this.operation2();
              // Treatment finished.
         public void operation2()
              // Treatment ...
    Let's assume that the required annotations have been added so that:
    -) the operation1 must be in transaction
    -) the operation2 can't be in transaction.
    If the operation1 is invoked from another client (a front-end for example), a transaction will be opened by the EJB container.
    But if I invoke the operation2 from the operation1 as described in the code (with the this. referencing the current instance and not the local EJB), what will it happen?
    Should I make something like getEJBLocalObject().operation2() to ensure that the operation2 won't be in transaction as configured?
    Thank you in advance.
    Kind regards,
    bgOnline

    Yes, it has always been this way. The behavior is independent of how the CMT metadata is specified. Container-managed transactions, method authorization, etc. only take place when an EJB component invocation occurs. The only way to make an EJB component invocation is on an EJB reference. getBusinessObject() is just a convenience method that returns the same thing "@EJB MyLocalIntf myLocal" would.
    If the bean instance calls this.operation2() the container is not involved. It's just a plain Java method call.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • EJB Bean not being called

    HI
    I have a session bean deployed on Weblogic 8.1, when I try to call a method on bean from a simple class (out side of server context) it is just calling the method on the remote object but not Bean object.
    I made a jar file and deployed it through weblogic console, It worked fine when I test with Test this EJB link on the Testing Tab on console.
    client class was not part of jar.
    weblogic-ejb-jar.xml
    <weblogic-enterprise-bean>
    <ejb-name>Create</ejb-bean>
    <jndi-name>java/CreateHome</jndi-name>
    </weblogic-enterprise-bean>ejb-jar.xml
    <ejb-jar>
    <enterprise-beans>
    <session>
      <ejb-name>Create</ejb-name>
    <home>CreateHome</home>
    <ejb-class>CreateBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>container</transaction-type>
    </session>
    </ejb-jar>client code
    Hashtable ht = new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory")"
    InitialContext ctx = new InitialContext(ht);
    Object obj = ctx.lookup("java/CreateHome");
    CreateHome home =   
          (CreateHome)PortableRemoteObject.narrow(obj,CreateHome.class);
    Create remote = home.create();
    remote.callSomemethod();any help will be appreciated, thank you

    Sorry guys please ignore my post.
    It was working fine, I was not looking at weblogic Server logs for my ejb printouts , instead I was looking at logs for the Client code in Net beans.
    sounds stupid right ?

  • CMT with non-weblogic JMS in a session bean

    I am writing a session bean which sends a JMS message using a non-weblogic JMS
    provider. This bean is marked for CMT and I want the JMS send to participate in
    this CMT as well. My understanding is that I should be able to do this by defining
    a <resource-ref> element in the ejb-jar.xml and a corresponding <resource-descriptor>
    element in the weblogic-ejb-jar.xml file. The bean would then use the <res-ref-name>
    defined under the <resource-ref> element to lookup the connection factory. What
    do I have to put in weblogic-ejb-jar.xml file to make sure that the connection
    factory specified in <res-ref-name> maps to a connection factory that is in a
    foreign JNDI provider (e.g. in the non-Weblogic JMS provider's JNDI) and not in
    Weblogic's JNDI?
    Thanks in advance for your help.

    I am writing a session bean which sends a JMS message using a non-weblogic JMS
    provider. This bean is marked for CMT and I want the JMS send to participate in
    this CMT as well. My understanding is that I should be able to do this by defining
    a <resource-ref> element in the ejb-jar.xml and a corresponding <resource-descriptor>
    element in the weblogic-ejb-jar.xml file. The bean would then use the <res-ref-name>
    defined under the <resource-ref> element to lookup the connection factory. What
    do I have to put in weblogic-ejb-jar.xml file to make sure that the connection
    factory specified in <res-ref-name> maps to a connection factory that is in a
    foreign JNDI provider (e.g. in the non-Weblogic JMS provider's JNDI) and not in
    Weblogic's JNDI?
    Thanks in advance for your help.

  • How to avoid restart weblogic after I modify EJB implementation class?

    I am sure I redeploy my application after I modify EJB implementation class. It
    is unacceptable to restart weblogic server if I changed some EJB . Is there any
    way to avoid this?
    Thanks!

    I would open a case with BEA support. I would take a look at it, but I'm going
    on vacation :(
    pat
    "CottonXu" <[email protected]> wrote:
    >
    My WLS version is 7.0 and I use weblogic console to redeploy the entire
    application.
    I am sure that EJBs are not in classpath.
    What should I do ?
    "Pat Bumpus" <[email protected]> wrote:
    Hi,
    I haven't seen this behavior. My EJBs seem to redeploy and pick upthe
    EJB bean
    changes. Make sure that your EJB is not in the system classpath that
    could cause
    this problem.
    What version of WLS?
    How are you deploying the EJB?
    pat
    "CottonXu" <[email protected]> wrote:
    I am sure I redeploy my application after I modify EJB implementation
    class. It
    is unacceptable to restart weblogic server if I changed some EJB .
    Is
    there any
    way to avoid this?
    Thanks!

  • Stateless Session EJB Bean Example please

    Dear Friends,
    Develop a stateless session EJB bean and deploy it in WebLogic 8.1
    Please proivde me a weblogic8.1 example along with the deployment steps.
    Also mention the supporting softwares needed.
    I have weblogic 8.1, JDK 1.5
    Advance Thanks.
    Rengaraj.R

    Hi Rahul,
    Please paste the files here if they are small in size.
    IDfLoginInfo li = new DfLoginInfo(); //this is where the error occurs as when i remove this line. i dont get an error
    Have you checked this as I have mentioned something regarding this in my mail?
    Regards
    Vicky

  • How drive ejb beans from such as COMPANY with..

    I am very new to EJBs but would like to give a try and dooooooooooooo it of course. Now, I understnad how to write jave(ejb interfaces and classes) but makes me small is how define ejb beans from my bosses speach. He says we need to ....... so for example COMPANY(company name, contact, references + more) could be our business objects. HAH!
    So pmy roblem is what should be an ejb bean and what should be ejb bean fields.
    Thanks a lot in advance.
    gapter

    Its really not that difficult really. First - if you decide that your business object is going to be a Bean - Determine if it should be an EJB or just a regular Java Object bean in which case you'll probaly just use a Java Bean. The two are very similar with the exception that JB's are not Distributed but can do most of the grunge work that an EJB is suppose to do.
    Next, determine what business methods or transactions are most likely to be done to your Business Object. This should determines the interface. So far that's all routine.
    If you are decide that an EJB is what your problem demands (after much research into your problem) - then ask if your business object will be persistent (exist for a long time and will need storage (say on a persistent storage media like in a database) Or whether it will just require session scope (or just to be present the duration of a transaction/session - like say a shopping cart). The former requires a Entity Bean, the latter a Session Bean.
    You then create your implementation code in a NameOfClassEJB class. A Container Management class NameOfClassHOME, and of course your Business Method Interface called NameOfClass.
    The BMI (business method Interface class) is trivial. Your EJB class however will contain all the implementation required to get work done depending on the choice of Implementation - that is, whether you wish to handle all transactions (Bean Managed) or if you would rather delegate to the Container to handle Storage Issues (Container Managed). With Container Management - You get a lot for free - like concurrency control, database connectivity is trivial, distributed transaction management is trivial, field updates in your database is totally out of your hands. etc ...
    For a beginner - its better if you take time to study the ejb lifecycle, the J2EE Business Architecture, then the solution that they proposed for application development. This is not trivial and has a steep learning curve.
    Have fun.
    Next determine if you want to handle all of the transactions between the properties (or fields) in the bean or you'd like the Application Server's Container to do this for you. (Most EJB's at least the simple ones are better off being handled by the Container).
    going to be an employee: say with name, address, tel, email: Y

Maybe you are looking for