Error in InitialContext lookingup

IDE: Netbeans 8.0.
Server ejb:
"@Stateless
public class ejb implements ejbRemote{
    public String say(){
    return "hello";
}"                                    //Server ejb is located in the host: 192.168.0.2 , project ER/ejb-ejb/beans/
Interface ejbRemote:
"@Remote
public interface  ejbRemote{
public String say();
}"                                      // Interface ejbRemote is located in the eLibary.jar file in package sessionLibary , both included in Server project ER and Web project.
Web jsp useBean:                                // located on another host: 192.168.0.3
"public class ws{
     ejbRemote eb= lookupejbRemote();
     private ejbRemote lookupejbRemote(){
       try{
           Properties p = new Proterties();
            p.setProperty(Context.PROVIDER_URL,"t3://192.168.0.2:7676");
           Context c=new InitialContext(p);
           //return (ejbRemote)c.lookup("java:global/ER/ejb-ejb/ejb!s.ejbRemote")     //  ERROR: Root Exception: ER not found.
           //return ((ejbRemote)c.lookup(ejbRemote.class.getName());    //ERROR: Root Exception:  sessionLibary.ejbRemote not found.
        }catch (NamingException ne){}
     public String wsay(){
      return eb.say();
When I run the Web project on the Server host, it's OK. But when I run it on another host it returns error. I can access 192.168.0.2:7676 in browser(returns some context string), so it may not be caused by firewall.
I think the problem is the initalContext is not generated from 192.168.0.2:7676 but from local JVM, because when when running it in the Server I change the ip address to random number it also is OK.
I am a newbie in java EE. It is really hard for me to solve by myself. Please help!

I have no idea what you are doing, but the code you posted doesn't even compile. You help nobody by posting code that "looks like" what you have, if you want help post the exact code you're using. The only thing you should mask is sensitive information such as a username/password and a global IP address.
Also consider this: why do you think it is important to mention the IDE you're using (it really is not) yet you completely hide which JEE container you're using.
Your JEE container should have a management interface which can tell you under which JNDI names your EJBs are deployed; use that information to know what the proper lookup name is to use in your client code.

Similar Messages

  • DBCP Connections not recycling or closing.

    I have implement DBCP using Jakarta-Commons. My connection resource seems to work fine and I am explicitly closing all connections I create. JSTL SQL tags are also using the JNDI resource. However my connection are not being closed or reused. When I allow JSE to crawl the site it quickly taps out the connection pool and Tomcat returns this error:
    "javax.servlet.ServletException: Unable to get connection, DataSource invalid: "org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted, cause: Timeout waiting for idle object"
    Oracle 8i and 9i
    commons-dbcp-1.1.jar
    commons-pool-1.1.jar
    Can anyone help with this?
    Thanks
    JP Steffen

    Ok here is what I am doing.....
    Server.xml
    <Resource name="jdbc/siteoracle" auth="Container" scope="Shareable" type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/siteoracle">
    <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <parameter>
    <name>username</name>
    <value>myuser</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>mypword</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:oracle:oci:@MYODB</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>oracle.jdbc.driver.OracleDriver</value>
    </parameter>
    <parameter>
    <name>maxWait</name>
    <value>10000</value>
    </parameter>
    <parameter>
    <name>maxActive</name>
    <value>100</value>
    </parameter>
    <parameter>
    <name>removeAbandoned</name>
    <value>true</value>
    </parameter>
    <parameter>
    <name>maxIdle</name>
    <value>20</value>
    </parameter>
    </ResourceParams>
    web.xml
    <!-- Reference to JNDI Datasource -->
    <resource-ref>
         <description>Oracle Datasource</description>
         <res-ref-name>jdbc/siteoracle</res-ref-name>
         <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    <!-- JSTL Datasource -->
    <context-param>
         <param-name>javax.servlet.jsp.jstl.sql.dataSource</param-name>
         <param-value>jdbc/siteoracle</param-value>
    </context-param>
    Example Code:
    (JSP Code)
    <!--- Get the Main Info Content --->
    <sql:query var="MyInfo" sql="SELECT myinfo.title FROM myuser.infolocal WHERE myinfoid = ?" >
         <sql:param value="${DefaultmyinfoID}" />
    </sql:query>
    (Servlet Code)
    package Text;
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.sql.*;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    // import Database.*;
    public class LineText extends HttpServlet {
    Connection conn;
    DataSource pool;
    public void doGet(
    HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException {
    PrintWriter out = response.getWriter();
    Clob linetext = null;
    Connection conn=null;
    Statement statement = null;
    ResultSet rs = null;
    String sql =
    "select column_data " +
    "from myuser.data_table " +
    "where dataid = " +
    request.getParameter("DataID") +
    " and languageid = '" +
    request.getParameter("LangID") + "'";
    try {
    Context env = new InitialContext();
    pool = (DataSource)env.lookup("java:comp/env/jdbc/siteoracle");
    } catch (NamingException e) {
    System.out.println("Error: No InitialContext " + e.getMessage());
    try {
    // conn=DataBaseConnection.getConnection();
    conn = pool.getConnection();
    statement = conn.createStatement();
    rs = statement.executeQuery(sql);
    if (rs.next()) {
    linetext = rs.getClob(1);
    else {
    return;
    response.setContentType("text/html");
    Reader in = linetext.getCharacterStream();
    int length = (int)linetext.length();
    char[] buffer = new char[1024];
    while ((length = in.read(buffer)) != -1) {
    out.write(buffer, 0, length);
    in.close();
    in = null;
    out.flush();
    catch (SQLException e) {
    System.out.println(
    "linetext.doGet() SQLException: " +
    e.getMessage() + "executing ");
    System.out.println(sql);
    finally {
    if (rs != null)
    try { rs.close(); } catch (SQLException ignore) { }
    if (statement != null)
    try { statement.close(); } catch (SQLException ignore) { }
    if (conn != null)
    try { conn.close(); } catch (SQLException ignore) { }

  • Anyone successfully set up connection pool in s1as with ms sql server 2000?

    As subject. Since I have seen a lot of posts about the NoSuchMethodException issue with various dbms providers, and the only "official information" I found thru different forums, google, different sun/javasoft sites and forums are this:
    http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=fsunone%2F8172&zone_32=NoSuchMethodException&wholewords=on
    Which is wonderfully vague and provide not-so-much useful information...
    As for the information and suggestion posted by other forum members, most or all of them have experience with setting up Oracle, DB2, mySQL, etc., not aimed for MS SQL Server 2000 (you may think, I am just asking for it running MS SQL server with Java... oh well, not my choice)
    I still haven't seen any positive feedbacks on how this exception was caused and how to resolve it. I have literally exhausted all leads on how to fix this issue, so right now I'm only interested to know whether anyone in the forum actually have a successful connection pool set up with MS SQL server 2000.
    My platform:
    w2k sp3
    SunOne app server, update1, JDK 1.4.1
    latest MS SQL 2000 JDBC driver
    This fails with the NoSuchMethodException error:
    try {
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup("test_db");
    con = ds.getConnection();
    System.out.println( "con is created -> " + con );
    } catch (Exception ex) {
    System.out.println( "failed -> " + ex.getMessage() );
    This works just fine:
    try {
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    con = DriverManager.getConnection("jdbc:microsoft:sqlserver://xxx.xxx.xxx.xxx:1433;DatabaseName=testdb;SelectMethod=cursor", "username", "password");
    System.out.println( "con is created -> " + con );
    } catch (Exception ex) {
    System.out.println( "failed is fucked -> " + ex.getMessage() );
    thanks,
    --kuan

    Hi,
    Thanks for pointing out that article, I did not find it previously. After following the directions in the artile and your advise, now dbping seems to be able to connect to SQL server.
    Thank you very much.
    --kuan                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Webdynpro to oracle db

    hi experts,
    created one webdynpro application which connect to Oracle database, directly without webservices and ejbs.
    my code is as follows:
    Connection con = null;
        Statement stmt = null;
        DataSource ds=null;
        ResultSet rs=null;
        try
         InitialContext x = new InitialContext();
         ds = (DataSource)x.lookup("jdbc/datadb");
             con = ds.getConnection();
            stmt = con.createStatement();
          rs = stmt.executeQuery("INSERT INTO APPLICANTDTLS1(APPLICANTID,APPFIRSTNAME,APPMIDDLENAME) VALUES ('1234','SSS','YYY') ");
        catch(Exception e)
    since there was no error , but when i see the database no record was inserted
    so how can i find out where i want wrong.
    could anyone help me on this issue

    Hi Vijay,
    Lets try to print messages from Catch block. Might be the connection threw some error.
    try
    InitialContext x = new InitialContext();
    ds = (DataSource)x.lookup("jdbc/datadb");
    con = ds.getConnection();
    stmt = con.createStatement();
    rs = stmt.executeQuery("INSERT INTO APPLICANTDTLS1(APPLICANTID,APPFIRSTNAME,APPMIDDLENAME) VALUES ('1234','SSS','YYY') ");
    catch(Exception e)
    wdComponentAPI.getMessageManager().reportException("INSIDE CATCH", true);
    Regards,
    Rekha Malavathu

  • DriverClassName problem

    This question has been on here a thousand times, but never with the same critical point.
    I have the datasource setup as defined in the tomcat documentation.
    My applications web.xml includes the following:
    <resource-ref>
    <description>My datasource</description>
    <res-ref-name>jdbc/myds</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    The global resource seems to be setup properly becuase in the admin tool, I can go to the Tomcat Server/Resources/Datasource and see the data source with all the proper settings.
    When I go to the Tomcat Server/localhost/mycontext/resource/datasource I get this error:
    org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName'
    In my code I have the following:
    InitialContext initialContext = new InitialContext();
    myLogger.error(className, "InitialContext created");
    DataSource datasource = (DataSource)initialContext.lookup(CONNECTION_NAME);
    if(datasource!=null){
    myLogger.debug("DataSource description found");
    conn = datasource.getConnection();
    myLogger.debug("Got Connection");
    }else{
    myLogger.error("Datasource is null");
    In my logs I can see "DataSource description found".
    However, after that I get a SQLException:
    Cannot load JDBC driver class 'null'
    I've renamed the .zip to a .jar and put it in the common/lib.
    1) Why can the admin tool see the global datasource with all the right properties?
    2) Why can the application find the JNDI resource?
    3) Why is the driverClassName null when the datasource is found?
    Thanks in advance.
    DaShaun

    Let me expand on the situation since I have found a workaround.
    I was trying to setup the datasource GLOBABLLY in tomcat. I put the resource information in the GLOBAL section of the server.xml. This is why it was showing up in the server section. It also shows up when using the manager application like so:
    http://localhost/manager/resources
    returns:
    OK - Listed global resources of all types
    jdbc/myds:org.apache.commons.dbcp.BasicDataSource
    UserDatabase:org.apache.catalina.users.MemoryUserDatabase
    simpleValue:java.lang.Integer
    As an experiment, I setup a conext in the server.xml file. I added the resource information to the context and it worked.
    Which brings up a new question.
    1) Why can Tomcat find the driverClassName in the context but not when its setup globally?
    The reason I want to have the datasource setup globally is because we have lots of applications using the same datasource. Copying information and creating contexts for all the applications is sloppy. Also, our deployment process uses the catalina-ant package to remove and install the applications during development. Having the context setup like this will require a restart of Tomcat after changing the war file.
    Thanks in advance.
    DaShaun

  • JNDI InitialContext Error

    Hello Experts,
    I have a little problem with my Java programm:
    Test remote = null;
    *               try {*
    //                  Create a new intial context, which loads from jndi.properties file.
    *               Context ctx = new InitialContext();*
    *               System.out.println("Context:" + ctx);*
    //                  Look up the home interface using the JNDI name.
    //                  This JNDI lookup returns a reference to an EJBHome instance.
    *               TestHome home = (TestHome) ctx.lookup("sap.com/TestWorldEar/TestBean");*
    *               System.out.println("TestHome:" + home);*
    //                  Create a session object.
    *               remote = home.create();*
    *               System.out.println("Remote:" + remote);*
    //                  Invoke the remote EJB methods, test and debug.
    *               System.out.println("Result:" + remote.getWert());*
    *               }  catch  (Exception e) {*
    *               System.out.println("Exception: " + e.getLocalizedMessage());*
    I always get the following error and I don't know how to solve the problem.
    Exception: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
    I hope anybody of you can help me solving this problem.
    Additional information:
    The Java program is running on a XI (Netweaver 7.0).
    I want to get information from a deployed EJB. The Bean still works.
    Thank you for your answers in advance!!!
    Greetings, Alexander

    Hi,
    this Exception is thrown after this result: Context:javax.naming.InitialContext@cdfc9c and before the lookup.
    The complete Stack Trace is:
    Exception thrown [Mon Aug 11 10:48:10,187]:Exception thrown by application running in JCo Server
    com.sap.engine.services.rfcengine.RFCException: Bean ZEJB_TEST_ZUGRIFF not found
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:123)
         at com.sap.engine.services.rfcengine.RFCJCOServer.handleRequest(RFCJCOServer.java:156)
         at com.sap.mw.jco.JCO$Server.dispatchRequest(JCO.java:7701)
         at com.sap.mw.jco.MiddlewareJRfc$Server.dispatchRequest(MiddlewareJRfc.java:2376)
         at com.sap.mw.jco.MiddlewareJRfc$Server.listen(MiddlewareJRfc.java:1700)
         at com.sap.mw.jco.JCO$Server.listen(JCO.java:8061)
         at com.sap.mw.jco.JCO$Server.work(JCO.java:8181)
         at com.sap.mw.jco.JCO$Server.loop(JCO.java:8128)
         at com.sap.mw.jco.JCO$Server.run(JCO.java:8044)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of ZEJB_TEST_ZUGRIFF.
         at com.sap.engine.services.jndi.implserver.ServerContextImpl.lookup(ServerContextImpl.java:649)
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:344)
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:639)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:115)
         ... 12 more

  • Error 906 when getting InitialContext (but only for some users)

    I currently have an application where I'm attempting SSO. I'm obtaining the user's credentials using JAAS and then querying ADS with JNDI. All of our Java code is hosted through WebLogic 8.1. If I run the WebLogic process as a certain user, I can successfully authenticate and query ADS. However, if I run WebLogic as another ADS user, I get "Identifier doesn't match expected value (906)". This error occurs at the point that I attempt to obtain InitialContext (which means the intial authentication works). Anyway, these ADS users are in the exact same ADS group, and as far as I can tell, they have the same permissions. Is there something I'm missing? Thanks...
    Also, I have debug=true in my jaas.conf, but it only spits out basic debug information. Is there some way I can get full debugging?
    Terence

    I should probably let you know that I'm using WebLogic's JRockit 1.4.2_05

  • While creating InitialContext I have got error that server was not found...

    Hello.
    On the server console I'v seen next message:
    java.util.EmptyStackException
         at weblogic.utils.collections.Stack.pop(Stack.java:72)
         at weblogic.rjvm.InboundMsgAbbrev.getAbbrev(InboundMsgAbbrev.java:85)
         at weblogic.rjvm.MsgAbbrevInputStream.readImmutable(MsgAbbrevInputStream.java:172)
         at weblogic.rjvm.MsgAbbrevInputStream.readClassDescriptor(MsgAbbrevInputStream.java:186)
         at weblogic.common.internal.ChunkedObjectInputStream$NestedObjectInputStream.readClassDescriptor(ChunkedObjectInputStream.java:290)
         at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:906)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
         at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1186)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
         at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:107)
         at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:115)
         at weblogic.rjvm.ConnectionManager.readPeerInfo(ConnectionManager.java:685)
         at weblogic.rjvm.ConnectionManagerServer.handleIdentifyRequest(ConnectionManagerServer.java:255)
         at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:619)
         at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:454)
         at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:638)
         at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    I use correct version of weblogic.jar,
    the property for initial context:
    java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
    java.naming.provider.url=t3://127.0.0.1:7001
    The server is Veblogic 6.1
    The client is runing under Visual Age 3.5 EE

    "Yuriy Kuzmenko" <[email protected]> wrote:
    >
    The nested exception on the client side was:
    java.io.StreamCorruptedException: Type code out of range, is 0
         java.lang.Throwable(java.lang.String)
         java.lang.Exception(java.lang.String)
         java.io.IOException(java.lang.String)
         java.io.ObjectStreamException(java.lang.String)
         java.io.StreamCorruptedException(java.lang.String)
         byte java.io.ObjectInputStream.peekCode()
         void java.io.ObjectInputStream.SkipToEndOfBlockData()
         java.io.ObjectStreamClass java.io.ObjectInputStream.inputClassDescriptor()
         java.lang.Object java.io.ObjectInputStream.readObject(boolean)
         java.lang.Object java.io.ObjectInputStream.readObject()
         int java.io.ObjectInputStream.inputObject(boolean)
         java.lang.Object java.io.ObjectInputStream.readObject(boolean)
         java.lang.Object java.io.ObjectInputStream.readObject()
         java.lang.Object weblogic.common.internal.ChunkedObjectInputStream.readObject()
         java.lang.Object weblogic.common.internal.ChunkedObjectInputStream.readObject(java.lang.Class)
         weblogic.common.internal.PeerInfo weblogic.rjvm.ConnectionManager.readPeerInfo(weblogic.rjvm.MsgAbbrevInputStream)
         void weblogic.rjvm.ConnectionManagerClient.handleIdentifyResponse(weblogic.rjvm.MsgAbbrevJVMConnection,
    weblogic.rjvm.MsgAbbrevInputStream)
         void weblogic.rjvm.ConnectionManager.dispatch(weblogic.rjvm.MsgAbbrevJVMConnection,
    weblogic.utils.io.ChunkedDataInputStream)
         void weblogic.rjvm.t3.T3JVMConnection.dispatch()
         boolean weblogic.socket.JavaSocketMuxer.processSockets2()
         void weblogic.socket.JavaSocketMuxer.processSockets()
         void weblogic.socket.SocketReaderRequest.execute(weblogic.kernel.ExecuteThread)
         void weblogic.kernel.ExecuteThread.execute(weblogic.kernel.ExecuteRequest)
         void weblogic.kernel.ExecuteThread.run()
    --------------- nested within: ------------------
    weblogic.utils.AssertionError: ***** ASSERTION FAILED ***** - with nested
    exception:
    [java.io.StreamCorruptedException: Type code out of range, is 0]
         java.lang.Throwable(java.lang.String)
         java.lang.Error(java.lang.String)
         weblogic.utils.NestedError(java.lang.String, java.lang.Throwable)
         weblogic.utils.AssertionError(java.lang.Throwable)
         weblogic.common.internal.PeerInfo weblogic.rjvm.ConnectionManager.readPeerInfo(weblogic.rjvm.MsgAbbrevInputStream)
         void weblogic.rjvm.ConnectionManagerClient.handleIdentifyResponse(weblogic.rjvm.MsgAbbrevJVMConnection,
    weblogic.rjvm.MsgAbbrevInputStream)
         void weblogic.rjvm.ConnectionManager.dispatch(weblogic.rjvm.MsgAbbrevJVMConnection,
    weblogic.utils.io.ChunkedDataInputStream)
         void weblogic.rjvm.t3.T3JVMConnection.dispatch()
         boolean weblogic.socket.JavaSocketMuxer.processSockets2()
         void weblogic.socket.JavaSocketMuxer.processSockets()
         void weblogic.socket.SocketReaderRequest.execute(weblogic.kernel.ExecuteThread)
         void weblogic.kernel.ExecuteThread.execute(weblogic.kernel.ExecuteRequest)
         void weblogic.kernel.ExecuteThread.run()

  • Create InitialContext error under jre1.5

    I have a JMS client application need to run under the jre1.5 environment. I put the wljmsclient.jar and wlclient.jar into my application's . but throw java.lang.NoClassDefFoundError: com/sun/corba/se/connection/ORBSocketFactory on create InitialContext. How I can do?
    Hashtable props = new Hashtable();
    props.put(InitialContext.INITIAL_CONTEXT_FACTORY, getInitContextFactoryName());
    props.put(InitialContext.PROVIDER_URL, getProviderURL());
    InitialContext initialContext = new InitialContext(props); //here throw a NoClassDefFoundError

    z l <[email protected]> writes:
    Its not supported under 8.1. You need to use the 9.0 client which you can get by downloading the 9.0 beta.
    andy
    I have a JMS client application need to run under the jre1.5 environment. I put the wljmsclient.jar and wlclient.jar into my application's . but throw java.lang.NoClassDefFoundError: com/sun/corba/se/connection/ORBSocketFactory on create InitialContext. How I can do?
    Hashtable props = new Hashtable();
    props.put(InitialContext.INITIAL_CONTEXT_FACTORY, getInitContextFactoryName());
    props.put(InitialContext.PROVIDER_URL, getProviderURL());
    InitialContext initialContext = new InitialContext(props); //here throw a NoClassDefFoundError--

  • Error While Deploying A Web Dynpro Appln thru NWDS

    HI,
    I am getting an error while deploying a Web Dynpro Application through NWDS.Following is the Exception
    Aborted: development component '<ComponentName>'/'local'/'LOKAL'/'0.2006.07.26.15.06.05':Caught exception while checking the login credentials for SAP J2EE Engine. Check whether the SAP J2EE Engine is up and running.com.sap.engine.deploy.manager.DeployManagerException: ERROR: Cannot connect to Host: [sapsbx28] with user name: [J2EE_ADMIN] Check your login information. Exception is: com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception while trying to get InitialContext. [Root exception is com.sap.engine.services.security.exceptions.BaseLoginException: Cannot authenticate the user.] (message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.checkLoginCredentials.DMEXC)
    When i give a request for deployment it asks for the SDM password. I enter a valid SDM pwd. If i enter  a invalid SDM pwd i get  some other exception. So the pwd SDM entered by me is correct.
    can any one help me in solving this
    regards
    Nilesh Taunk

    Hi Nilesh,
           Try opening Visual Admin if your not able to login with username(administrator) and password. Problem with NWD2004s do the following steps.
    C:\usr\sap\J2E\JC01\j2ee\configtool->configtool.bat->open it
    1. Click on Secure store
    2. Right you will find :
    admin/password/J2E->retype your admin passowrd which you gave during installation=>SAVE properly
    Restart the server and try login visual admin
           Deploy now...Other wise see this thread same error solved:
    Re: An Deploy Problem about Credentials.
    Regards
    Suresh

  • Error while creating a application server connection in jdeveloper 10.1.3.2

    When I am trying to create a connection using the wizard with the following inputs
    hostname as :- localhost
    RMI Por as 22667
    When I use the test conection receive the following error
    racle.oc4j.admin.jmx.shared.exceptions.JMXRuntimeException: Error while getting remote MBeanServer for url: ormi://localhost:22667/default
         at oracle.oc4j.admin.jmx.client.CoreRemoteMBeanServer.fetchMBeanServerEjbRemote(CoreRemoteMBeanServer.java:502)
         at oracle.oc4j.admin.jmx.client.CoreRemoteMBeanServer.<init>(CoreRemoteMBeanServer.java:161)
         at oracle.oc4j.admin.jmx.client.RemoteMBeanServer.<init>(RemoteMBeanServer.java:128)
         at oracle.oc4j.admin.jmx.client.RemoteMBeanServer.getMBeanServer(RemoteMBeanServer.java:158)
         at oracle.oc4j.admin.jmx.client.ClientMBeanServerProxyFactory.getMBeanServer(ClientMBeanServerProxyFactory.java:68)
         at oracle.oc4j.admin.jmx.remote.rmi.RMIJMXConnectorImpl.getConnector(RMIJMXConnectorImpl.java:190)
         at oracle.oc4j.admin.jmx.remote.JMXConnectorImpl.connect(JMXConnectorImpl.java:400)
         at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
         at oracle.jdevimpl.cm.dt.J2EEConnectionWrapper._getJMXConnector(J2EEConnectionWrapper.java:269)
         at oracle.jdevimpl.cm.dt.J2EEConnectionWrapper.getPresentation(J2EEConnectionWrapper.java:76)
         at oracle.jdevimpl.cm.dt.browser.j2ee.J2EEBrowser.openConnectionBrowser(J2EEBrowser.java:75)
         at oracle.jdeveloper.cm.dt.ConnectionNode$NodeOpen.doWork(ConnectionNode.java:423)
         at oracle.ide.dialogs.ProgressRunnable.run(ProgressRunnable.java:159)
         at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:551)
         at java.lang.Thread.run(Thread.java:613)
    Caused by: javax.naming.NamingException: Error reading application-client descriptor: Error communicating with server: Connection refused; nested exception is:
         javax.naming.CommunicationException: Connection refused [Root exception is java.net.ConnectException: Connection refused] [Root exception is java.lang.InstantiationException: Error communicating with server: Connection refused; nested exception is:
         javax.naming.CommunicationException: Connection refused [Root exception is java.net.ConnectException: Connection refused]]
         at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getApplicationContext(ApplicationClientInitialContextFactory.java:127)
         at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getInitialContext(ApplicationClientInitialContextFactory.java:117)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
         at javax.naming.InitialContext.init(InitialContext.java:223)
         at javax.naming.InitialContext.<init>(InitialContext.java:197)
         at oracle.oc4j.admin.jmx.client.CoreRemoteMBeanServer.fetchMBeanServerEjbRemote(CoreRemoteMBeanServer.java:468)
         ... 14 more
    Caused by: java.lang.InstantiationException: Error communicating with server: Connection refused; nested exception is:
         javax.naming.CommunicationException: Connection refused [Root exception is java.net.ConnectException: Connection refused]
         at com.oracle.naming.J2EEContext.create(J2EEContext.java:104)
         at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getApplicationContext(ApplicationClientInitialContextFactory.java:124)
         ... 20 more
    Caused by: oracle.oc4j.rmi.OracleRemoteException: Connection refused; nested exception is:
         javax.naming.CommunicationException: Connection refused [Root exception is java.net.ConnectException: Connection refused]
         at oracle.oc4j.deployment.ApplicationClientResourceFinder.lookupResourceFinder(ApplicationClientResourceFinder.java:110)
         at oracle.oc4j.deployment.ApplicationClientResourceFinder.getFinder(ApplicationClientResourceFinder.java:123)
         at oracle.oc4j.deployment.ApplicationClientResourceFinder.getLocation(ApplicationClientResourceFinder.java:75)
         at oracle.oc4j.deployment.ApplicationClientResourceFinder.getEjbBinding(ApplicationClientResourceFinder.java:38)
         at com.oracle.naming.J2EEContext.addEJBReferenceEntries(J2EEContext.java:515)
         at com.oracle.naming.J2EEContext.create(J2EEContext.java:97)
         ... 21 more
    Caused by: javax.naming.CommunicationException: Connection refused [Root exception is java.net.ConnectException: Connection refused]
         at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:292)
         at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:51)
         at oracle.oc4j.deployment.ApplicationClientResourceFinder.lookupResourceFinder(ApplicationClientResourceFinder.java:101)
         ... 26 more
    Caused by: java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:428)
         at java.net.Socket.connect(Socket.java:507)
         at java.net.Socket.connect(Socket.java:457)
         at java.net.Socket.<init>(Socket.java:365)
         at java.net.Socket.<init>(Socket.java:207)
         at com.evermind.server.rmi.RMIClientConnection.createSocket(RMIClientConnection.java:682)
         at oracle.oc4j.rmi.ClientSocketRmiTransport.createNetworkConnection(ClientSocketRmiTransport.java:58)
         at oracle.oc4j.rmi.ClientRmiTransport.connectToServer(ClientRmiTransport.java:78)
         at oracle.oc4j.rmi.ClientSocketRmiTransport.connectToServer(ClientSocketRmiTransport.java:68)
         at com.evermind.server.rmi.RMIClientConnection.connect(RMIClientConnection.java:646)
         at com.evermind.server.rmi.RMIClientConnection.sendLookupRequest(RMIClientConnection.java:190)
         at com.evermind.server.rmi.RMIClientConnection.lookup(RMIClientConnection.java:174)
         at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:283)
         ... 28 more
    ---- Embedded exception
    javax.naming.NamingException: Error reading application-client descriptor: Error communicating with server: Connection refused; nested exception is:
         javax.naming.CommunicationException: Connection refused [Root exception is java.net.ConnectException: Connection refused] [Root exception is java.lang.InstantiationException: Error communicating with server: Connection refused; nested exception is:
         javax.naming.CommunicationException: Connection refused [Root exception is java.net.ConnectException: Connection refused]]
         at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getApplicationContext(ApplicationClientInitialContextFactory.java:127)
         at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getInitialContext(ApplicationClientInitialContextFactory.java:117)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
         at javax.naming.InitialContext.init(InitialContext.java:223)
         at javax.naming.InitialContext.<init>(InitialContext.java:197)
         at oracle.oc4j.admin.jmx.client.CoreRemoteMBeanServer.fetchMBeanServerEjbRemote(CoreRemoteMBeanServer.java:468)
         at oracle.oc4j.admin.jmx.client.CoreRemoteMBeanServer.<init>(CoreRemoteMBeanServer.java:161)
         at oracle.oc4j.admin.jmx.client.RemoteMBeanServer.<init>(RemoteMBeanServer.java:128)
         at oracle.oc4j.admin.jmx.client.RemoteMBeanServer.getMBeanServer(RemoteMBeanServer.java:158)
         at oracle.oc4j.admin.jmx.client.ClientMBeanServerProxyFactory.getMBeanServer(ClientMBeanServerProxyFactory.java:68)
         at oracle.oc4j.admin.jmx.remote.rmi.RMIJMXConnectorImpl.getConnector(RMIJMXConnectorImpl.java:190)
         at oracle.oc4j.admin.jmx.remote.JMXConnectorImpl.connect(JMXConnectorImpl.java:400)
         at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
         at oracle.jdevimpl.cm.dt.J2EEConnectionWrapper._getJMXConnector(J2EEConnectionWrapper.java:269)
         at oracle.jdevimpl.cm.dt.J2EEConnectionWrapper.getPresentation(J2EEConnectionWrapper.java:76)
         at oracle.jdevimpl.cm.dt.browser.j2ee.J2EEBrowser.openConnectionBrowser(J2EEBrowser.java:75)
         at oracle.jdeveloper.cm.dt.ConnectionNode$NodeOpen.doWork(ConnectionNode.java:423)
         at oracle.ide.dialogs.ProgressRunnable.run(ProgressRunnable.java:159)
         at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:551)
         at java.lang.Thread.run(Thread.java:613)
    Caused by: java.lang.InstantiationException: Error communicating with server: Connection refused; nested exception is:
         javax.naming.CommunicationException: Connection refused [Root exception is java.net.ConnectException: Connection refused]
         at com.oracle.naming.J2EEContext.create(J2EEContext.java:104)
         at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getApplicationContext(ApplicationClientInitialContextFactory.java:124)
         ... 20 more
    Caused by: oracle.oc4j.rmi.OracleRemoteException: Connection refused; nested exception is:
         javax.naming.CommunicationException: Connection refused [Root exception is java.net.ConnectException: Connection refused]
         at oracle.oc4j.deployment.ApplicationClientResourceFinder.lookupResourceFinder(ApplicationClientResourceFinder.java:110)
         at oracle.oc4j.deployment.ApplicationClientResourceFinder.getFinder(ApplicationClientResourceFinder.java:123)
         at oracle.oc4j.deployment.ApplicationClientResourceFinder.getLocation(ApplicationClientResourceFinder.java:75)
         at oracle.oc4j.deployment.ApplicationClientResourceFinder.getEjbBinding(ApplicationClientResourceFinder.java:38)
         at com.oracle.naming.J2EEContext.addEJBReferenceEntries(J2EEContext.java:515)
         at com.oracle.naming.J2EEContext.create(J2EEContext.java:97)
         ... 21 more
    Caused by: javax.naming.CommunicationException: Connection refused [Root exception is java.net.ConnectException: Connection refused]
         at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:292)
         at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:51)
         at oracle.oc4j.deployment.ApplicationClientResourceFinder.lookupResourceFinder(ApplicationClientResourceFinder.java:101)
         ... 26 more
    Caused by: java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:428)
         at java.net.Socket.connect(Socket.java:507)
         at java.net.Socket.connect(Socket.java:457)
         at java.net.Socket.<init>(Socket.java:365)
         at java.net.Socket.<init>(Socket.java:207)
         at com.evermind.server.rmi.RMIClientConnection.createSocket(RMIClientConnection.java:682)
         at oracle.oc4j.rmi.ClientSocketRmiTransport.createNetworkConnection(ClientSocketRmiTransport.java:58)
         at oracle.oc4j.rmi.ClientRmiTransport.connectToServer(ClientRmiTransport.java:78)
         at oracle.oc4j.rmi.ClientSocketRmiTransport.connectToServer(ClientSocketRmiTransport.java:68)
         at com.evermind.server.rmi.RMIClientConnection.connect(RMIClientConnection.java:646)
         at com.evermind.server.rmi.RMIClientConnection.sendLookupRequest(RMIClientConnection.java:190)
         at com.evermind.server.rmi.RMIClientConnection.lookup(RMIClientConnection.java:174)
         at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:283)
         ... 28 more
    ---- Embedded exception
    java.lang.InstantiationException: Error communicating with server: Connection refused; nested exception is:
         javax.naming.CommunicationException: Connection refused [Root exception is java.net.ConnectException: Connection refused]
         at com.oracle.naming.J2EEContext.create(J2EEContext.java:104)
         at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getApplicationContext(ApplicationClientInitialContextFactory.java:124)
         at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getInitialContext(ApplicationClientInitialContextFactory.java:117)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
         at javax.naming.InitialContext.init(InitialContext.java:223)
         at javax.naming.InitialContext.<init>(InitialContext.java:197)
         at oracle.oc4j.admin.jmx.client.CoreRemoteMBeanServer.fetchMBeanServerEjbRemote(CoreRemoteMBeanServer.java:468)
         at oracle.oc4j.admin.jmx.client.CoreRemoteMBeanServer.<init>(CoreRemoteMBeanServer.java:161)
         at oracle.oc4j.admin.jmx.client.RemoteMBeanServer.<init>(RemoteMBeanServer.java:128)
         at oracle.oc4j.admin.jmx.client.RemoteMBeanServer.getMBeanServer(RemoteMBeanServer.java:158)
         at oracle.oc4j.admin.jmx.client.ClientMBeanServerProxyFactory.getMBeanServer(ClientMBeanServerProxyFactory.java:68)
         at oracle.oc4j.admin.jmx.remote.rmi.RMIJMXConnectorImpl.getConnector(RMIJMXConnectorImpl.java:190)
         at oracle.oc4j.admin.jmx.remote.JMXConnectorImpl.connect(JMXConnectorImpl.java:400)
         at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
         at oracle.jdevimpl.cm.dt.J2EEConnectionWrapper._getJMXConnector(J2EEConnectionWrapper.java:269)
         at oracle.jdevimpl.cm.dt.J2EEConnectionWrapper.getPresentation(J2EEConnectionWrapper.java:76)
         at oracle.jdevimpl.cm.dt.browser.j2ee.J2EEBrowser.openConnectionBrowser(J2EEBrowser.java:75)
         at oracle.jdeveloper.cm.dt.ConnectionNode$NodeOpen.doWork(ConnectionNode.java:423)
         at oracle.ide.dialogs.ProgressRunnable.run(ProgressRunnable.java:159)
         at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:551)
         at java.lang.Thread.run(Thread.java:613)
    Caused by: oracle.oc4j.rmi.OracleRemoteException: Connection refused; nested exception is:
         javax.naming.CommunicationException: Connection refused [Root exception is java.net.ConnectException: Connection refused]
         at oracle.oc4j.deployment.ApplicationClientResourceFinder.lookupResourceFinder(ApplicationClientResourceFinder.java:110)
         at oracle.oc4j.deployment.ApplicationClientResourceFinder.getFinder(ApplicationClientResourceFinder.java:123)
         at oracle.oc4j.deployment.ApplicationClientResourceFinder.getLocation(ApplicationClientResourceFinder.java:75)
         at oracle.oc4j.deployment.ApplicationClientResourceFinder.getEjbBinding(ApplicationClientResourceFinder.java:38)
         at com.oracle.naming.J2EEContext.addEJBReferenceEntries(J2EEContext.java:515)
         at com.oracle.naming.J2EEContext.create(J2EEContext.java:97)
         ... 21 more
    Caused by: javax.naming.CommunicationException: Connection refused [Root exception is java.net.ConnectException: Connection refused]
         at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:292)
         at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:51)
         at oracle.oc4j.deployment.ApplicationClientResourceFinder.lookupResourceFinder(ApplicationClientResourceFinder.java:101)
         ... 26 more
    Caused by: java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:428)
         at java.net.Socket.connect(Socket.java:507)
         at java.net.Socket.connect(Socket.java:457)
         at java.net.Socket.<init>(Socket.java:365)
         at java.net.Socket.<init>(Socket.java:207)
         at com.evermind.server.rmi.RMIClientConnection.createSocket(RMIClientConnection.java:682)
         at oracle.oc4j.rmi.ClientSocketRmiTransport.createNetworkConnection(ClientSocketRmiTransport.java:58)
         at oracle.oc4j.rmi.ClientRmiTransport.connectToServer(ClientRmiTransport.java:78)
         at oracle.oc4j.rmi.ClientSocketRmiTransport.connectToServer(ClientSocketRmiTransport.java:68)
         at com.evermind.server.rmi.RMIClientConnection.connect(RMIClientConnection.java:646)
         at com.evermind.server.rmi.RMIClientConnection.sendLookupRequest(RMIClientConnection.java:190)
         at com.evermind.server.rmi.RMIClientConnection.lookup(RMIClientConnection.java:174)
         at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:283)
         ... 28 more

    Caused by: java.net.ConnectException: Connection refused
    Is the Oracle application server running?

  • Error connecting to an EJB 3.0 Remote on OC4J 10.1.3.2 from Tomcat

    Hi, I want to connect to a Remote Session Bean running on the OC4J 10.1.3 and it doesn´t work.
    I have connected to it from a java standalone application using:
    public static void main(String [] args) {
    try {
    final Context context = getInitialContext();
    SessionEJB sessionEJB = (SessionEJB)context.lookup("java:comp/env/ejb/SessionEJB");
    System.out.println(sessionEJB.mergeEntity(""));
    System.out.println( "hola" );
    } catch (Exception ex) {
    ex.printStackTrace();
    private static Context getInitialContext() throws NamingException {
    Hashtable env = new Hashtable();
    // Standalone OC4J connection details
    env.put( Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.naming.ApplicationClientInitialContextFactory" );
    env.put( Context.SECURITY_PRINCIPAL, "oc4jadmin" );
    env.put( Context.SECURITY_CREDENTIALS, "passw" );
    env.put(Context.PROVIDER_URL, "ormi://localhost:23791/ejb3jar");
    return new InitialContext( env );
    with this application-client.xml file:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <application-client xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd" version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee">
    <display-name>Model-app-client</display-name>
    <ejb-ref>
    <ejb-ref-name>ejb/SessionEJB</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <remote>ar.com.eds.ejb3.model.SessionEJB</remote>
    <ejb-link>SessionEJB</ejb-link>
    </ejb-ref>
    thats works fine, but when I try to use the same solution from a jsf proyect running on a Tomcat 5.5.20, it fails with this error:
    Caused by: java.lang.RuntimeException: Error while creating home.
         at ar.com.mcd.fawkes.ui.locator.EJB3Locator.get(EJB3Locator.java:32)
         at ar.com.mcd.fawkes.ui.locator.ServiceLocator$1.get(ServiceLocator.java:12)
         at net.sf.opentranquera.web.jsf.locator.ServiceLocatorBean.get(ServiceLocatorBean.java:42)
         at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:79)
         at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:187)
         at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:171)
         at com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:263)
         at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:160)
         ... 80 more
    Caused by: javax.naming.NameNotFoundException: Name ejb is not bound in this Context
         at org.apache.naming.NamingContext.lookup(NamingContext.java:769)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
         at org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
         at javax.naming.InitialContext.lookup(Unknown Source)
         at ar.com.mcd.fawkes.ui.locator.EJB3Locator.get(EJB3Locator.java:28)
         ... 87 more
    Could you please help me with any tip?
    Mauricio
    Message was edited by:
    Mauricio

    Hi, Rick
    Thanks for your help.
    I deleted de application-client.xml file, added the following lines to the web.xml file:
         <ejb-ref>
              <ejb-ref-name>ejb/SessionEJB</ejb-ref-name>
              <ejb-ref-type>Session</ejb-ref-type>
              <remote>ar.com.eds.ejb3.model.SessionEJB</remote>
         </ejb-ref>
    and now I´m using oracle.j2ee.rmi.RMIInitialContextFactory
    there is no error, and it doesn´t throw any exception but the following line returns null.
    SessionEJB sessionEJB = (SessionEJB)context.lookup("java:comp/env/ejb/SessionEJB");
    Its seems the lookup method finds the remote ejb because it doesn´t fail, but it returns null.
    Any idea what is wrong?
    Mauricio.

  • Error while deploying a message driven bean

    I am deployeing a MDB which is done successfully but the message is not retrieved(No message in teh queue). The following description is given in the log file.
    #1.5#0016E6197593004B0000000B000013040004288DE20D6CD8#1170489754872#com.sap.security.core.policy.PolicyInfoManagerImpl##com.sap.security.core.policy.PolicyInfoManagerImpl.copyApplicationConfiguration#Administrator#523####e5dbec01b35c11db90e70016e6197593#SAPEngine_Application_Thread[impl:3]_39##0#0#Error#1#/System/Security/WS/SecurityProtocol#Java###An error occured while copying configurations for application . Reason: #3#sap.com/MessageEAR#com.sap.engine.frame.core.configuration.NameNotFoundException#A configuration with the path "webservices/services/sap.com/MessageEAR" does not exist.#
    Can you please tell where to look for it and what to do?

    the session bean is ::
    public class SenderBean implements SessionBean {
      public static final boolean DEBUG = false;
      private SessionContext ctx;
      private TopicConnectionFactory factory;
      private TopicConnection connection;
      private Topic topic;
      public SenderBean() {
         log("constructor");
      public void ejbCreateSender() throws CreateException {
         log("ejbCreate");
                try {
                   InitialContext naming = new InitialContext();
                   factory = (TopicConnectionFactory)naming.lookup("jmsfactory/default/ExceptionTopicFactory");
                   topic = (Topic)naming.lookup("jmstopics/default/ExceptionTopic");
                   log("factory: " + factory);
                   allocateResources();
                } catch (Exception exc) {
                   log("exception occured during ejbCreate().");
                   throw new CreateException("Unexpected exception in ejbCreate().");
      public void ejbCreate() throws CreateException {
      public void ejbActivate() {
         log("ejbActivate");
         try {
           allocateResources();
         } catch (Exception exc) {
           exc.printStackTrace();
      public void ejbPassivate() {
         log("ejbPassivate");
         try {
           releaseResources();
         } catch (Exception exc) {
           exc.printStackTrace();
      public void ejbRemove() {
         log("ejbRemove");
      public void setSessionContext(SessionContext _ctx) {
         log("setSessionContext");
         ctx = _ctx;
      public void sendMessage(String text) throws MessageNotSentException {
         log("sendMessage");
         log("text = " + text);
         TopicSession session = null;
         try {
           session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
           log("topic = " + topic);
           TopicPublisher publisher = session.createPublisher(topic);
           TextMessage textMessage = session.createTextMessage();
           textMessage.setText(text);
           publisher.publish(textMessage);
           System.out.println("Message Sent");
           log("message sent");
         } catch (JMSException jmse) {
           jmse.printStackTrace();
           throw new MessageNotSentException(jmse.toString());
         } finally {
           try {
              if (session != null) {
                session.close();
           } catch (Exception exc) {
      private void releaseResources() throws JMSException {
         connection.close();
         connection = null;
      private void allocateResources() throws JMSException {
         connection = factory.createTopicConnection();
         log("connection = " + connection);
         connection.start();
         log("connection started");
      private void log(String message) {
         if (DEBUG) {
           System.out.println("SenderBean: " + message);
    the mdb is::
    public class MessageDisplayBean implements MessageDrivenBean, MessageListener {
           public static final boolean DEBUG = false;
           private MessageDrivenContext ctx;
           private QueueConnectionFactory factory;
           private QueueConnection connection;
           private Queue queue;
           public MessageDisplayBean() {
              System.out.println("In constructor");
              log("constructor");
           public void onMessage(Message message) {
              TextMessage textMessage = (TextMessage)message;
              try {
                String text = textMessage.getText();
                log("message received. Text follows:\n\n  " + text + "\n\n");
                connection = factory.createQueueConnection();
                connection.start();
                QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
                TextMessage confirmation = session.createTextMessage();
                confirmation.setText("Message \""+ textMessage.getText() + "\" received.");
                //queue = session.createQueue("ConfirmationQueue");
                QueueSender sender = session.createSender(queue);
                sender.send(confirmation);
                session.close();
                connection.close();
                System.out.println("Message received");
              } catch (javax.jms.JMSException jmse) {
           public void ejbRemove() {
              log("ejbRemove()");
           public void setMessageDrivenContext(MessageDrivenContext _ctx) {
              log("setMessageDrivenContext()");
              ctx = _ctx;
              System.out.println("In context");
           public void ejbCreate() {
              try {
                   System.out.println("In ejbcreate");
                InitialContext naming = new InitialContext();
                factory = (QueueConnectionFactory)naming.lookup("jmsfactory/default/ExceptionQueueFactory");
                queue = (Queue)naming.lookup("jmsqueues/default/ExceptionQueue");
                log("factory: " + factory);
              } catch (Exception exc) {
                log("exception occured during ejbCreate().");
              log("ejbCreate()");
           private void log(String str) {
              if (DEBUG) {
                System.out.println("MessageDisplayBean: " + str);
    th ejb-j2ee-engine.xml is::
    <ejb-j2ee-engine>
         <enterprise-beans>
              <enterprise-bean>
                   <ejb-name>MessageDisplayBean</ejb-name>
                   <jndi-name>MessageDisplayBean</jndi-name>
                   <message-props>
                        <destination-name>ExceptionTopic</destination-name>
                        <connection-factory-name>ExceptionTopicFactory</connection-factory-name>
                   </message-props>
              </enterprise-bean>
              <enterprise-bean>
                   <ejb-name>MessageSender</ejb-name>
                   <jndi-name>MessageSender</jndi-name>
                   <session-props/>
              </enterprise-bean>
                   </enterprise-beans>
    </ejb-j2ee-engine>
    the ejb-jar.xml is::
                 <ejb-jar>
        <display-name>        Message Driver Bean Example      </display-name>
        <enterprise-beans>
            <session>
                <display-name>            MessageSender          </display-name>
                <ejb-name>MessageSender</ejb-name>
                <home>com.sap.message.sender.SenderHome</home>
                <remote>com.sap.message.sender.Sender</remote>
                <local-home>com.sap.message.sender.SenderLocalHome</local-home>
                <local>com.sap.message.sender.SenderLocal</local>
                <ejb-class>com.sap.message.sender.SenderBean</ejb-class>
                <session-type>Stateful</session-type>
                <transaction-type>Container</transaction-type>
                <ejb-local-ref>
                    <ejb-ref-name>ejb/SenderBean</ejb-ref-name>
                    <ejb-ref-type>Session</ejb-ref-type>
                    <local-home>com.sap.message.sender.SenderLocalHome</local-home>
                    <local>com.sap.message.sender.SenderLocal</local>
                    <ejb-link>MyEJB.jar#MessageSender</ejb-link>
                </ejb-local-ref>
                <resource-ref>
                    <res-ref-name>ExceptionTopicFactory</res-ref-name>
                    <res-type>javax.jms.TopicConnectionFactory</res-type>
                    <res-auth> Container</res-auth>
                </resource-ref>
                <resource-env-ref>
                    <resource-env-ref-name>ExceptionTopic        </resource-env-ref-name>
                    <resource-env-ref-type>   javax.jms.Topic        </resource-env-ref-type>
                </resource-env-ref>
            </session>
            <message-driven>
                <ejb-name>MessageDisplayBean</ejb-name>
                <ejb-class>com.sap.message.mdb.MessageDisplayBean</ejb-class>
                <transaction-type>Container</transaction-type>
                <message-driven-destination>
                    <destination-type>javax.jms.Topic</destination-type>
                </message-driven-destination>
                <resource-ref>
                    <res-ref-name>   ExceptionQueueFactory            </res-ref-name>
                    <res-type>              javax.jms.QueueConnectionFactory            </res-type>
                    <res-auth>              Container            </res-auth>
                </resource-ref>
                <resource-env-ref>
                    <resource-env-ref-name>        ExceptionQueue        </resource-env-ref-name>
                    <resource-env-ref-type>          javax.jms.Queue        </resource-env-ref-type>
                </resource-env-ref>
            </message-driven>
               </enterprise-beans>
        <assembly-descriptor>
            <container-transaction>
                <method>
                    <ejb-name>MessageDisplayBean</ejb-name>
                    <method-name>onMessage</method-name>
                </method>
                          <trans-attribute>           NotSupported         </trans-attribute>
            </container-transaction>
        </assembly-descriptor>
    </ejb-jar>

  • Error While Calling a EJB

    Hai,
            I had created a java class that includes the EJB in it
    The code is given below  :
    Properties props = new Properties();
              try
                   props.put  (Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl");
                   props.put(Context.PROVIDER_URL, "<server name >:<server port>");
              catch (Exception e1)
                   System.out.println("Exception  1 -
    > "+e1.getMessage());
              try
                Context ctx = new InitialContext(props);
                Object o = ctx.lookup("sap.com/DivEAR/LOCAL/com.sap.sdn.ejb.DivLocalHome");
                System.out.println("Test");
                DivHome  home = (DivHome)PortableRemoteObject.narrow(o,DivHome.class);
                Div  dref  = home.create();
                System.out.println(dref.Divide(20,4));
            catch (Exception e2)
                e2.printStackTrace();
    But it gives the following Error :
    com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception while trying to get InitialContext. [Root exception is com.sap.engine.interfaces.cross.DestinationException: cannot establish connection with any of the available instances:
    192.168.1.37:50200 Reason: Cannot open connection on host: 192.168.1.37 and port: 50200]
         at com.sap.engine.services.jndi.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:455)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
         at javax.naming.InitialContext.init(InitialContext.java:223)
         at javax.naming.InitialContext.<init>(InitialContext.java:197)
         at com.sap.sdn.client.DivisionClient.main(DivisionClient.java:44)
    Caused by: com.sap.engine.interfaces.cross.DestinationException: cannot establish connection with any of the available instances:
    192.168.1.37:50200 Reason: Cannot open connection on host: 192.168.1.37 and port: 50200
         at com.sap.engine.interfaces.cross.Destination.getNextAvailableBroker(Destination.java:53)
         at com.sap.engine.interfaces.cross.Destination.getRemoteBroker(Destination.java:33)
         at com.sap.engine.services.jndi.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:340)
         ... 5 more
    Can anyone help me solve the problem.
    Regards,
    R.Jude Silvester.
    Edited by: Jude Silvester on Jan 28, 2009 12:06 PM

    Hai Rajat,
                   I pinged and got replied from Server.
    Now i tried the following Code :
                         try{
                               Properties props=new Properties();
                               props.put(Context.INITIAL_CONTEXT_FACTORY,
              "com.sap.engine.services.jndi.InitialContextFactoryImpl");
              props.put(Context.PROVIDER_URL, "sapsrv02:50200");
              wdContext.currentContextElement().setExc("No Exception : ");
              Context ctx = new InitialContext(props);
                               Object o = ctx.lookup("sap.com/DivEAR/REMOTE/com.sap.sdn.ejb.Div");
         catch (Exception e)
              wdContext.currentContextElement().setExc("Exception : "+e.getMessage());
      got the Error :
       Path to object does not exist at REMOTE, the whole lookup name is sap.com/DivEAR/REMOTE/com.sap.sdn.ejb.Div.
    Can you please help me solve this problem.
    Regards,
    Jude

  • Error Occured while Invoking a BPEL Process from JAVA

    Hi.....
    When initiating a BPEL process from JAVA the code is working fine and the Process is getting initiated.But while using that code in J2EE project as a java code and while calling that method Error is occuring.....
    Here by i am attaching my JAVA Code which runs as an applicateion and package which runs in Server....
    JSP and Java Method Used:
    JSP Code:
    ===============
    <%@ page import=" bo.callbpel" %>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>FEATT - I30</title>
    </head>
    <body>
    <%
    String input=request.getParameter("dnvalue");
    callbpel p=new callbpel();
    String Output=p.Initiate(input);
    out.print("The Input Given to the BPEL Process is : "+input);
    %>
    <BR><BR><BR><BR><BR><BR>
    <%
    out.print("The Reply from BPEL Process is : "+Output);
    %>
    </body>
    </html>
    Java Code:
    package bo;
    import com.oracle.bpel.client.Locator;
    import com.oracle.bpel.client.NormalizedMessage;
    import com.oracle.bpel.client.delivery.IDeliveryService;
    import java.util.Map;
    import java.util.Properties;
    import oracle.xml.parser.v2.XMLElement;
    /*import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest ;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession; */
    //import java.util.*;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    public class callbpel {
         public String Initiate(String value){
              String replyText=null;
              String input = value;
              System.out.println(input);
              String xmlInput= "<ns1:AccessDBBPELProcessRequest xmlns:ns1=\"http://xmlns.oracle.com/AccessDBBPEL\"><ns1:input>"+input+"</ns1:input></ns1:AccessDBBPELProcessRequest>";
              String xml="<ns1:BPELProcess1ProcessRequest xmlns:ns1=\"http://xmlns.oracle.com/BPELProcess1\">";
              xml=xml+"<ns1:input>"+input+"</ns1:input>";
              xml=xml+"</ns1:BPELProcess1ProcessRequest>";
              try{
              Properties props=new Properties();
              props.setProperty("orabpel.platform","ias_10g");
              props.setProperty("java.naming.factory.initial","com.evermind.server.rmi.RMIInitialContextFactory");
              props.setProperty("java.naming.provider.url","opmn:ormi://157.227.132.226:6003:home/orabpel");
              props.setProperty("java.naming.security.principal","oc4jadmin");
              props.setProperty("java.naming.security.credentials","oc4jadmin");
              props.setProperty("dedicated.rmicontext", "true");
              Locator locator = new Locator("default", "bpel", props);
              String uniqueBpelId = com.collaxa.cube.util.GUIDGenerator.generateGUID();
              //System.out.println(uniqueBpelId);
              //java.util.Map msgProps = new HashMap();
              System.out.println("After creating the locator object......");
              IDeliveryService deliveryService =(IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME);
              System.out.println("Before creating the NormalizedMessage object......");
              NormalizedMessage nm = new NormalizedMessage();
              System.out.println("After creating the NormalizedMessage object.*.*.*...");
              //msgProps.put("conversationId",uniqueBpelId);
              //nm.setProperty("conversationId",uniqueBpelId);
              nm.addPart("payload", xml);
              System.out.println("Before creating response object......");
              NormalizedMessage res = deliveryService.request("BPELProcess1", "process", nm);
              System.out.println("After calling the BPELProcess1 .*.*.*...");
              Map payload = res.getPayload();
              System.out.println("BPEL called");
              XMLElement xmlEl=(oracle.xml.parser.v2.XMLElement)payload.get("payload");
              replyText=xmlEl.getText();
              System.out.println("Reply from BPEL Process>>>>>>>>>>>>> "+replyText);
              catch (Exception e) {
              System.out.println("Exception : "+e);
              e.printStackTrace();
              return replyText;
    While Creating and Object for the Class callbpel and Whilw Calling that Method
    callbpel p=new callbpel();
    String Output=p.Initiate(input);
    Its throwing an Error:
    Error Occured is:
    After creating the locator object......
    Before creating the NormalizedMessage object......
    After creating the NormalizedMessage object.*.*.*...
    Before creating response object......
    Apr 24, 2008 9:12:00 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.NoClassDefFoundError: javax/ejb/EJBException
         at com.oracle.bpel.client.util.ExceptionUtils.handleServerException(ExceptionUtils.java:76)
         at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:254)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:83)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:53)
         at bo.callbpel.Initiate(callbpel.java:55)
         at org.apache.jsp.output_jsp._jspService(output_jsp.java:55)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
         at java.lang.Thread.run(Unknown Source)
    For Running JSP i am Using Eclipse 3.2.0 and apache-tomcat-5.5.25
    Please Provide me a Solution......
    Thanks in Advance.....
    Regards,
    Suresh K

    Have got the same problem. Scenario at my end is little different though.
    I am trying to invoke a BPEL process from an ESB Service.
    I am trying to look into it..
    However, would be grateful, if someone can give some insight into this since many are running into this issue without being able to fix.
    Ashish.

Maybe you are looking for

  • How can I get my pictures back after the iPhone update?

    The update deleted all of my pictures and information.  I did not realize that my pictures weren't being saved to the cloud.  Are they gone forever? I would be grateful for any sort of help you all can give me! Apple, please take note.  These inciden

  • Making Workitems non-executable from SBWP or R/3

    Hi All. How to make Tasks non executable from SBWP and executable only from UWL. Is the configuration supposed to be entered in SWFVISU. Regards, Sameer.

  • NFL Mobile Data Plan

    I have been unable to run NFL Mobile on my Incredible for the last couple of days.  It was working before (although I no longer have free access to Redzone).  Now when I try to load it, I get the error "Your current data plan is not supported. Nfl Mo

  • Migration assistant hanging in Yosemite

    My iMac hard drive failed and had to be replaced. When I got the machine back, I was hoping that I would be able to restore from my Time Machine back up on an external hard drive. I upgraded the new machine to Yosemite (as the previous drive had been

  • O.T.  Parcel Delivery Scam

    This fraudulent activity has surfaced in South Wales,but these things have a habit of travelling ! With Christmas approaching be aware of a bogus parcel delivery company who put a card through your door claiming you were out when they called, and giv