Javax.naming.NamingException: Cannot create resource instance (JOTM )

Hi all,
I wanted to create an application with transaction management, first i tired out tyrex but could get a thing out of it now i am trying out JOTM, but i am getting this error "javax.naming.NamingException: Cannot create resource instance ", below is my configuration..
===context.xml===
<Context path="/FYPMS" docBase="FYPMS" debug="1" reloadable="true" crossContext="true" antiResourceLocking="true">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_crs_log." suffix=".txt"
          timestamp="true"/>
     <Resource name="jdbc/mysql" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="root" password="password" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://127.0.0.1:3306/fypms?autoReconnect=true"/>
<Resource name="UserTransaction" auth="Container"
type="javax.transaction.UserTransaction"/>
<ResourceParams name="UserTransaction">
<parameter>
<name>factory</name>
<value>org.objectweb.jotm.UserTransactionFactory</value>
</parameter>
<parameter>
<name>jotm.timeout</name>
<value>60</value>
</parameter>
</ResourceParams>
</Context>
===web.xml===
<resource-ref>
<res-ref-name>jdbc/mysql</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
===insert.java===
try{
System.out.println("pass0");
Context ctx = new InitialContext();
Context envCtx = (Context)ctx.lookup("java:comp/env");
DataSource datasource = (javax.sql.DataSource)envCtx.lookup("jdbc/mysql");               
UserTransaction ut = (UserTransaction)envCtx.lookup("UserTransaction");
ut.begin();
the dataSource can be retrieve successfully but when i tired to retrieve the UserTransaction i get a "Cannot create resource instance ". Please help mi out with this.. thx
fatmond

we are trying to connect MS Access thru tomcat and it is giving the above exception
i have changed the server.xml
<Resource name="jdbc/Mess" auth="Container" scope="Shareable" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/Mess">
<parameter>
<name>maxWait</name>
<value>5000</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>4</value>
</parameter>
<parameter>
<name>password</name>
<value>admin</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:odbc:Mess</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>sun.jdbc.odbc.JdbcOdbcDriver</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>2</value>
</parameter>
<parameter>
<name>username</name>
<value>admin</value>
</parameter>
</ResourceParams>
web.xml
<resource-ref>
<description>Access Datasource example</description>
<res-ref-name>jdbc/Mess</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
java class
Context initContext = new InitialContext();
DataSource ds = (DataSource)initContext.lookup("java:/comp/env/jdbc/Mess");
con = ds.getConnection();
Please help.......

Similar Messages

  • Cannot create resource instance (Works on NetBeans/Tomcat)

    I have a project that works just fine in NetBeans w/ Tomcat but when I deploy it to Sun One Web Server 6.1 SP5 I get the following error:
    StandardWrapperValve[jsp]: WEB2792: Servlet.service() for servlet jsp threw exception
    javax.servlet.ServletException: Cannot create resource instance
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:536)
         at jsps.index_jsp._jspService(_index_jsp.java:91)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:687)
         at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:459)
         at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:375)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)
         at com.iplanet.ias.web.WebContainer.service(WebContainer.java:580)
    ----- Root Cause -----
    javax.naming.NamingException: Cannot create resource instance
         at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:167)
         at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:834)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
         at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at jsps.index_jsp._jspService(_index_jsp.java:79)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:687)
         at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:459)
         at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:375)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)
         at com.iplanet.ias.web.WebContainer.service(WebContainer.java:580)
    I have the following in my in context.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/BOEnterpriseTest1">
    <Resource name="jdbc/dev10g" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@10.10.10.10:1521:dev" username="userid" password="pwd" maxActive="20" maxIdle="10" maxWait="-1"/>
    </Context>
    I have the following in my web.xml:
    <resource-ref>
    <description>jdbc:oracle:thin:@10..10.10.10:1521:dev</description>
    <res-ref-name>jdbc/dev10g</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    What�s missing on the Sun One server?

    I am trying to do a refresh of a Crystal Reports report in a JSP.
    Using the web.xml looking like:
    <resource-ref>
    <description>jdbc:oracle:thin:@10.10.
    10.10:1521:dev10g</description>
    <res-ref-name>jdbc/dev10g</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Application</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    and code in my JSP:
    <%
    InitialContext initContext = new InitialContext();
    DataSource source = (DataSource) initContext.lookup("java:comp/env/jdbc/dev10g");
    Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    try{
    DataSource ds = (DataSource)initCtx.lookup("Data");
    catch ( NamingException e ){
    DataSource ds = (DataSource) initContext.lookup("java:comp/env/jdbc/dev10g");
    initCtx.bind("Data", ds);     
    I get the following error:
    WEB2720: Error initializing naming context for context /BOEnterpriseTest1
         javax.naming.NameNotFoundException: WEB3885: Name Data is not bound in this Context
              at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
              at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
              at com.iplanet.ias.web.WebModule.verifyResType(WebModule.java:510)
              at com.iplanet.ias.web.WebModule.bindResources(WebModule.java:410)
              at com.iplanet.ias.web.WebModule.bindGlobalResourceRefs(WebModule.java:352)
              at com.iplanet.ias.web.WebModule.createNamingContext(WebModule.java:323)
              at org.apache.catalina.core.StandardContext.start(StandardContext.java:3718)
              at com.iplanet.ias.web.WebModule.start(WebModule.java:251)
              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
              at org.apache.catalina.core.StandardHost.start(StandardHost.java:652)
              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
              at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355)
              at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
              at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431)
              at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500)
              at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)
    What steps do I need to do on the Server side or in my code?

  • Cannot create resource instance

    Hi to get a pool connection I use a universal pool connection(ucp.jar). I did this:
    In the server.xml of tomcat i put these:
    <Resource
         name="onconsultas"
         auth="Container"
         description ="Pool for onconsultas"
         type="oracle.jdbc.pool.OracleConnectionPoolDataSource"               
      />In the context.xml of tomcat i put these:
    <Context path="/onconsultas" docBase="onconsultas" debug="0" reloadable="true">
         <ResourceParams name = "onconsultas">
              <parameter>
                   <name>driverClassName</name>
                   <value>oracle.jdbc.driver.OracleDriver</value>
              </parameter>
              <parameter>
                   <name>factory</name>
                   <value>oracle.jdbc.pool.OracleDataSourceFactory</value>
              </parameter>
              <parameter>
                   <name>logAbandoned</name>
                   <value>true</value>
              </parameter>
              <parameter>
                   <name>removeAbandoned</name>
                   <value>true</value>
              </parameter>
              <parameter>
                   <name>removeAbandonedTimeout</name>
                   <value>60</value>
              </parameter>
              <parameter>
                   <name>url</name>
                   <value>jdbc:oracle:thin:@198.198.111.170:1521:asesoras</value>
              </parameter>
              <parameter>
                   <name>user</name>
                   <value>sisope</value>
              </parameter>
              <parameter>
                   <name>password</name>
                   <value>sisope</value>
              </parameter>
         </ResourceParams>  
    </Context>In the web.xml of tomcat( i also tried in the web.xml of mi aplication):
    resource-ref>
            <description>Description pool</description>
            <res-ref-name>onconsultas</res-ref-name>
            <res-type>oracle.jdbc.pool.OracleConnectionPoolDataSource</res-type>
            <res-auth>Container</res-auth>
    </resource-ref>Finally in mi class I code:
    Context ctx = null;
    Context initCtx = new InitialContext();
      ctx = (Context) initCtx.lookup("java:comp/env");
      OracleConnectionPoolDataSource dataSource = ( OracleConnectionPoolDataSource) ctx.lookup("/onconsultas");in the line of the dataSource is the error and said:
    javax.naming.NamingException: Cannot create resource instance
    What is wrong? i don't get it

    I forgot: I 'm using tomcat 6.0.18 that came with the netbeans 6.9 and I `m not using servlets. Almost all the code is in the jsp.

  • Tomcat - MySQL - Cannot create resource instance

    I keep getting an error when trying to lookup my JNDI name. I know that this name is bound to a Context because I can list the bindings
    Context initCtx = new InitialContext();
    NamingEnumeration enum = initCtx.listBindings("java:comp/env/jdbc");
    while (enum.hasMoreElements()) {
    System.out.println(enum.nextElement().toString());
    And sure enough the name of my database I added through the console appears. However, I keep getting this error:
    javax.naming.NamingException: Cannot create resource instance
    on this second line of code
    Context ctx = new InitialContext();
    DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/ArgonautDB");
    My MySQL Connector jar file is in $CATALINA_HOME/common/lib and I believe my server.xml settings are correct because I added this Data Source to the context through the console and the web.xml file should be simple...nevertheless I still get this error.
    Any suggestions on where I else I can turn. Pulling my precious few last hairs out here....

    Thank you very much. That did the trick. Actually what did the trick was to reinstall tomcat with the standard installation, NOT the LE installation which doesn't include the dbcp jar files needed for connecting to a database - but you were right about missing those.
    I was dissapointed in Tomcat's documentation of this issue. I would have thought that something that has to have caused other developers problems like this would have been documented somewhere more pronounced (if at all) on Tomcat's site.
    For those other newbies out there who don't want to pull out your hair...here is a summary of the steps I took to remedy this problem.
    1) Install the latest version of Tomcat. Do NOT install the LE version, it does not include the neccessary library files to connect to a database (commons-dbcp.jar and commons-pool.jar).
    2) Download the latest mysql connector library from http://www.mysql.com/downloads/mysqlcc.html. Once you have extracted the tar file, there will be some directories, a README file, a couple other text files and a jar file named mysql-connector-java-VERSION-stable-bin.jar. Move the mysql-connector-java-VERSION-stable-bin.jar file to $CATALINA_HOME/common/lib.
    3) Follow the instructions on http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
    to create a test database, a test jsp file and a test class to access the database.

  • Error while starting Instance -javax.naming.NamingException: Cannot bind nu

    Kindly help!!!!!
    Application gets deployed on Oracle Weblogic Server 11g. But while starting its gives the Error
    javax.naming.NamingException: Cannot bind null object to jndi with name.
    All the things seems to be in place. Kindly help

    No I am not getting this error while deploying the application. Application gets successfully deployed.
    Once I start the application I get this error
    <Apr 17, 2010 5:28:46 PM IST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating
    <Apr 17, 2010 5:28:46 PM IST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    weblogic.application.ModuleException: Could not setup environment
    at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1361)
    at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:408)
    at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:182)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:48)
    Truncated. see log file for complete stacktrace
    javax.naming.NamingException: Cannot bind null object to jndi with name jms/queue/EodBodQueueJNDI
    at weblogic.jndi.internal.BasicNamingNode.bind(BasicNamingNode.java:311)
    at weblogic.jndi.internal.WLEventContextImpl.bind(WLEventContextImpl.java:277)
    at weblogic.deployment.EnvironmentBuilder.addConnectorRef(EnvironmentBuilder.java:233)
    at weblogic.deployment.EnvironmentBuilder.addResourceReferences(EnvironmentBuilder.java:152)
    at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:138)
    Truncated. see log file for complete stacktrace

  • Sun One Webserver Connection Pooling - javax.naming.NamingException

    I'm trying to configure a container managed datasource in Sun One Webserver. I've followed the steps given in the Sun One Webserver Administrator's Guide, however when I try to lookup the datasource I get a "javax.naming.NamingException: Cannot create resource instance" exception (full stack trace below). I have verified the database connection info (URL/user/password) is correct using Squirrel and I've appended the location of classes12.jar to the server's classpath in server.xml. Relevant snippets from the configuration files, my lookup code, and the stack trace are below. I've been beating my head on this for almost two days and I would appreciate any tips on how to debug this.
    web.xml
        <resource-ref>
            <description>JNDI DataSource</description>
            <res-ref-name>jdbc/web920</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
            <res-sharing-scope>Sharable</res-sharing-scope>
        </resource-ref>
    sun-web.xml
        <resource-ref>
            <res-ref-name>jdbc/web920</res-ref-name>
            <jndi-name>jdbc/web920</jndi-name>
        </resource-ref> 
    server.xml
    <RESOURCES>
        <JDBCCONNECTIONPOOL name="web920" datasourceclassname="oracle.jdbc.pool.OracleDataSource" steadypoolsize="8" maxpoolsize="32" poolresizequantity="2" idletimeout="300" maxwaittime="60000" connectionvalidationrequired="off"
            connectionvalidationmethod="auto-commit" validationtablename="" failallconnections="off" transactionisolationlevel="read-uncommitted" isolationlevelguaranteed="off">
            <PROPERTY name="URL" value="jdbc:oracle:thin:@d1web920.mydomain.com:1521:d1web920" />
            <PROPERTY name="User" value="<username>" />
            <PROPERTY name="Password" value="<password>" />
        </JDBCCONNECTIONPOOL>
        <JDBCRESOURCE jndiname="jdbc/web920" poolname="web920" enabled="on" />
    </RESOURCES>
    Lookup code
        private static DataSource getDataSource(){
            DataSource ds = null;
            try {
                Object o = new InitialContext().lookup("java:comp/env/jdbc/web920");
                ds = (DataSource) o;
            } catch (NamingException e) {
                System.out.println("Error retrieving DataSource.");
                e.printStackTrace();
            return ds;       
    Stack Trace
    warning: CORE3283: stderr: javax.naming.NamingException: Cannot create resource instance
    warning: CORE3283: stderr:      at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:167)
    warning: CORE3283: stderr:      at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
    warning: CORE3283: stderr:      at org.apache.naming.NamingContext.lookup(NamingContext.java:834)
    warning: CORE3283: stderr:      at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
    warning: CORE3283: stderr:      at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
    warning: CORE3283: stderr:      at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
    warning: CORE3283: stderr:      at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
    warning: CORE3283: stderr:      at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
    warning: CORE3283: stderr:      at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
    warning: CORE3283: stderr:      at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
    warning: CORE3283: stderr:      at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
    warning: CORE3283: stderr:      at javax.naming.InitialContext.lookup(InitialContext.java:351)
    warning: CORE3283: stderr:      at mil.army.usaac.portal.util.DatabaseConnectionManager.getDataSource(DatabaseConnectionManager.java:99)
    warning: CORE3283: stderr:      at mil.army.usaac.portal.util.DatabaseConnectionManager.init(DatabaseConnectionManager.java:40)
    warning: CORE3283: stderr:      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:921)
    warning: CORE3283: stderr:      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)
    warning: CORE3283: stderr:      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3478)
    warning: CORE3283: stderr:      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3760)
    warning: CORE3283: stderr:      at com.iplanet.ias.web.WebModule.start(WebModule.java:251)
    warning: CORE3283: stderr:      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
    warning: CORE3283: stderr:      at org.apache.catalina.core.StandardHost.start(StandardHost.java:652)
    warning: CORE3283: stderr:      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
    warning: CORE3283: stderr:      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355)
    warning: CORE3283: stderr:      at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
    warning: CORE3283: stderr:      at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431)
    warning: CORE3283: stderr:      at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500)
    warning: CORE3283: stderr:      at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)

    we are trying to connect MS Access thru tomcat and it is giving the above exception
    i have changed the server.xml
    <Resource name="jdbc/Mess" auth="Container" scope="Shareable" type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/Mess">
    <parameter>
    <name>maxWait</name>
    <value>5000</value>
    </parameter>
    <parameter>
    <name>maxActive</name>
    <value>4</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>admin</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:odbc:Mess</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>sun.jdbc.odbc.JdbcOdbcDriver</value>
    </parameter>
    <parameter>
    <name>maxIdle</name>
    <value>2</value>
    </parameter>
    <parameter>
    <name>username</name>
    <value>admin</value>
    </parameter>
    </ResourceParams>
    web.xml
    <resource-ref>
    <description>Access Datasource example</description>
    <res-ref-name>jdbc/Mess</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    java class
    Context initContext = new InitialContext();
    DataSource ds = (DataSource)initContext.lookup("java:/comp/env/jdbc/Mess");
    con = ds.getConnection();
    Please help.......

  • EJB Local Interfaces / javax.naming.NamingException

    Hi!
    I have tried to deploy a very simple (Hello World like)EJB-Application. It contains a simple stateless SessionBean (with local interfaces) and a JSP which is using the EJB.
    Opening the JSP i get the following error message:
    javax.naming.NamingException: Error instantiating web-app JNDI-context: No location specified and no suitable instance found for the ejb-local-ref 'ejb/TesterEJB', an EJB matching it's ejb-link 'ejb-jar-ic.jar#TesterEJB' was found, but it contained an Entity, not a Session
    Here's my ejb-jar.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <ejb-jar>
         <display-name>oc4jJAR</display-name>
         <enterprise-beans>
              <session>
                   <display-name>TesterEJB</display-name>
                   <ejb-name>TesterEJB</ejb-name>
                   <local-home>oc4jtest.TesterHome</local-home>
                   <local>oc4jtest.Tester</local>
                   <ejb-class>oc4jtest.TesterBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <security-identity>
                        <description/>
                        <use-caller-identity/>
                   </security-identity>
              </session>
         </enterprise-beans>
         <assembly-descriptor>
              <method-permission>
                   <unchecked/>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>getMessage</method-name>
                        <method-params/>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>getPrimaryKey</method-name>
                        <method-params/>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>getEJBLocalHome</method-name>
                        <method-params/>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>LocalHome</method-intf>
                        <method-name>remove</method-name>
                        <method-params>
                             <method-param>java.lang.Object</method-param>
                        </method-params>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>remove</method-name>
                        <method-params/>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>isIdentical</method-name>
                        <method-params>
                             <method-param>javax.ejb.EJBLocalObject</method-param>
                        </method-params>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>LocalHome</method-intf>
                        <method-name>create</method-name>
                        <method-params/>
                   </method>
              </method-permission>
              <container-transaction>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>getMessage</method-name>
                        <method-params/>
                   </method>
                   <trans-attribute>Required</trans-attribute>
              </container-transaction>
         </assembly-descriptor>
    </ejb-jar>
    And here's my web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
    <web-app>
         <display-name>oc4jWAR</display-name>
         <filter>
              <filter-name>TestFilter</filter-name>
              <display-name>TestFilter</display-name>
              <description/>
              <filter-class>oc4jtest.TestFilter</filter-class>
         </filter>
         <filter-mapping>
              <filter-name>TestFilter</filter-name>
              <url-pattern>*.jsp</url-pattern>
         </filter-mapping>
         <servlet>
              <servlet-name>test</servlet-name>
              <display-name>test</display-name>
              <jsp-file>/test.jsp</jsp-file>
         </servlet>
         <session-config>
              <session-timeout>30</session-timeout>
         </session-config>
         <welcome-file-list>
              <welcome-file>/test.jsp</welcome-file>
         </welcome-file-list>
         <ejb-local-ref>
              <ejb-ref-name>ejb/TesterEJB</ejb-ref-name>
              <ejb-ref-type>Session</ejb-ref-type>
              <local-home>oc4jtest.TesterHome</local-home>
              <local>oc4jtest.Tester</local>
              <ejb-link>ejb-jar-ic.jar#TesterEJB</ejb-link>
         </ejb-local-ref>
    </web-app>
    What's wrong?
    Comments would be appreciated!
    Thanks!
    Peter
    PS: The application runs fine on Sun's Reference Implementation!

    Hi!
    I have tried to deploy a very simple (Hello World like)EJB-Application. It contains a simple stateless SessionBean (with local interfaces) and a JSP which is using the EJB.
    Opening the JSP i get the following error message:
    javax.naming.NamingException: Error instantiating web-app JNDI-context: No location specified and no suitable instance found for the ejb-local-ref 'ejb/TesterEJB', an EJB matching it's ejb-link 'ejb-jar-ic.jar#TesterEJB' was found, but it contained an Entity, not a Session
    Here's my ejb-jar.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <ejb-jar>
         <display-name>oc4jJAR</display-name>
         <enterprise-beans>
              <session>
                   <display-name>TesterEJB</display-name>
                   <ejb-name>TesterEJB</ejb-name>
                   <local-home>oc4jtest.TesterHome</local-home>
                   <local>oc4jtest.Tester</local>
                   <ejb-class>oc4jtest.TesterBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <security-identity>
                        <description/>
                        <use-caller-identity/>
                   </security-identity>
              </session>
         </enterprise-beans>
         <assembly-descriptor>
              <method-permission>
                   <unchecked/>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>getMessage</method-name>
                        <method-params/>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>getPrimaryKey</method-name>
                        <method-params/>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>getEJBLocalHome</method-name>
                        <method-params/>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>LocalHome</method-intf>
                        <method-name>remove</method-name>
                        <method-params>
                             <method-param>java.lang.Object</method-param>
                        </method-params>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>remove</method-name>
                        <method-params/>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>isIdentical</method-name>
                        <method-params>
                             <method-param>javax.ejb.EJBLocalObject</method-param>
                        </method-params>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>LocalHome</method-intf>
                        <method-name>create</method-name>
                        <method-params/>
                   </method>
              </method-permission>
              <container-transaction>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>getMessage</method-name>
                        <method-params/>
                   </method>
                   <trans-attribute>Required</trans-attribute>
              </container-transaction>
         </assembly-descriptor>
    </ejb-jar>
    And here's my web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
    <web-app>
         <display-name>oc4jWAR</display-name>
         <filter>
              <filter-name>TestFilter</filter-name>
              <display-name>TestFilter</display-name>
              <description/>
              <filter-class>oc4jtest.TestFilter</filter-class>
         </filter>
         <filter-mapping>
              <filter-name>TestFilter</filter-name>
              <url-pattern>*.jsp</url-pattern>
         </filter-mapping>
         <servlet>
              <servlet-name>test</servlet-name>
              <display-name>test</display-name>
              <jsp-file>/test.jsp</jsp-file>
         </servlet>
         <session-config>
              <session-timeout>30</session-timeout>
         </session-config>
         <welcome-file-list>
              <welcome-file>/test.jsp</welcome-file>
         </welcome-file-list>
         <ejb-local-ref>
              <ejb-ref-name>ejb/TesterEJB</ejb-ref-name>
              <ejb-ref-type>Session</ejb-ref-type>
              <local-home>oc4jtest.TesterHome</local-home>
              <local>oc4jtest.Tester</local>
              <ejb-link>ejb-jar-ic.jar#TesterEJB</ejb-link>
         </ejb-local-ref>
    </web-app>
    What's wrong?
    Comments would be appreciated!
    Thanks!
    Peter
    PS: The application runs fine on Sun's Reference Implementation!

  • Javax.naming.NoInitialContextException: Cannot instantiate

    IHi,
    Iam trying to run my first application on WEBLOGIC SERVER 8.1. I have already deploed class file on server.i have already set path for my client jar .
    When I use my client run on JDK to access the application.
    I got following errror::::
    Naming Error: catch block of getInitalContext()
    javax.naming.NoInitialContextException: Cannot instantiate
    class: weblogic.jndi.WLInitialContextFactory [Root exception is
    java.lang.ClassNotFoundException:
    weblogic.jndi.WLInitialContextFactory]
    from catch block of jMenuItem1
    error from NamingException.getMessage()is: Cannot instantiate
    class: weblogic.jndi.WLInitialContextFactory
    HERE IS THE CODE FOR CLIENT:
    import java.awt.event.*;
    import javax.rmi.*;
    import java.rmi.*;
    import javax.swing.event.*;
    import javax.swing.*;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    import java.util.Hashtable;
    import java.util.Properties;
    import javax.ejb.CreateException;
    import org.omg.CosNaming.*;
    import java.util.Hashtable;
    import weblogic.jndi.*;
    //import javax.weblogic.jndi.WLInitialContext;
    public class Client {
    public static void main(String[] args){
              Context context= null;
              Hashtable h = new Hashtable();
              h.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
              h.put(Context.PROVIDER_URL,"t3://localhost:7001");
              try{
                   context = new InitialContext(h);
                        Object obj = context.lookup("ServerObject"); //Server ejb-name
    System.out.println(obj.getClass());
              ServerHome serverhome =(ServerHome) javax.rmi.PortableRemoteObject.narrow(context.lookup("ServerObject"),ServerHome.class);
              Server server = serverhome.create();
              String Message = JOptionPane.showInputDialog("Enter Your Message");
              JOptionPane.showMessageDialog(null, server.performAction(Message) );
         catch(Exception e){
              JOptionPane.showMessageDialog(null ,"Exception is " +e);
    code for bean:::::::
    //package EJBExample;
    import javax.ejb.*;
    import java.rmi.*;
    import javax.swing.*;
    public class ServerBean implements SessionBean
    private SessionContext stx;
    //In following five methods create is by contract others to be implemented by Container
    public void ejbCreate(){}
    public void ejbRemove(){}
    public void ejbActivate(){}
    public void ejbPassivate(){}
    public void setSessionContext(SessionContext ctx)

    hi
    Am facing the problem whenever i run the client jsp definitly run the first time but next time i get the particular error please let me clear about this error i m attaching the client code and also error screen..
    client jsp
    <%UserInfoSB objUserInfoSB;
         System.out.println("########## 2 #########");
         Properties props= System.getProperties();
         System.out.println("########## 3 #########");
         Context ctx = new InitialContext(props);
         System.out.println("########## 4 #########");
         props.put(Context.INITIAL_CONTEXT_FACTORY, "Weblogic.jndi.WlInitialContextFactory");
         props.put(Context.PROVIDER_URL,"t3://localhost:7001");
         System.out.println("########## 5 #########");
         UserInfoSBHome objUserInfoSBHome =(UserInfoSBHome) ctx.lookup("UserInfoSBHome");
         System.out.println("########## 6 #########");
         objUserInfoSB = objUserInfoSBHome.create();
         System.out.println("########## 7 #########");
         //objUserInfoSB.processInterfaceUserHistoryDetails(objUserDetailVO);
    ArrayList alResult = objUserInfoSB.processInterfaceGetAllUserDetail();
         objUserInfoSB.remove();
         System.out.println("########## 8 #########");
    %>
    It is error which i am facing plz let me clear
    NoInitialContextException: Cannot instantiate class: Weblogic.jndi.WlInitialContextFactory. Root exception is java.lang.ClassNotFoundException: Weblogic.jndi.WlInitialContextFactory
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:186)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:62)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:41)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:217)
         at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
         at javax.naming.InitialContext.init(InitialContext.java:219)
         at javax.naming.InitialContext.(InitialContext.java:195)
         at jsp_servlet._jsp._epfindia._mydata.__userdisplayall._jspService(__userdisplayall.java:374)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6291)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:97)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3575)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)

  • OpenEJB and javax.naming.NamingException

    Hello
    I got following error when running my EJB Client
    Cannot lookup /Hello: Received error: Error while communicating with server: ; nested exception is:
         java.rmi.RemoteException: Cannot read the response from the server.; nested exception is:
         java.io.EOFException
    This is the part of code
    Properties p = new Properties();
    p.put("java.naming.factory.initial", "org.openejb.client.RemoteInitialContextFactory");
    p.put("java.naming.provider.url", "127.0.0.1:4201");
    InitialContext initCtx = new InitialContext(p);
    Object object = initCtx.lookup( "/Hello" );
    And this the the command line :)
    "C:\Program Files\JBuilderX\jdk1.4\bin\javaw" -classpath "D:\Work\test1\classes;C:\Program Files\JBuilderX\thirdparty\jakarta-tomcat-4.1.27-LE-jdk14\common\lib\servlet.jar;D:\Work\test1\WebModule1\myHelloEjb.zip;D:\Work\EJB\ejb-2_1-api.jar;C:\openejb\lib\openejb-core-1.0-20050917.jar;C:\openejb\lib\openejb-itests-client.jar;C:\openejb\lib\openejb-loader-1.0-20050917.jar;D:\Java-Libs\jndi.jar;C:\Program Files\JBuilderX\jdk1.4\demo\jfc\Java2D\Java2Demo.jar;C:\Program Files\JBuilderX\jdk1.4\demo\plugin\jfc\Java2D\Java2Demo.jar;C:\Program Files\JBuilderX\jdk1.4\jre\javaws\javaws.jar;C:\Program Files\JBuilderX\jdk1.4\jre\lib\charsets.jar;C:\Program Files\JBuilderX\jdk1.4\jre\lib\ext\dnsns.jar;C:\Program Files\JBuilderX\jdk1.4\jre\lib\ext\ldapsec.jar;C:\Program Files\JBuilderX\jdk1.4\jre\lib\ext\localedata.jar;C:\Program Files\JBuilderX\jdk1.4\jre\lib\ext\sunjce_provider.jar;C:\Program Files\JBuilderX\jdk1.4\jre\lib\im\indicim.jar;C:\Program Files\JBuilderX\jdk1.4\jre\lib\im\thaiim.jar;C:\Program Files\JBuilderX\jdk1.4\jre\lib\jce.jar;C:\Program Files\JBuilderX\jdk1.4\jre\lib\jsse.jar;C:\Program Files\JBuilderX\jdk1.4\jre\lib\plugin.jar;C:\Program Files\JBuilderX\jdk1.4\jre\lib\rt.jar;C:\Program Files\JBuilderX\jdk1.4\jre\lib\sunrsasign.jar;C:\Program Files\JBuilderX\jdk1.4\lib\dt.jar;C:\Program Files\JBuilderX\jdk1.4\lib\htmlconverter.jar;C:\Program Files\JBuilderX\jdk1.4\lib\tools.jar" -Dopenejb.home=c:\openejb test1.testEJB
    Why I got this error? Please help me.
    Thanks.

    You really are going to kick yourself !!
    Looks like a combination of a missing, or non existent OU and a typo !
    You are trying to create a subcontext named:"cn=jain,ou=orgunit,DN=praveendomain"I think you meant:"cn=jain,ou=orgunit,DC=praveendomain"Also if the OU"ou=orgunit,DC=praveendomain" does not exist, you will also get an error. In general, the Active Directory DSID error message will identify the incorrect distinguished name javax.naming.NamingException: [LDAP: error code 1 - 000020D6: SvcErr: DSID-031006CC, problem 5012 (DIR_ERROR), data 0
    ;remaining name 'cn=jain,ou=orgunit,DN=praveendomain'

  • Javax.naming.NamingException.  Root exception is java.lang.NoSuchMethodError

    I am using WLS5.1 inside visualage environment. I am trying to run
    a Simple EJB which connects to the database and executes two simple
    queries. The client code is as shown below:
    try{
    Context ic = getInitialContext();
    System.out.println("Initial Context created......"); java.lang.Object
    objref = ic.lookup("simpleBean.AtmHome"); System.out.println("objref
    created......");
    AtmHome home = (AtmHome) PortableRemoteObject.narrow(objref, AtmHome.class);
    System.out.println("home created......");
    Atm atm = home.create();
    System.out.println("atm created......");
    atm.transfer(8, 9, 100000);
    catch (NamingException ne)
    ne.printStackTrace(System.out);
    finally {
         try {
              ic.close();
              System.out.println("Closed the connection");
         catch (Exception e) {
              System.out.println("Exception while closing context....." );
    The above code executes fine for the first time but second time
    it throws an exception "javax.naming.NamingException.
    Root exception is java.lang.NoSuchMethodError"
    javax.naming.NamingException. Root exception is java.lang.NoSuchMethodError
         java.lang.Throwable()
         java.lang.Error()
         java.lang.LinkageError()
         java.lang.IncompatibleClassChangeError()
         java.lang.NoSuchMethodError()
         void javax.naming.NameImpl.recordNamingConvention(java.util.Properties)
         void javax.naming.NameImpl.recordNamingConvention(java.util.Properties)
         javax.naming.NameImpl(java.util.Properties)
         javax.naming.CompositeName()
         weblogic.jndi.toolkit.NormalName(java.lang.String, javax.naming.NameParser)
         weblogic.jndi.toolkit.NormalName weblogic.jndi.toolkit.BasicWLContext.normalizeName(java.lang.String)
         java.lang.Object weblogic.jndi.toolkit.BasicWLContext.lookup(java.lang.String)
         weblogic.rmi.extensions.OutgoingResponse weblogic.jndi.toolkit.BasicWLContext_WLSkel.invoke(weblogic.rmi.extensions.ServerObjectReference,
    int, weblogic.rmi.extensions.IncomingRequest, weblogic.rmi.extensions.OutgoingResponse)
         java.lang.Throwable weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(int,
    weblogic.rmi.extensions.IncomingRequest)
         void weblogic.rmi.extensions.BasicRequestHandler.handleRequest(weblogic.rmi.extensions.IncomingRequest)
         void weblogic.rmi.internal.BasicExecuteRequest.execute(weblogic.kernel.ExecuteThread)
         void weblogic.kernel.ExecuteThread.run()
    --------------- nested within: ------------------
    weblogic.rmi.ServerError: A RemoteException occurred in the server
    method
    - with nested exception:
    [java.lang.NoSuchMethodError:
    Start server side stack trace:
    java.lang.NoSuchMethodError
         java.lang.Throwable()
         java.lang.Error()
         java.lang.LinkageError()
         java.lang.IncompatibleClassChangeError()
         java.lang.NoSuchMethodError()
         void javax.naming.NameImpl.recordNamingConvention(java.util.Properties)
         void javax.naming.NameImpl.recordNamingConvention(java.util.Properties)
         javax.naming.NameImpl(java.util.Properties)
         javax.naming.CompositeName()
         weblogic.jndi.toolkit.NormalName(java.lang.String, javax.naming.NameParser)
         weblogic.jndi.toolkit.NormalName weblogic.jndi.toolkit.BasicWLContext.normalizeName(java.lang.String)
         java.lang.Object weblogic.jndi.toolkit.BasicWLContext.lookup(java.lang.String)
         weblogic.rmi.extensions.OutgoingResponse weblogic.jndi.toolkit.BasicWLContext_WLSkel.invoke(weblogic.rmi.extensions.ServerObjectReference,
    int, weblogic.rmi.extensions.IncomingRequest, weblogic.rmi.extensions.OutgoingResponse)
         java.lang.Throwable weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(int,
    weblogic.rmi.extensions.IncomingRequest)
         void weblogic.rmi.extensions.BasicRequestHandler.handleRequest(weblogic.rmi.extensions.IncomingRequest)
         void weblogic.rmi.internal.BasicExecuteRequest.execute(weblogic.kernel.ExecuteThread)
         void weblogic.kernel.ExecuteThread.run()
    End  server side stack trace
         weblogic.rmi.extensions.WRMIInputStream weblogic.rmi.extensions.AbstractRequest.sendReceive()
         java.lang.Object weblogic.jndi.toolkit.BasicWLContext_WLStub.lookup(java.lang.String)
         java.lang.Object weblogic.jndi.toolkit.WLContextStub.lookup(java.lang.String)
         java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
         void simpleBean.AtmClient.main(java.lang.String [])
    NamingException is caught....
    I found out that it hangs at lookup function in the above code.
    Please let me know if I am missing any environment settings.
    Thanks
    Shailaja

    This problem is solved after installing service pack 8 for weblogic
    5.1
    -shailaja
    "shailaja" <[email protected]> wrote:
    >
    I am using WLS5.1 inside visualage environment. I am trying
    to run
    a Simple EJB which connects to the database and executes
    two simple
    queries. The client code is as shown below:
    try{
    Context ic = getInitialContext();
    System.out.println("Initial Context created......"); java.lang.Object
    objref = ic.lookup("simpleBean.AtmHome"); System.out.println("objref
    created......");
    AtmHome home = (AtmHome) PortableRemoteObject.narrow(objref,
    AtmHome.class);
    System.out.println("home created......");
    Atm atm = home.create();
    System.out.println("atm created......");
    atm.transfer(8, 9, 100000);
    catch (NamingException ne)
    ne.printStackTrace(System.out);
    finally {
         try {
              ic.close();
              System.out.println("Closed the connection");
         catch (Exception e) {
              System.out.println("Exception while closing context....."
    The above code executes fine for the first time but second
    time
    it throws an exception "javax.naming.NamingException.
    Root exception is java.lang.NoSuchMethodError"
    javax.naming.NamingException. Root exception is java.lang.NoSuchMethodError
         java.lang.Throwable()
         java.lang.Error()
         java.lang.LinkageError()
         java.lang.IncompatibleClassChangeError()
         java.lang.NoSuchMethodError()
         void javax.naming.NameImpl.recordNamingConvention(java.util.Properties)
         void javax.naming.NameImpl.recordNamingConvention(java.util.Properties)
         javax.naming.NameImpl(java.util.Properties)
         javax.naming.CompositeName()
         weblogic.jndi.toolkit.NormalName(java.lang.String, javax.naming.NameParser)
         weblogic.jndi.toolkit.NormalName weblogic.jndi.toolkit.BasicWLContext.normalizeName(java.lang.String)
         java.lang.Object weblogic.jndi.toolkit.BasicWLContext.lookup(java.lang.String)
         weblogic.rmi.extensions.OutgoingResponse weblogic.jndi.toolkit.BasicWLContext_WLSkel.invoke(weblogic.rmi.extensions.ServerObjectReference,
    int, weblogic.rmi.extensions.IncomingRequest, weblogic.rmi.extensions.OutgoingResponse)
         java.lang.Throwable weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(int,
    weblogic.rmi.extensions.IncomingRequest)
         void weblogic.rmi.extensions.BasicRequestHandler.handleRequest(weblogic.rmi.extensions.IncomingRequest)
         void weblogic.rmi.internal.BasicExecuteRequest.execute(weblogic.kernel.ExecuteThread)
         void weblogic.kernel.ExecuteThread.run()
    --------------- nested within: ------------------
    weblogic.rmi.ServerError: A RemoteException occurred in
    the server
    method
    - with nested exception:
    [java.lang.NoSuchMethodError:
    Start server side stack trace:
    java.lang.NoSuchMethodError
         java.lang.Throwable()
         java.lang.Error()
         java.lang.LinkageError()
         java.lang.IncompatibleClassChangeError()
         java.lang.NoSuchMethodError()
         void javax.naming.NameImpl.recordNamingConvention(java.util.Properties)
         void javax.naming.NameImpl.recordNamingConvention(java.util.Properties)
         javax.naming.NameImpl(java.util.Properties)
         javax.naming.CompositeName()
         weblogic.jndi.toolkit.NormalName(java.lang.String, javax.naming.NameParser)
         weblogic.jndi.toolkit.NormalName weblogic.jndi.toolkit.BasicWLContext.normalizeName(java.lang.String)
         java.lang.Object weblogic.jndi.toolkit.BasicWLContext.lookup(java.lang.String)
         weblogic.rmi.extensions.OutgoingResponse weblogic.jndi.toolkit.BasicWLContext_WLSkel.invoke(weblogic.rmi.extensions.ServerObjectReference,
    int, weblogic.rmi.extensions.IncomingRequest, weblogic.rmi.extensions.OutgoingResponse)
         java.lang.Throwable weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(int,
    weblogic.rmi.extensions.IncomingRequest)
         void weblogic.rmi.extensions.BasicRequestHandler.handleRequest(weblogic.rmi.extensions.IncomingRequest)
         void weblogic.rmi.internal.BasicExecuteRequest.execute(weblogic.kernel.ExecuteThread)
         void weblogic.kernel.ExecuteThread.run()
    End  server side stack trace
         weblogic.rmi.extensions.WRMIInputStream weblogic.rmi.extensions.AbstractRequest.sendReceive()
         java.lang.Object weblogic.jndi.toolkit.BasicWLContext_WLStub.lookup(java.lang.String)
         java.lang.Object weblogic.jndi.toolkit.WLContextStub.lookup(java.lang.String)
         java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
         void simpleBean.AtmClient.main(java.lang.String [])
    NamingException is caught....
    I found out that it hangs at lookup function in the above
    code.
    Please let me know if I am missing any environment settings.
    Thanks
    Shailaja

  • Javax.servlet.ServletException: Cannot create bean of class

    People,
    HELP!! I am getting desperate!!!
    I am a newbie when it comes to TOMCAT, but i have been using Blazix before.
    My current system is using APACHE/TOMCAT on a Solaris machine and I keep hitting the same problem. I have gone through the archives but the only thing it states is to check the directory which i have done.
    I keep getting:
    Error 500
    Internal Error
    javax.servlet.ServletException: Cannot create bean of class MyClass
    The code used to work on the Blazix server so i am assuming it is something to do with a config parameter somewhere - but i do not know where. I have checked the directory/package structure and they seem to work. It even serves it when they are html pages not jsp, but obviously wont use the bean. :(
    I can post code if necessary.
    Please help
    Steve

    The FormData.class file is in examples/WEB-INF/classes/ directory.
    Is this wrong? then should it be in a package called examples.steve???
    <TITLE> Poc </TITLE>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <META NAME="Generator" CONTENT="Mozilla/4.61 [en] (WinNT; I) [Netscape]">
    <META NAME="Author" CONTENT="Steve Brodie">
    <META NAME="Proof of Concept order entry system" CONTENT="">
    <META NAME="PROOF OF CONCEPT ORDER ENTRY SYSTEM " CONTENT="">
    </HEAD>
    <%@ page import="steve.FormData" %>
    <jsp:useBean id="user" class="steve.FormData"/>
    <jsp:setProperty name="user" property="*"/>
    <FORM METHOD=POST ACTION="SaveDetails.jsp">
    <CENTER>
    <H1>     
    POC CNS demo <BR>
    POC Order Entry System <BR></H1>
    <H2><CENTER>PROOF OF CONCEPT ORDER ENTRY SYSTEM <BR>
    in order to illustrate the use of an new product<BR></H1>
    </CENTER>
    <BODY>
    Please enter the following details: <BR>
    Second name <INPUT TYPE=TEXT NAME=secondName SIZE=20><BR>
    First name <INPUT TYPE=TEXT NAME=firstName SIZE=20><BR>
    Address <INPUT TYPE=TEXT NAME=address1 SIZE=20><BR>
    Address <INPUT TYPE=TEXT NAME=address2 SIZE=20><BR>
    Post Code <INPUT TYPE=TEXT NAME=postCode SIZE=10><BR>
    Phone NO. <INPUT TYPE=TEXT NAME=phone SIZE=10><BR>
    <BR>
    Credit Card<INPUT TYPE=TEXT NAME=credit SIZE=15><BR>
    <BR>
    Quality of Service:
    <SELECT TYPE=TEXT NAME="QoS">
    <OPTION SELECTED TYPE=TEXT NAME=Gold>Gold <BR>
    <OPTION TYPE=TEXT NAME=Silver>Silver <BR>
    <OPTION TYPE=TEXT NAME=Bronze>Bronze <BR>
    </SELECT>
    <BR>
    <BR>
    <INPUT TYPE=RESET>
    <P><INPUT TYPE=SUBMIT>
    <BR>
    <BR>
    <IMG SRC=../images/Cisco.gif>
    </FORM>
    </BODY>
    </HTML>
    package steve;
    * @author Steven Brodie
    * @date
    * @version 0.0
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    public class FormData {
         String secondName = null;
         String firstName = null;
         String address1 = null;
         String address2 = null;
         String postCode = null;
         int credit = 0;
         int phone = 0;
         String qos = null;
         String file = "out";
         String filex = "xout";
         PrintWriter pout = null;
         PrintWriter xout = null;
         FormData() {
              try {
                   pout = new PrintWriter(new BufferedWriter(new FileWriter(file + ".txt")));
                   xout = new PrintWriter(new BufferedWriter(new FileWriter(filex + ".xml")));
              xout.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
              xout.println("<OrderEntry xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"");
              xout.println("xsi:noNamespaceSchemaLocation=\"http://machine2.com:8080/xml/xsd/OrderEntry.xsd\">");
              } catch (IOException ioe) {
                   System.err.println("DataFileWriter error ioe on init");
                   ioe.printStackTrace();
                   System.exit(1);
    public void setFirstName( String value ) {
    firstName = value;
              System.out.println(firstName);
              pout.println(firstName);
              xout.println("<firstname value= \"" + firstName + "\"/>");
    public void setSecondName( String value ) {
    secondName = value;
              System.out.println(secondName);
              pout.println(secondName);
              xout.println("<secondname value= \"" + secondName + "\"/>");
    public void setAddress1( String value ) {
    address1 = value;
              System.out.println(address1);
         pout.println(address1);
              xout.println("<address1 value= \"" + address1 + "\"/>");
    public void setAddress2( String value ) {
    address2 = value;
              System.out.println(address2);
              pout.println(address2);
              xout.println("<address2 value= \"" + address2 + "\"/>");
    public void setPostCode( String value ) {
    postCode = value;
              System.out.println(postCode);
              pout.println(postCode);
              xout.println("<postCode value= \"" + postCode + "\"/>");
    public void setCredit( int value ) {
    credit = value;
              System.out.println(credit);
              pout.println(credit);
              xout.println("<creditCard value= \"" + credit + "\"/>");
         public void setPhone( int value) {
              phone = value;
              System.out.println("0" + phone);
              pout.println("0" + phone);
              xout.println("<phoneNo value= \"0" + phone + "\"/>");
    public void setQoS( String value ) {
    qos = value;
              System.out.println(qos);
              pout.println(qos);
              xout.println("<QoS value= \"" + qos + "\"/>");
              xout.println("</OrderEntry>");
              pout.flush();
              pout.close();
              xout.flush();
              xout.close();
    public String getFirstName() {
              return firstName;
    public String getSecondName() {
              return secondName;
    public String getAddress1() {
              return address1;
    public String getAddress2() {
              return address2;
    public String getPostCode() {
              return postCode;
    public int getCredit() {
              return credit;
         public int getPhone() {
              return phone;
         public String getQoS() {
              return qos;

  • Quartz in OC4J: javax.naming.NamingException

    We are running Quartz inside OC4J.
    We start OC4J with -userThreads turned on (e.g. java -jar oc4j.jar -userThreads).
    When the Quartz Job fires we do a Context lookup from the inside the Quartz execute() method to find a JMS QueueConnectionFactory and a JMS Queue.
    We are getting the following error on the Context lookup:
    06/02/15 06:40:30 Not in an application scope - start OC4J with the -userThreads switch if using user-created threads
    06/02/15 06:40:30 javax.naming.NamingException: Not in an application scope - start OC4J with the -userThreads switch if using user-created threads
    06/02/15 06:40:30 at com.evermind.server.PreemptiveApplicationContext.getContext(PreemptiveApplicationContext.java:30)
    06/02/15 06:40:30 at com.evermind.naming.FilterContext.lookup(FilterContext.java:126)
    06/02/15 06:40:30 at com.evermind.server.PreemptiveApplicationContext.lookup(PreemptiveApplicationContext.java:42)
    06/02/15 06:40:30 at javax.naming.InitialContext.lookup(InitialContext.java:351)
    06/02/15 06:40:30 at timers.JmsEndpoint.createQueue(JmsEndpoint.java:404)
    06/02/15 06:40:30 at timers.JmsEndpoint.createQueueSender(JmsEndpoint.java:82)
    06/02/15 06:40:30 at timers.TaskQueueScheduler.execute(TaskQueueScheduler.java:149)
    06/02/15 06:40:30 at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
    06/02/15 06:40:30 at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
    We have tried the oracle.j2ee.rmi.RMIInitialContextFactory and the oracle.j2ee.naming.ApplicationClientInitialContextFactory naming factories and get the same error with both.
    Any ideas?
    Thanks, Ed

    Avi
    I tried the default Context factory as you suggested and that didn't work either. I think the problem is related to the fact that Quartz is running on it's own thread within the same JVM as OC4J and may not have scope to the same Context object(s) that OC4J has.
    I did find a way to make this work. Before calling the Quartz Scheduler I used the OC4J Context object to lookup a JMS Queue and put the JMS QueueSender object into the Quartz JobDataMap object. I then scheduled the Quartz timer passing in the JobDataMap object. When the timer fires and my Quartz Job execute() method is called I retrieve the JMS QueueSender object from the JobDataMap and use it to send a JMS message.
    Thanks for your help,
    Ed

  • Javax.naming.NamingException

    When I run the following deployment. . .
    java -jar ../../admin.jar ormi://localhost admin 123456 -deploy -file csldc.ear
    I get this . . .
    Error: javax.naming.NamingException: Lookup error: java.net.ConnectException: Co
    nnection refused: connect; nested exception is: java.net.ConnectException: Connection refused: connect
    any ideas???????

    First, make sure oc4j is started. oc4j ships with default configuration which starts http listener at port 8888. Browse to http://localhost:8888 and you should see oc4j default website. If not, check default-web-site to see if the port is any different.
    Also, ormi runs at port 23791 by default. If you have changed the port 23791 in rmi.xml, you must use java -jar admin.jar ormo://localhost:<port> .... to deploy your file
    null

  • Javax.naming.NamingException: Failed in WD JNDI lookup

    Hi,
               I have deployed wdj applications,some times its working fine ,but some other times its through the following errors.
    javax.naming.NamingException: Failed in WD JNDI lookup
    Any one please suggest me
    Thanks,
    Venu

    Hi Friend,
    I am not sure what Other Reason can be for this problem mean while check these links. Hope it will help.
    /message/6928201#6928201 [original link is broken]
    /message/6315352#6315352 [original link is broken]
    Regards
    Jeetendra

  • Javax.naming.NamingException    Please Helppppp !!

    Hi,
    There is my code :
    "PropertyResourceBundle namingProperties =
    (PropertyResourceBundle) PropertyResourceBundle.getBundle("MyAppNaming");
    Hashtable properties = getPropertyFromRB(namingProperties);
    initContext = new javax.naming.InitialContext(properties);
    java.lang.Object obj = initialContext.lookup(jndiName);"
    The last line returns an Exception :
    javax.naming.NamingException: Error during resolve [Root exception is java.lang.NullPointerException]
    The Application server containing the EJBs is well started, and the JNDI name for the EJbs in the application server and in my application are the same...
    Where am i wrong ??
    Thanks in advance for your help
    Steve

    Help me please, i become crazy with this problem !!
    Thanks
    Steve

Maybe you are looking for

  • How to use dynamic SQL in this case for best performance

    I have the table with following columns ID NUMBER, DATA LONG, TAG VARCHAR2(255) Records in this table will be like following 1 this is an abstract ABSTRACT 1 this is author AUTHOR 1 100 PRICE 2 this is an abstract ABSTRACT 2 this is author AUTHOR 3 c

  • Get a specific cluster out of a datalog file

    HI! I'm saving a cluster with controls (boolean, dbl, u32...) into a datalog file. For several different settings of the controls I'm saving the clusters consecutively in to the file. Is there a way to directly access a certain position at the file,

  • Failed to play (stream ID: 1).

    Hi all, I'm trying to simply stream audio from a FCS using akamai, I can give you the stream if necessary, but for now I'd prefer to keep it private. I can connect (NetConnection.Connect.Success), but the net stream then fails. // CODE nc = new NetCo

  • InDesign trial version won't install

    I've downloaded the trial version for InDesign of this website, because I'm applying for a job where I'll need to know how to use it. Strange enough, I can't get it installed on my laptop (an Acer Aspire 5720G). After the system check I get a message

  • IPhoto app - help!

    Hi all, I've been using the iPhoto app for my iPad and have been loving it.  It does really cool things with our pictures.  However, I just ran into a huge problem.  I was not aware that iPhoto has been drastically reducing the file size / resolution