Lookup Failure EJB JNDI - StatelessSession Bean Example on Unix

Hi,
I am trying to run weblogic 5.1 on Unix. Earlier on, I tried
running the ejb example: "StatelessSession" on Windows NT and succeeded.
However I am unable to do so on unix.
Error message says that the problem is in URL or JNDI name.
I started the Weblogic Server on Unix and then started the Console
on my own Desktop i.e. Windows 2000. Then I was able to connect
to myserver which was running on Unix and could see the EJB deployed
all ok.
Now for running this example as and when I try to run the
java client code (which is a java application / class) I am unable
to do a lookup for the context.
I have verified that the DNS name for the Unix box as well as
port # is correct. Same is true for the JNDI name. My problem appears
to be of class path.
I looked up the log file and found out the problem:
Tue Mar 13 16:41:40 CST 2001:<E> <ServletContext-General> Cannot
find resource 'classes/examples/ejb/basic/statelessSession/TraderBe
anHomeImpl_ServiceStub.class' in document root '/app/weblogic/planit/weblogic/myserver/public_html'
So that means if I place the client files in this directory (i.e.
public_html) it would run. But I am wondering where do I need to
specify that the server should look in "ClientClasses" directory
and not in "public_html" directory.
What else could be wrong......
Sincerely,
Ahmad

Ahmad,
This file gets generated when you run java weblogic.ejbc. This is the last
step in creating the EJB. From the class files, weblogic needs to create the skelton
and the stub so that they are able to communicate back and forth...
Peter
"Ahmad" <[email protected]> wrote:
>
Hi All,
I took a fresh look at the Error as displayed in the log
file on the Unix machine:
It says it Cannot find resource 'classes/examples/ejb/basic/statelessSession/TraderBeanHomeImpl_WLStub.class'
in document root '/app/weblogic/planit/weblogic/myserver/public_html'
Now I looked under public_html directory and did not find the "classes"
directory. What I did was :
1. Created a new "classes" directory under public_html.
2. copy the whole directory structure from "clienclasses" directory
and placed it under the newly created directory.
However to my surprise, could not find TraderBeanHomeImpl_WLStub.class
When I tried to look for the same file on NT machine, (where this
example is running all o.k) I still
could not find it. When is this class generated and what is happening.
"Ahmad" <[email protected]> wrote:
Hello There!!
My class path on unix is set as follows:
planit@itd00n15> . ./setEnv.sh
============= Setting Environment ================
WL_HOME=/app/weblogic/planit/weblogic
JAVA_HOME=/usr/java/jdk122a
CLIENT_CLASSES=/app/weblogic/planit/weblogic/myserver/clientclasses
SERVER_CLASSES=/app/weblogic/planit/weblogic/myserver/serverclasses
SERVLET_CLASSES=/app/weblogic/planit/weblogic/myserver/servletclasses
PATH=/usr/java/jdk122a/bin:/usr/java/jdk122a/bin:/app/weblogic/planit/weblogic/bin:/usr/java/jdk122a/bin:/oracle/product/8.1.6/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/ccs/bin:/usr/openwin/bin
CLASSPATH=/usr/java/jdk122a/lib/tools.jar:/app/weblogic/planit/weblogic/license:/app/weblogic/planit/weblogic/classes:/app/weblogic/planit/weblogic/lib/weblogicaux.jar:/app/weblogic/planit/weblogic/eval/cloudscape/lib/cloudscape.jar:/app/weblogic/planit/weblogic/myserver/clientclasses:/app/weblogic/planit/weblogic/myserver/serverclasses
LD_LIBRARY_PATH=/oracle/product/8.1.6/lib:/app/weblogic/planit/weblogic/lib/solaris:/app/weblogic/planit/weblogic/lib/solaris:/app/weblogic/planit/weblogic/lib/solaris
I have no idea what is going on!!
Ahmad
"Ahmad" <[email protected]> wrote:
By the way, we are using service pack 4. Would that matter
on Unix
for this kind of exception...
I am not sure, where would I define the class path to
the client
stub classes. I mean in which file!!
Sincerely,
Ahmad
"Ahmad" <[email protected]> wrote:
What directory Structure should I be in in order to
run
the
client. On NT I have to be in "ClientClasses" directory.
For
example following example runs fine on Windows NT:
C:\weblogic\myserver\clientclasses>java examples.ejb.basic.statelessSession.Client
Beginning statelessSession.Client...
Creating a trader
Buying 100 shares of BEAS.
Buying 200 shares of MSFT.
Buying 300 shares of AMZN.
Buying 400 shares of HWP.
Selling 100 shares of BEAS.
Selling 200 shares of MSFT.
Selling 300 shares of AMZN.
Selling 400 shares of HWP.
Removing the trader
End statelessSession.Client...
However for unix, I tried different directories, I am
not sure
which one in the hierarchy am I supposed to be, in order
to
run the client.
By the way, I tried putting the ctx.lookup method ina
catch block
and tried to print the stack trace.
Here is the error which I am getting, irrespective of
the directory
hierarchy I am in:
planit@itd00n15> java examples.ejb.basic.statelessSession.Client
Beginning statelessSession.Client...
About to Lookup the JNDI name !!
The client was unable to lookup the EJBHome. Pleasemake
sure
that you have deployed the ejb with the JNDI name statelessSession.TraderHome
on the WebLogic server at t3://planit-dev.intranet.sprintspectrum.com:10400
Printing the Stack Trace :
javax.naming.CommunicationException. Root exceptionis
java.lang.ClassNotFoundException:
class examples.ejb.basic.statelessSession.TraderBeanHomeImpl_ServiceStub
previously not found
at java.lang.Throwable.fillInStackTrace(Native
Method)
at java.lang.Throwable.fillInStackTrace(Compiled
Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.lang.ClassNotFoundException.<init>(Compiled
Code)
at weblogic.rjvm.MsgAbbrev.read(Compiled Code)
at weblogic.socket.JVMAbbrevSocket.readMsgAbbrevs(JVMAbbrevSocket.java:505)
at weblogic.rjvm.MsgAbbrevInputStream.prime(MsgAbbrevInputStream.java:134)
at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:610)
at weblogic.rjvm.ConnectionManagerClient.handleRJVM(ConnectionManagerClient.java:34)
at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:630)
at weblogic.socket.JVMAbbrevSocket.dispatch(Compiled
Code)
at weblogic.socket.JVMSocketT3.dispatch(Compiled
Code)
at weblogic.socket.JavaSocketMuxer.processSockets(Compiled
Code)
at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
at weblogic.kernel.ExecuteThread.run(Compiled
Code)
--------------- nested within: ------------------
weblogic.rmi.UnmarshalException: Unmarshalling return
- with nested exception:
[java.lang.ClassNotFoundException: class examples.ejb.basic.statelessSession.TraderBeanHomeImpl_ServiceStub
previously not found]
at java.lang.Throwable.fillInStackTrace(Native
Method)
at java.lang.Throwable.fillInStackTrace(Compiled
Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.io.IOException.<init>(IOException.java:47)
at weblogic.common.T3Exception.<init>(T3Exception.java:47)
at weblogic.rmi.RemoteException.<init>(RemoteException.java:41)
at weblogic.rmi.UnmarshalException.<init>(UnmarshalException.java:31)
at weblogic.jndi.toolkit.BasicWLContext_WLStub.lookup(BasicWLContext_WLStub.java:256)
at weblogic.jndi.toolkit.WLContextStub.lookup(Compiled
Code)
at javax.naming.InitialContext.lookup(InitialContext.java:349)
at examples.ejb.basic.statelessSession.Client.lookupHome(Client.java:154)
at examples.ejb.basic.statelessSession.Client.<init>(Client.java:44)
at examples.ejb.basic.statelessSession.Client.main(Client.java:86)
Throwing ne !!
NamingException Occured!!. Exception Message:
null
Sincerely,
Ahmad
"Ahmad" <[email protected]> wrote:
Hi all,
I am still unable to find out where do I have to
tell
weblogic tha the stubs for the client classes are in
ClientClasses directory.
Any ideas are welcome.
Sincerely,
Ahmad
"Ahmad" <[email protected]> wrote:
Hi,
I am trying to run weblogic 5.1 on Unix. Earlieron,
I tried
running the ejb example: "StatelessSession" on Windows
NT and succeeded.
However I am unable to do so on unix.
Error message says that the problem is in URL or
JNDI
name.
I started the Weblogic Server on Unix and then started
the Console
on my own Desktop i.e. Windows 2000. Then I was ableto
connect
to myserver which was running on Unix and could see
the
EJB deployed
all ok.
Now for running this example as and when I
try
to run the java client code (which is a java application/
class) I am unable to do a lookup for the context.
I have verified that the DNS name for the Unix boxas
well as port # is correct. Same is true for the JNDIname.
My
problem appears to be of class path.
I looked up the log file and found out the problem:
Tue Mar 13 16:41:40 CST 2001:<E> <ServletContext-General>
Cannot find 'classes/examples/ejb/basic/statelessSession/TraderBe
anHomeImpl_ServiceStub.class' in document
'/app/weblogic/planit/weblogic/myserver/public_html'
So that means if I place the client files in this
directory
(i.e. public_html) it would run. But I am wonderingwhere
do
I need to specify that the server should look in
"ClientClasses" directory and not in "public_html"
directory.
What else could be wrong......
Sincerely,
Ahmad

Similar Messages

  • How to lookup a EJB 3.0 session bean which is deployed in WebLogic 10.3

    Now Jdeveloper 11.1.1, is giving WebLogic server 10.3.
    With internal WebLogic server, when I created a Sample client, it generated code as:
    private static Context getInitialContext() throws NamingException {
        Hashtable env = new Hashtable();
        // WebLogic Server 10.x connection details
        env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" );
        env.put(Context.PROVIDER_URL, "t3://127.0.0.1:7101");
        return new InitialContext( env );
    public static void main(String [] args) {
        try {
            final Context context = getInitialContext();
            DefaultSession defaultSession = (DefaultSession)context.lookup("property-DefaultSession#com.vs.property.model.session.DefaultSession");
        } catch (Exception ex) {
    }How to update the above code to lookup the EJB 3.0 session beans with an external WebLogic server 10.3?
    Is there any documentation available on how to install weblogic, troubleshoot, debug, WebLogic server 10.3?
    regds
    -raju

    Raju,
    Hi, to start, here is a tutorial on a quickstart web application using an EJB 3.0 stateless session bean that fronts a container managed EclipseLink JPA entity manager on WebLogic 10.3, you will find references there to other general WebLogic documentation.
    [http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial]
    using @EJB injection on the client instead of a JNDI lookup as below
    [http://edocs.bea.com/wls/docs103/ejb30/annotations.html#wp1417411]
    1) in your second env.put I noticed that your t3 port is 7101, I usually use the default 7001 - but It looks like this port is valid for the JDeveloper embedded version of WebLogic server runs - just verify that it matches the port of your server.
    2) your name#qualified-name lookup looks ok. Verify that the jndi-name element is set in your weblogic-ejb-jar.xml for non injection clients like the following
    &lt;weblogic-ejb-jar&gt;
    &lt;weblogic-enterprise-bean&gt;
    &lt;ejb-name&gt;ApplicationService&lt;/ejb-name&gt;
    &lt;jndi-name&gt;ApplicationService&lt;/jndi-name&gt;
    3) as a test outside of your application - launch the WebLogic admin console and goto the testing tab of your bean in [Home &gt; Summary of Deployments &gt; "application" &gt; "session bean name"
    thank you
    /michael : http://www.eclipselink.org                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Local session bean lookup in another local session bean in EJB 3.0

    Hi,
    I am doing JNDI lookup of a local session bean in a session bean. ( I do not want to use EJB dependency injection).
    Lookup of local interface from session bean is successful. But, when the calling session bean is a local session in another session bean, the lookup fails.
    Here is an example:
    @Stateless
    @EJBs({@EJB(name="EJB2Local", beanInterface=EJB2Local.class),
    @EJB(name="EJB3Local", beanInterface=EJB3Local.class)})
    public class EJB1 implements EJB1Remote, EJB1Local{
    public void findEJB3Local(){
    //1. JNDI lookup for EJB3Local ----
    //2. EJB3Local.someFunction()
    @Stateless
    @EJB(name="EJB1Local", beanInterface=EJB1Local.class)
    public class EJB2 implements EJB2Remote, EJB2Local{
    public void findEJB1Local(){
    //1. JNDI lookup EJB1Local
    // 2. Call EJB1Local.findEJB1Local method
    //THIS METHOD CALL WILL FAIL.
    public void findEJB1Remote(){
    //1. JNDI lookup EJB1
    / 2. Call EJB1Local.findEJB1 method
    @Stateless
    public class EJB3 implements EJB3Remote, EJB3Local{
    public void someFunction(){}
    This setup was working in EJB 2.1, as we had clear ejb-local-ref definitions in our ejb-jar.xml file.
    I am suspecting that EJB 3.0 has special annotation to use when lookup is made from another local session bean.
    Any comments will be appreciated.
    Thanks,
    Mohan

    From a private component environment perspective, declaring @EJB in a bean class is equivalent
    to using ejb-ref or ejb-local-ref for that same bean in ejb-jar.xml. In each case, the EJB dependency
    is declared for that bean. Each EJB component has its own private component environment, so
    code running within invocations on different EJBs can not see the component environment of the
    components that made the invocations.
    What exact error are you getting? Please post the stack trace if possible.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Client EJB JNDI lookup broken in OC4J 9.0.2?

    I have a client program that connects to an EJB in the application server and invokes methods on it. If it look up the EJB using the actual JNDI binding, it works fine. If I look it up in java:comp/env (and use the ejb-ref in application-client.xml and ejb-ref-mapping in orion-application-client.xml) the client program catches the following exception:
    caught : javax.naming.NameNotFoundException: No object bound for java:comp/env/ejb/logging/Logger
    javax.naming.NameNotFoundException: No object bound for java:comp/env/ejb/logging/Logger
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:116)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at com.mycompany.common.logging.ejb.test.LoggerEJBTest.main(LoggerEJBTest.java:37)
    Now, assuming I don't have any typos (and I'd be thrilled if someone pointed it out if that were the case), then it looks like this is a bug in OC4J 9.0.2: the ejb-ref and ejb-ref-mapping elements do not work. For the record, I am using the same ejb-ref and ejb-ref-mapping elements for a servlet's web.xml and orion-web.xml, respectively, without problems.
    Here are relevant file excerpts:
    LoggerEJBTest.java:
    String hostName = "localhost";
    String hostPort = "23791";
    String userName = "abc";
    String password = "def";
    String providerURL = "ormi://" + hostName + ":" + hostPort + "/ghi";
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
    env.put(Context.PROVIDER_URL, providerURL);
    env.put(Context.SECURITY_PRINCIPAL, userName);
    env.put(Context.SECURITY_CREDENTIALS, password);
    System.out.println("create initial context");
    Context context = new InitialContext(env);
    System.out.println("get home object");
    //works when uncommented
    //Object homeObject = context.lookup("logging/Logger");
    //broken:
    Object homeObject = context.lookup("java:comp/env/ejb/logging/Logger");
    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>
    <description>abc</description>
    <display-name>abc</display-name>
    <enterprise-beans>
    <session>
    <description>Logger Bean</description>
    <display-name>Logger</display-name>
    <ejb-name>Logger</ejb-name>
    <home>com.mycompany.common.logging.ejb.LoggerHome</home>
    <remote>com.mycompany.common.logging.ejb.Logger</remote>
    <ejb-class>com.mycompany.common.logging.ejb.LoggerBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    orion-ejb-jar.xml:
    <?xml version="1.0"?>
    <!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 2.0 runtime//EN" "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd">
    <orion-ejb-jar>
         <enterprise-beans>
              <session-deployment name="Logger" location="logging/Logger">
         </enterprise-beans>
    </orion-ejb-jar>
    application-client.xml:
    <?xml version="1.0"?>
    <!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.3//EN" "http://java.sun.com/dtd/application-client_1_3.dtd">
    <application-client>
         <display-name>logging test</display-name>
    <ejb-ref>
    <ejb-ref-name>ejb/logging/Logger</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.mycompany.common.logging.ejb.LoggerHome</home>
    <remote>com.mycompany.common.logging.ejb.Logger</remote>
    <ejb-link>Logger</ejb-link>
    </ejb-ref>
    </application-client>
    orion-application-client.xml:
    <?xml version="1.0"?>
    <!DOCTYPE orion-application-client PUBLIC "-//Evermind//DTD J2EE Application-client runtime 1.2//EN" "http://xmlns.oracle.com/ias/dtds/orion-application-client.dtd">
    <orion-application-client>
    <ejb-ref-mapping location="logging/Logger" name="ejb/logging/Logger" />
    </orion-application-client>

    As far as I know, the only way to lookup an EJB (deployed to
    OC4J) from a regular java class using the "ApplicationClientInitialContextFactory"
    class and the logical JNDI name is to include your regular java
    class (i.e. the client) in your application's EAR file (the file
    you use to deploy your application to OC4J).OK, but that sounds like a pretty silly constraint. Shouldn't the ApplicationClientInitialContextFactory know how to do the mapping using the application-client.xml and orion-application-client.xml settings? What does the OC4J server provide that makes this magically work?
    From the information you have supplied, it appears that you may
    not want to include your client (java) class in your EAR file.That is correct. It is an integration test program, not meant to be deployed into the application server.
    So now the question is, "Do you want to make your client part
    of your J2EE application, and include it in the application
    EAR file?"
    If you do, then you have made several mistakes which prevent
    you from doing that, but I don't want to explain further, since
    you may not want to do that, anyway!Not applicable. But on that topic, aside from being able to auto-start a client application within the OC4J JVM, are there any other reasons why I might want to deploy a client in that manner? I mean, honestly, these things are called "clients" and "servers" for a reason.
    Now if you have been reading other postings to this forum,
    and if you have read the documentation for OC4J, you would
    know that it requires J2SDK 1.3.1 only (not 1.4.0).I am well aware of the other postings on that topic. I am, however, counting on Oracle to live up to their promise to certify 1.4 with with the next update to OC4J:
    Limits of 10g
    That aside, I already consider OC4J 9.0.2 to be a broken product at this point anyway, so hacking it to use Java 1.4 doesn't bother me that much. OC4J 9.0.2 works about as well with Java 1.4 as with Java 1.3, assuming one replaces the tools.jar. The other major incompatibility is that Oracle SOAP breaks if a web service EJB home&remote interface is compiled with Java 1.4:
    http://forums.oracle.com/forums/message.jsp?id=936894
    Alas, we're using Apache SOAP 2.3 rather than the ass-backwards stuff in OC4J, anyways, so there's no problem.

  • EJB JNDI Lookup String?

    Hi,
    just a short question, I try to lookup an EJB from JNDI. I found some JNDI in the documentation of how to use EJB from JSP.
    Unfortunately the documentation just says:
    try {
      InitialContext ic = new InitialContext();
      HelloWorldBean h= (HelloWorldBean)ic.lookup("java:comp/env/<HelloWorldBean_Lookup_String>");
      out.println(h.sayHello());
    catch...
    I'm pretty sure "<HelloWorldBean_Lookup_String>" is not the correct lookup string
    Which one is it?
    Frank

    What I did now is to add the following into my web.xml:
    <ejb-local-ref>
      <ejb-ref-name>ejb/MyBean</ejb-ref-name>
      <local>package.MyBean</local>
    </ejb-local-ref>
    and the lookup through:
    InitialContext ic = new InitialContext();
    Mybean bean = (MyBean)ic.lookup("java:comp/env/ejb/MyBean");
    Thanx for all your help
    Frank

  • ClassCastException on ejb jndi lookup

    Hello,
    I try to get an standalone remote client to to connect to my stateless session bean:
    java.util.Properties props = new java.util.Properties();
    props.put("java.naming.provider.url", "181.205.12.19:50004");
    props.put("java.naming.factory.initial", "com.sap.engine.services.jndi.InitialContextFactoryImpl" );
    props.put("java.naming.security.authentication", "simple");
    props.put("java.naming.security.principal", "j2ee_admin");
    props.put("java.naming.security.credentials", "*****");
    jndiContext = new InitialContext(props);
    fetching of jndi context is fine, but once I try to lookup my home interface I get a class cast exception:
    home = (ToEdifactConverterHome) PortableRemoteObject.narrow(jndiContext.lookup ("sap.com/EdifactEar/ToEdifactConverterBean"), ToEdifactConverterHome.class);
    java.lang.ClassCastException
         at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
         at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
         at test.cceag.transform.TransformTester.setUp(TransformTester.java:74)
         at test.cceag.transform.TransformTester.main(TransformTester.java:48)
    The jndi lookup seems to return the bean implementation object, but not the home interface itself.
    Thanks for any hints
    Matthias

    Hi Matthias,
    i think the   guide
    "How to...EJB: Accessing EJB Applications Using JNDI"
    will help you to solve the ejb lookup problem:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0736159e-0301-0010-9ea4-c63d83d0797b
    good luck, Katharina

  • EJB JNDI lookup port

    Hi,
    If my AS Java's port is 50000, then the ejb port is 50004. Is it possible to change the default EJB JNDI lookup port to eg, 55555?
    Thanks.
    Any help will be highly appreciated.
    - julius

    hi,
    in addition to above context
    this may be help full to u
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/a2/f9d7fed2adc340ab462ae159d19509/content.htm
    bvr

  • Remote and local interface on same ejb 3.0 bean instance

    Hi,
    Is it posible to get remote and local interface on same ejb 3.0 bean instance.
    For example get local interface of a bean and than pass it as remote to client.
    Both interfaces must operate on same bean instance.
    Thanks
    Zlaja

    yes. You can implement multiple interfaces on a single class, so you can add a local and a remote interface. One trick to avoid duplicate code is to simply make the remote interface extend the local interface; then you only have to add the @Remote annotation and you're done.
    For example get local interface of a bean and than pass it as remote to client.You don't pass an instances to a client, a client looks up a remote instance of the bean through JNDI.

  • Weblogic Ejb JNDI Naming

    Dear all,
    when I use Stateless Session bean with mappedName properties, it JNDI name become like mappName+#+packagename+classname.
    I don't want "#" notation between them.
    if it is not possible, how can i know default JNDI name without using mappedName property?
    With Regards,
    Wai Phyo

    Make use of the weblogic-ejb-jar.xml file to control the EJB JNDI name. The following example works in WebLogic 11g and replaces the default #<package><class> with the specified values.
    Regards
    Neil
    <weblogic-enterprise-bean>
    <ejb-name>DepartmentEJB</ejb-name>
    <stateless-session-descriptor>
    <business-interface-jndi-name-map>
    <business-remote>com.sopragroup.uk.whitepaper.hr.jee.ejb.department.DepartmentRemote</business-remote>
    <jndi-name>ejb/HR/DepartmentEJB</jndi-name>
    </business-interface-jndi-name-map>
    </stateless-session-descriptor>
    <enable-call-by-reference>true</enable-call-by-reference>
    <jndi-name>ejb/HR/DepartmentEJB</jndi-name>
    <local-jndi-name>ejb/HR/DepartmentEJBLocal</local-jndi-name>
    </weblogic-enterprise-bean>

  • Problem  while developing statelesssession bean

    Hi All,
    I am learning Ejb,i developed a simple hello world application using statelesssession bean in weblogic server8.1.And i packed it in a jar file named slb.jar.
    Then i am trying to create stub and skeleton using following command,but i am getting this error.can anybody please help me.
    C:\nkmb\ejb\HelloEjb>java weblogic.ejbc slb.jar
    <Jun 22, 2006 9:55:35 AM EDT> <Warning> <EJB> <BEA-010212> <The EJB 'HelloBean(J
    ar: slb.jar)' contains at least one method without an explicit transaction attri
    bute setting. The default transaction attribute of Supports will be used for the
    following methods: remote[hello()] >
    C:\nkmb\ejb\HelloEjb\ejbcgen\examples\HelloBean_gbyfgg_Impl.java:11: cannot a
    ccess java.io.Serializable
    bad class file: C:\Program Files\Java\jre1.5.0_06\lib\rt.jar(java/io/Serializabl
    e.class)
    class file has wrong version 49.0, should be 48.0
    Please remove or make sure it appears in the correct subdirectory of the classpa
    th.
    public final class HelloBean_gbyfgg_Impl
    ^
    1 error
    Exec failed .. exiting
    can anybody help me to getting out of this problem.
    thanks inadvance,
    nkmb

    http://support.bea.com/application?namespace=askbea&origin=ask_bea_answer.jsp&event=link.view_answer_page_solution&answerpage=solution&page=wlw/S-28139.htm

  • EJB 3.0 Bean name

    Is there a way that we can override the EJB 3.0 Bean name in the deployment descriptor? I know we can provide the name in the Annotation via @MessageDriven(name="bar").
    For example, if I have the following Bean,
    package com.example;
    @MessageDriven
    public class Foo implements MessageListener {
    When deployed, it always deploys as Foo, even if I have the following in my ejb-jar.xml and weblogic-ejb-jar.xml:
    <mesage-driven>
    <ejb-name>Bar</ejb-name>
    <ejb-class>com.example.Foo</ejb-class>
    <destination-type>javax.jms.Topic</destination-type>
    <subscription-durablility>Durable</subscription-durablity>
    </message-driven>
    <mesage-driven>
    <ejb-name>Baz<r</ejb-name>
    <ejb-class>com.example.Foo</ejb-class>
    <destination-type>javax.jms.Queue</destination-type>
    </message-driven>
    There seems no way I can re-use the Same bean class with EJB 3.0 if I needed to. If there is anyway, the ejb-name can be used please let me know.
    Thanks

    Hi,
    For a JEE5 EJB module, rather than using EJBGen, you can use WLS specific annotations for configuring common settings. If you follow the link below, you can see a list of supported EJB annotations. Disregard the fact that the documentation section title is WebLogic Kodo Annotations. That is incorrect and I've filed a bug for it.
    http://edocs.bea.com/wls/docs103/ejb30/annotations.html#wp1438036.
    Unfortunately, we don't yet support setting all weblogic-ejb-jar.xml configuration values via annoations so in some cases a weblogic-ejb-jar.xml is still required.
    You can hand edit your weblogic-ejb-jar.xml and the example you posted below should work fine.
    - Matt

  • How to lookup an EJB from JSP on a Remote Server in JES2005Q4

    Hi,
    I am having two different domain (domain1,domain2) respectvely. My ABC.ear j2eee application is deployed on domain2 and its iiop port is 33703.In domain1 i have xyz.war (web application) and it's IIOP port is 3700 .In xyz.war i am having CallEJB.jsp file.In this Jsp file i want to lookup an EJB Service called PaymentEJB(JNDI Name is ejb/PaymentEJB).
    The code is below
    InitialContext context=new InitialContext();
    Object objRef=context.lookup("corbaname:iiop:andaman:33703#ejb/PaymentEJB");
    I am getting the following error.
    [#|2005-12-14T16:42:03.422+0530|SEVERE|sun-appserver-pe8.1_02|javax.enterprise.resource.corba._DEFAULT_.rpc.transport|_ThreadID=11;|"IOP00410216: (COMM_FAILURE) Unable to create IIOP listener on the specified host/port: all interfaces/3700"
    org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 216 completed: No
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.createListenerFailed(ORBUtilSystemException.java:2661)
    My doubt is
    1.While starting domain1 and domain2 iiop listeners are started on the port 3700 and 33703.in that case why EJB lookup tries to create listener on one more time.
    2.I am looking the 33703 port only.but it tries to create port on 3700 why?
    3.It was working till JES2005Q1.Is there any patch i need to install? or i need to change anything in my code.
    I am frustrated with this error for past one week.I will be happy if some body will give me the peace of mind(thru some solution).

    Hi,
    I am having two different domain (domain1,domain2) respectvely. My ABC.ear j2eee application is deployed on domain2 and its iiop port is 33703.In domain1 i have xyz.war (web application) and it's IIOP port is 3700 .In xyz.war i am having CallEJB.jsp file.In this Jsp file i want to lookup an EJB Service called PaymentEJB(JNDI Name is ejb/PaymentEJB).
    The code is below
    InitialContext context=new InitialContext();
    Object objRef=context.lookup("corbaname:iiop:andaman:33703#ejb/PaymentEJB");
    I am getting the following error.
    [#|2005-12-14T16:42:03.422+0530|SEVERE|sun-appserver-pe8.1_02|javax.enterprise.resource.corba._DEFAULT_.rpc.transport|_ThreadID=11;|"IOP00410216: (COMM_FAILURE) Unable to create IIOP listener on the specified host/port: all interfaces/3700"
    org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 216 completed: No
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.createListenerFailed(ORBUtilSystemException.java:2661)
    My doubt is
    1.While starting domain1 and domain2 iiop listeners are started on the port 3700 and 33703.in that case why EJB lookup tries to create listener on one more time.
    2.I am looking the 33703 port only.but it tries to create port on 3700 why?
    3.It was working till JES2005Q1.Is there any patch i need to install? or i need to change anything in my code.
    I am frustrated with this error for past one week.I will be happy if some body will give me the peace of mind(thru some solution).

  • Problem in running entity bean examples

    I am trying to run a entity bean example in my bea ,earlier i was getting the error
    that the data source name could not be found ,and so i replaced the data source
    name in my .xml file
    as cgDataSource and now i am not finding that error ,and the
    jsp page is also displayed ,but the data is not inserted into
    my database table.
    I tried it using my personal domain ,and i edited the weblogic.properties file
    also ,but now i am getting the error that the data source name could not be found

    Hi,
    An error saying a data source can't be found indicates one of two problems:
    1. The data source name in your cmp descriptor doesn't match the JNDI name of
    the actual data source. To rule this out, verify the names are indeed the same.
    2. The data source didn't deploy. Usually this is caused by the underlying connection
    pool not deploying. Look in you server log to verify the data source and the
    underlying connection pool both deployed properly.
    - Matt
    "Vipin Nair" <[email protected]> wrote:
    >
    I am trying to run a entity bean example in my bea ,earlier i was getting
    the error
    that the data source name could not be found ,and so i replaced the data
    source
    name in my .xml file
    as cgDataSource and now i am not finding that error ,and the
    jsp page is also displayed ,but the data is not inserted into
    my database table.
    I tried it using my personal domain ,and i edited the weblogic.properties
    file
    also ,but now i am getting the error that the data source name could
    not be found

  • A prefix can be included in the EJB JNDI name dynamically?

    In the Stateless annotation, we can specify the mappedName attribute to the EJB JNDI name bind.
    Can we specify a prefix to the mappedName separately?
    For example: We have this:
    @Stateless(mappedName="myEJB")And don't want to do this:
    @Stateless(mappedName="prefix/myEJB")We want to include the prefix in another place in the code dynamically.
    Can we do that??

    jtahlborn wrote:
    eudesf wrote:
    Hello! Thanks for reply!
    As I can't configure programatically, there is any way to configure in an application descriptor, or in another place of the application server?
    The idea is to publish two applications that use the same EJB classes, but in different JNDI namespaces, because we don't want to share the resources. Otherwise, it will result in JNDI name conflicts. The applications works in different contexts and we want to reuse the existing EJB definitions.
    Any suggestion?yes you can do this. ejb 3.0 keeps the features from 2.1, namely all the xml based configuration (although it is now optional). and, the annotations are always overriden by the xml configuration. thus, you can create different deployments with different the same compiled class files. you just need to override the annotation configuration with xml configuration (via ejb-jar.xml or whatever).Yes, we can do that. I've tested here, and it works. But, can we do better?
    The configuration via XML implies maintenance, and it's not good, because we have so many EJBs to maintain.
    And there is another problem... The EJB classes are in JARs, and these JARs are shared across the applications.
    Pretend that you have to maintain two versions of each EJB JAR. One with XML configured and other without. If we change one, the another must be changed too. How can it be productive?
    I have seen some EJB implementations that are more flexible with JNDI naming.
    See:
    - [http://openejb.apache.org/jndi-names.html|http://openejb.apache.org/jndi-names.html]
    - [http://fixunix.com/weblogic/221782-dynamic-jndi-name-weblogic-ejb-jar-xml.html|http://fixunix.com/weblogic/221782-dynamic-jndi-name-weblogic-ejb-jar-xml.html]
    Does it have a better solution in Glassfish?

  • Message driven bean example is not working

    Hi,
    i tried message driven bean example on J2ee 6.20. I am able to make connection factory, but when i tried to deploy ear file a get an exception:
    Error occurred
    com.inqmy.services.deploy.container.DeploymentException: java.lang.NullPointerEx
    ception
            at com.inqmy.services.ejb20.EJBAdmin.commitDeploy(EJBAdmin.java:604)
            at com.inqmy.services.deploy.server.DeployServiceImpl.commit(DeployServi
    ceImpl.java:2897)
            at com.inqmy.services.deploy.server.DeployServiceImpl.deploy1(DeployServ
    iceImpl.java:524)
            at com.inqmy.services.deploy.server.DeployServiceImpl.deploy(DeployServi
    ceImpl.java:139)
            at com.inqmy.services.deploy.command.DeployCommand.exec(DeployCommand.ja
    va:142)
            at com.inqmy.services.shell.processor.environment.CommandBase.exec(Comma
    ndBase.java:124)
            at com.inqmy.services.shell.processor.Interpreter.applyLineCommand(Inter
    preter.java:391)
            at com.inqmy.services.shell.processor.Interpreter.apply(Interpreter.java
    :150)
            at com.inqmy.services.shell.processor.Shell.work(Shell.java:150)
            at com.inqmy.services.shell.processor.managers.ScriptProcessThread.run(S
    criptProcessThread.java:128)
    in visual administrator I can see the right queue and for few seconds this queue have one consumer.
    thank
    JJ

    Hi,
    but this example was in guide to this version.
    Ok, in case it is not possible to use MDB, how should i handle long time consumpting functions in EP enviroment?
    (customer has only EP6SP2 and he need to send a lot of mails after user request and i dont want to leave user waiting till that function ends. - should i start new thread in portal?)
    JJ

Maybe you are looking for

  • How to stop messages in console

    Hello, I recently installed NAS Navigator 2 software for a Buffalo network drive I had. I then uninstalled the software, removed all associated files, and rebooted. Now my system.log in Console is being flooded with these messages: 2/13/11 3:16:56 PM

  • How to stop logitech mouse wheel from jumping to dashboard

    When working with a logitech (Mxxx) mouse, and I press the wheel, it takes me to the dashboard.    How can I stop it from doing this?   I called Logitech and they told me the issue is not their mouse since it doesn't happen in my windows version I ha

  • Macbook pro out of memory!

    bought a MacBook Pro 13 inch in november 2011 and it is now telling me my start up disk is full, so is there any way i can either free a lot of space or upgrade the memory capacity?

  • Photoshop Starter Edition 3.0 - Photo Downloader causes computer to restart

    I upgraded my computer running Windows XP from Adobe Photoshop Starter Edition 2.0 to 3.0. This put an icon, the Photo Downloader, on my task bar. When I turned my lap-top on it would load the desk top with no problems, but when loading the icons on

  • Exposure bias EXIF search

    Hello yet again, Using latest Aperture on G4 PB, I have my 5D set to 1/3 stop exposure bias but I am having trouble performing searches for images at specific levels of exposure. When I filter based on 'Exif + exposure bias + greater than/less than/i