Error in datasource context lookup using OC4J

Hi friends
When I try to get de DataSource,
ictx = new InitialContext();
dat = (DataSource)ictx.lookup("jdbc/GirsaOracleDS");
conn = dat.getConnection();
I get te following error:
javax.naming.NameNotFoundException: jdbc/GirsaOracleDS not found
My data-sources.xml:
<data-source
class="com.evermind.sql.DriverManagerDataSource"
name="GirsaOracleDS"
location="jdbc/GirsaOracleCoreDS"
xa-location="jdbc/xa/GirsaOracleDS"
ejb-location="jdbc/GirsaOracleDS"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="girsa"
password="girsa"
url="jdbc:oracle:thin:@server-ora:1521:orcl"
inactivity-timeout="30"
/>
Can anybody help me?
thanks!

On Note 557738.1 - Export/Import, Section 5 Step 4, I executed "perl dpost_imp.pl dpost_imp.drv" on the source server and created the required driver. Moved to the target and when applying with adpatch, it failed with:
AutoPatch error:
adprdf(): At line 62 in file dpost_imp.drv:
Error extension recordpatch line missing from patch driver file.
You should check the file
I opened an SR yesterday and after many hours, I was told to:
a) backup current file dpostimpl.drv
b) edit driver file dpostimpl.drv and made the following change
# dpost_imp.drv generated by dpost_imp.pl
begin aru fix_postimp
compatible release 12.0.0
begin bug au fix_postimp
begin actions
TO
# dpost_imp.drv generated by dpost_imp.pl
begin aru fix_postimp
compatible release 12.0.0
extension recordpatch 6924477 US
begin bug au fix_postimp
begin actions
c) Save and re-try apply driv dpostimpl.drv via autopatch.
I did the changes, ran adpatch and the error is still there:
adpatch logfile=dpost_imp.drv2.log patchtop=/EBS_12i_downloads/patches driver=dpost_imp.drv workers=8
AutoPatch error:
adprdf(): At line 68 in file dpost_imp.drv:
'end bug au fix_ctxsys' encountered while 'bug au fix_postimp' is open
Line 68 is:
end bug au fix_ctxsys
Has someone got knowledge of what is needed here?You are applying an 11i patch (as you are following [ID 557738.1]) so the "compatible release 12.0.0" line is not correct and it should be "compatible release 11.5.0" instead. Are you sure you are referring the steps in (Export/import notes on Applications 11i Database 11g [ID 557738.1]) not the steps in (Export/import process for R12 using 11gR1 or 11gR2 [ID 741818.1]) or (Export/Import Process for Oracle E-Business Suite Release 12 using 10gR2 [ID 454616.1])?
Have you already updated the SR with the outcome of their change?
Thanks,
Hussein

Similar Messages

  • Unknown site error while deploying web services using OC4J

    Hi,
    I have been testing the deploying webservices examples using demo.zip on OTN site.
    I have trouble in binding the web application name to stand alone OC4J.
    I am running stand alone OC4J server fine. I verified the website http://localhost:8888, which is running fine.
    If I issue the command
    java -jar admin.jar ormi://localhost:23791 admin password1 -bindwebapp demo_ejb_web_service HelloService_web http://localhost:8888/ sejb_webservices
    I get error
    oracle.oc4j.admin.internal.DeployerException: Unknown site: http://localhost:8888/
    What is the http-web-site address that needs to be given for binding web app, if I am running local standalone OC4J with no default port changes?
    Thanks,
    Mohan

    Eric,
    Thanks for the response. But, still I am not able to bind web-application to OC4J.
    Here is how my server.xml has defined the web-site tag:
    <web-site default="true" path="./http-web-site.xml" />
    My http-web-site.xml has following web-site tag:
    <web-site port="8888" display-name="OC4J 10g (10.0.2) HTTP Web Site">
    <default-web-app application="default" name="defaultWebApp"/>
    <web-app application="default" name="dms0" root="/dms0" access-log="false" />
    <web-app application="default" name="dms0" root="/dmsoc4j" access-log="false" />
    <web-app application="default" name="admin_web" root="/adminoc4j"/>
    <access-log path="../log/http-web-access.log"/>
    </web-site>
    I used the following command to bind the example web service:
    java -jar c:\XtendTools\oc4j\j2ee\home\admin.jar ormi://localhost admin password1 -bindWebApp demo_ejb_service HelloService_web default-web-site /sejb_services
    I get "oracle.oc4j.admin.internal.DeployerException: Unknown site: default-web-site" error.
    I tried to use following names as http-web-site, but nothing works.
    "http://localhost:8888"
    "dms0"
    "adminoc4j"
    I downloaded stand alone OC4J 10.1.2 from OTN and tried these samples.
    Your help will be appreciated.
    Thanks,
    Mohan

  • Error when using OC4J Datasource

    Hi,
    A customer is using a Servlet to run in an OC4j instance and is using EJB's for data DML.
    To work around the possibility that XMLTypes are not supported we do an update in the DoPost.
    public void ejbPostCreate(String mediumnummer, String inzender, String inhoud, PrlBerichttypeLocal prlBerichttypeLocal)
    OracleConnection oconnection = null;
    OraclePreparedStatement opstmt = null;
    CLOB tempCLOB = null;
    try
    oconnection = (OracleConnection)getConnection();
    String sql = "";
    sql += "update prl_xml_berichten SET ";
    sql += "INHOUD = XMLTYPE(?) where id = ?";
    opstmt = (OraclePreparedStatement)oconnection.prepareCall(sql);
    System.out.println(sql);
    System.out.println("username : "+ oconnection.getMetaData().getUserName());
    tempCLOB = CLOB.createTemporary(oconnection,true,CLOB.DURATION_SESSION);
    Writer writer = tempCLOB.getCharacterOutputStream();
    writer.write(inhoud);
    writer.flush();
    writer.close();
    opstmt.setCLOB(1,tempCLOB);
    opstmt.setLong(2,id.longValue());
    boolean test = opstmt.execute();
    tempCLOB.trim(0);
    if (!test) System.out.println("Succes !!!!");
    else System.out.println("Failure!!!");
    // connection.commit();
    catch (Exception exc)
    System.out.println("Fout bij inhoud update ");
    exc.printStackTrace();
    finally
    try
    if (opstmt != null) opstmt.close();
    if (oconnection != null) oconnection.close();
    System.out.println("create dopost gedaan...");
    catch (SQLException sqlex)
    sqlex.getMessage();
    System.out.println("Fout bij afsluiten dopost");
    When they are using the getConnection from the Datasource:
    private Connection getConnection() throws NamingException, SQLException
    InitialContext context = new InitialContext();
    DataSource dataSource = null;
    // Look up data source object in directory service using JNDI
    dataSource = (DataSource)context.lookup("jdbc/prlDS");
    // Establishing db connection
    return dataSource.getConnection();
    The following error occurs:
    username : PRL
    create dopost gedaan...
    com.evermind.server.rmi.OrionRemoteException: javax.ejb.EJBException: java.lang.AbstractMethodError: oracle.jdbc.OracleConnection oracle.jdbc.OracleConnection.unwrap()
    java.rmi.RemoteException com.evermind.server.ejb.EJBUtils.getUserException(java.lang.Throwable, boolean) EJBUtils.java:263
    java.lang.String CheckIn_StatelessSessionBeanWrapper8.checkInMessage(java.lang.String[]) CheckIn_StatelessSessionBeanWrapper8.java:126
    When we change it to the connection setup with a hard string it does work:
    private Connection getConnection() throws NamingException, SQLException
    DriverManager.registerDriver(new OracleDriver());
    return DriverManager.getConnection(Receiver.DATASOURCE);
    Does anybody have an idea what the difference is with the direct connect string or the datasource from OC4J.
    I attached the full error and the datasource.xml.
    Regards,
    Remco

    Hi Remco,
    You may not be aware of this, but the "Connection" returned from a "DataSource" is not necessarily the same as the one returned from "DriverManager". If I remember correctly, there was a similar question to yours posted to this forum, not so long ago. As I recall, Steve Button mentioned that there are emulated and non-emulated "Connection"s. I saw no mention in your post regarding which version of OC4J you are using, so I will assume the latest, stand-alone, production version (9.0.3). The Data Sources chapter of Oracle9iAS Containers for J2EE Services Guide has more details.
    Good Luck,
    Avi.

  • Error in connecting to database using a datasource in a jsp file

    Dear SDN's,
    I have a program which retreives Data from the Employee table and displays on portal page.
    What i have done is,
    I have created a pageprocessor component, with 2 jsp files one is for data insert and other is for retriving the data from the database table.
    For inserting the records, i have written the code in the Even handling method of Page Proceessor component.
    For retriving the data i have written the following jsp code in the jsp file and this i am calling in PBO of pageprocessor component based on the condition.
    When i try to insert the records it is working fine.But i am getting an error when try to execute the retreving the records in other jsp.
    Please go through the following code and correct me if anything is wrong here.
    <b><%@ page language="java" %>
    <%@ page import ="java.lang.*,java.sql.Connection,javax.sql.DataSource,java.sql.Statement,java.sql.ResultSet,javax.naming.InitialContext" %>
    <body>
    <center>
         <table border="1">
         <tr cellpadding="1">
         <th>Empid</th>
         <th>Name</th>
         <th>City</th>
         </tr>
    <%
         InitialContext initialContext = new InitialContext();
         DataSource ds = (DataSource) initialContext.lookup("jdbc/MyDS");
         Connection conn = ds.getConnection();
         stmt = conn.createStatement();     
         ResultSet rs=stmt.executeQuery("select * from EMP_DETAILS");
         while(rs.next())
              out.println(rs.getString("EMPID"));
              out.println(rs.getString("NAME"));
              out.println(rs.getString("CITY"));
         %>
         <tr cellpadding="1">
              <td><%=rs.getString("EMPID")%></TD>
              <TD><%=rs.getString("NAME")%></td>
              <td><%=rs.getString("CITY")%></td>
              <br>
              </table>
              catch (Exception e) {                    
         e.printStackTrace();
         out.println("Exception" + e);     
              }</b>
    The error what i am getting is.
      Portal Runtime Error
    An exception occurred while processing a request for :
    iView : JSPdbProject.Empjava
    Component Name : JSPdbProject.Empjava
    Error occurs during the rendering of jsp component.
    Exception id: 04:29_16/11/06_0005_507480350
    See the details for the exception ID in the log file

    Hi Sumathi,
    here is the error log.
    #1.5#0017087C79D800760000004700001C000004225B24927786#1163674757780#com.sap.portal.portal#sap.com/irj#com.sap.portal.portal#J2EE_ADMIN#10231##OBTDEV15_O50_507480350#J2EE_ADMIN#6afb6760756111dbaf3c0017087c79d8#SAPEngine_Application_Thread[impl:3]_24##0#0#Error#1#/System/Server#Java###Exception ID:04:29_16/11/06_0005_507480350
    [EXCEPTION]
    #1#com.sapportals.portal.prt.component.PortalComponentException: Error in service call of Resource
    Component : JSPdbProject.Empjava
    Component class : Empjava
    User : J2EE_ADMIN
         at com.sapportals.portal.prt.core.PortalRequestManager.handlePortalComponentException(PortalRequestManager.java:969)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:444)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:527)
         at com.sapportals.portal.prt.component.AbstractComponentResponse.include(AbstractComponentResponse.java:89)
         at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:232)
         at com.sapportals.portal.htmlb.page.JSPDynPage.doOutput(JSPDynPage.java:76)
         at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:129)
         at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
         at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
         at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:646)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
         at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
         at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
         at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:522)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         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.sapportals.portal.prt.component.PortalComponentException: Error occurs during the compilation of java generated from the jsp
         at com.sapportals.portal.prt.core.broker.JSPComponentItem.getComponentInstance(JSPComponentItem.java:116)
         at com.sapportals.portal.prt.core.broker.PortalComponentItemFacade.service(PortalComponentItemFacade.java:355)
         at com.sapportals.portal.prt.core.broker.PortalComponentItem.service(PortalComponentItem.java:934)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:435)
         ... 38 more
    Caused by: com.sapportals.portal.prt.servlets_jsp.server.compiler.CompilingException: Error occurs during the rendering of jsp component
         at com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPParser.parse(JSPParser.java:2189)
         at com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPCompiler.compile(JSPCompiler.java:81)
         at com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPCompiler.run(JSPCompiler.java:140)
         at com.sapportals.portal.prt.core.broker.JSPComponentItem.compileJSP(JSPComponentItem.java:291)
         at com.sapportals.portal.prt.core.broker.JSPComponentItem.getComponentInstance(JSPComponentItem.java:141)
         ... 41 more
    Thanks,
    sireesha.B

  • Flow of DataSource, Context, ctx.lookup

    Im having problem understanding how my web app worked.
    Im using this example
    http://localhost:8080/tomcat-docs/jndi-datasource-examples-howto.htm
    i started to change the names in the server.xml, web.xml and DBTest.java for my own web application.
    My question is are the following correct places to look at/change to make the connection work? Is there anything i missed?
    server.xml
    <Context path=................
    <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource" />
    <ResourceParams name="jdbc/TestDB">
    web.xml
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/TestDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    DBTest.java
    DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/TestDB");
    Changing TestDB to something else.

    yes. this is the correct sequence. got it working finally.

  • Error in Updating ctxsys.context index using ctxsrv

    Environment :
    Linux 6.2,
    Oracle 8.1.6
    character set : zhs16gbk or zhs16cgb231280
    I can create an ctxsys.context index(using CHINESE_VGRAM_LEXER) on a long column, and i can rebuild this index with no parameters.
    When i want to rebuild this index automatic using ctxsrv, this error occur ---
    DRG-50857 Oracle error in drtldml(dml)
    Ora-2000 error
    anybody can help me?
    null

    the complete error:
    Dml batch: cid=1023
    End batch: return code is 1
    DRG-50857: oracle error in drtldml(dml)
    ORA_20000: interMedia text 4mNs
    DRG-50857: oracle error in drsxsopen
    ORA-01480: STR83V51dA?H1IY?U:sW:
    null

  • How to make ADF use OC4J datasource

    Hi Gurus,
    I deployed an ADF application on OC4J, and I want my application to use the datasource given by the OC4J, how do I let my application know during design time.

    Refer
    http://www.oracle.com/technology/products/jdev/howtos/10g/usingdatasources/using_datasources.html

  • Initial context lookup error??

    hi, i keep having a problem with the initial context lookup .
    my bean is RoomManagerBean and its JNDI is IRMS/hotel/RoomManagerBean.
    this is the code:
    Object obj = context.lookup("IRMS/hotel/RoomManagerBean");
    however, the result is always NULL. when i try to edit the path to:
    Object obj = context.lookup("java:comp/env/IRMS/hotel/RoomManagerBean");
    , i will get the error: object not bound to name: java:comp/env/IRMS/hotel/RoomManagerBean
    is it becasue my path name is wrong? or the JNDI name? pls help me with this, highly appreciated :)

    ok here's my web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         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/web-app_2_4.xsd"
         version="2.4">
    <session-config>
    <session-timeout>
    30
    </session-timeout>
    </session-config>
    <welcome-file-list>
         <welcome-file>
    index.jsp
    </welcome-file>
    </welcome-file-list>
    <ejb-local-ref>
    <ejb-ref-name>IRMS/hotel/RoomManager</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>IRMS.hotel.RoomManagerLocalHome</local-home>
    <local>IRMS.hotel.RoomManagerLocal</local>
    <ejb-link>IRMS-EJBModule.jar#RoomManager</ejb-link>
    </ejb-local-ref>
    </web-app>
    as u can see, the ejb ref is there. however, when i try to run the file, it gives me the error: Unresolved: <ejb-link>. what does it mean and how to solve it? because i checked the JNDI name for room manager, it's IRMS/hotel/RoomManager. and under the ejb-jar.xml, here is a portion of it in relation to the roommanager:
    <session>
    <display-name>RoomManagerSB</display-name>
    <ejb-name>RoomManager</ejb-name>
    <local-home>IRMS.hotel.RoomManagerLocalHome</local-home>
    <local>IRMS.hotel.RoomManagerLocal</local>
    <ejb-class>IRMS.hotel.RoomManagerEJB</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Bean</transaction-type>
    <ejb-local-ref>
    <ejb-ref-name>ejb/Room</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>IRMS.hotel.RoomLocalHome</local-home>
    <local>IRMS.hotel.RoomLocal</local>
    <ejb-link>Room</ejb-link>
    </ejb-local-ref>
    <ejb-local-ref>
    <ejb-ref-name>IRMS/hotel/Room</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>IRMS.hotel.RoomLocalHome</local-home>
    <local>IRMS.hotel.RoomLocal</local>
    <ejb-link>Room</ejb-link>
    </ejb-local-ref>
    <ejb-local-ref>
    <ejb-ref-name>IRMS/hotel/Room</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>IRMS.hotel.RoomLocalHome</local-home>
    <local>IRMS.hotel.RoomLocal</local>
    <ejb-link>Room</ejb-link>
    </ejb-local-ref>
    <ejb-local-ref>
    <ejb-ref-name>IRMS/hotel/RoomManager</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>IRMS.hotel.RoomManagerLocalHome</local-home>
    <local>IRMS.hotel.RoomManagerLocal</local>
    <ejb-link>RoomManager</ejb-link>
    </ejb-local-ref>
    </session>
    can u solve this? thanks

  • I unable to run ejb with application client using oc4j j2ee container

    Hi,
    I have installe oracle9i (1.0.2.2) oc4j j2ee container.
    I unable to run the ejbs . please help me how to run ejbs with application client and which files are shall configure.
    See the client application is :
    public static void main (String []args)
    try {
    //Hashtable env = new Hashtable();
    //env.put("java.naming.provider.url", "ormi://localhost/Demo");
    //env.put("java.naming.factory.initial", "com.evermind.server.ApplicationClientInitialContextFactory");
    //env.put(Context.SECURITY_PRINCIPAL, "guest");
    //env.put(Context.SECURITY_CREDENTIALS, "welcome");
    //Context ic = new InitialContext (env);
    System.out.println("\nBegin statelesssession DemoClient.\n");
    Context context = new InitialContext();
    Object homeObject = context.lookup("java:comp/env/DemoApplication");
    DemoHome home= (DemoHome)PortableRemoteObject.narrow(homeObject, DemoHome.class);
    System.out.println("Creating Demo\n");
    Demo demo = home.create();
    System.out.println("The result of demoSelect() is.. " +demo.sayHello());
    }catch ( Exception e )
    System.out.println("::::::Error:::::: ");
    e.printStackTrace();
    System.out.println("End DemoClient....\n");
    When I am running client application I got this type of Exception
    java.lang.SecurityException : No such domain/application: sampledemo
    at com.evermind.server.rmi.RMIConnection.connect(RMIConnection.java : 2040)
    at com.evermind.server.rmi.RMIConnection.connect(RMIConnection.java : 1884)
    at com.evermind.server.rmi.RMIConnection.lookup(RMIConnection.java : 1491)
    at com.evermind.server.rmi.RMIServer.lookup(RMIServer.java : 323)
    at com.evermind.server.rmi.RMIContext.lookup(RMIConext.java : 106)
    at com.evermind.server.administration.LazyResourceFinder.lookup(LazyResourceFinder.java : 59)
    at com.evermind.server.administration.LazyResourceFinder.getEJBHome(LazyResourceFinder.java : 26)
    at com.evermind.server.Application.createContext(Application.java: 653)
    at com.evermind.server.ApplicationClientInitialContext.getInitialContext(ApplicationClientInitialContextFactory.java :179 )
    at javax.naming.spi.NamingManager.getInitialContext(NamingManger.java : 246)
    at javax.naming.InitialContext.getDefaultInitialCtx(InitialContext.java : 246)
    at javax.naming.InitialContext.init(InitialContext.java : 222)
    at javax.naming.InitialContext.<init>(InitialContext.java : 178)
    at DemoClient.main(DemoClient.java : 23)
    .ear file is copied into applications directory.
    I have configured server.xml file like this
    <application name="sampledemo" path="../applications/demos.ear" />
    demos.ear file Contains following files
    application.xml
    demobean.jar
    Manifest.mf
    demobean.jar file contains following files
    application-client.xml
    Demo.class
    DemoBean.class
    DemoHome.class
    ejb-jar.xml
    jndi.properties
    Mainifest.mf
    Please give me your valuable suggestions. Which are shall i configure .
    Thanks & Regards,
    Badri

    Hi Badri,
    ApplicationClientInitialContextFactory is for clients which got deployed inside OC4J container..
    For looking up EJB from a stand alone java client please use RMIInitialContextFactory..So please change ur code....
    Also please check ur server.xml
    Since you have specified your ejb domain as "sampledemo"
    you have to use that domian only for look up..But it seems that you are looking up for "Demo" domain instead of "sampledemo" domain...So change your code to reflect that..
    Code snippet for the same is :
    Hashtable env = new Hashtable();
    env.put("java.naming.provider.url", "ormi://localhost/sampledemo");
    env.put("java.naming.factory.initial", "om.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "guest");
    env.put(Context.SECURITY_CREDENTIALS, "welcome");
    Context ic = new InitialContext (env);
    Hope this helps
    --Venky                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Error  in DataSource.getConnection() !

    Hello to u all,
    I'm trying to make an application that uses database connection pooling and i've followed
    closely the tutorial:
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/printer/jndi-datasource-examples-howto.html
    The code in the tutorial worked just fine, however, later when i tried to use it in my (servlet)application a get an error in the datasource.getconnection! Here's my code:
    web.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!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>
    <description>MySQL Test App</description>
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/TestDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    <servlet>
    <servlet-name>ServletContactosControllerDB</servlet-name>
    <servlet-class>ServletContactosControllerDB</servlet-class>
    <init-param>
         <param-name>event</param-name>
         <param-value>event</param-value>
         </init-param>
         <init-param>
         <param-name>error_event</param-name>
         <param-value>error</param-value>
         </init-param>
         <init-param>
         <param-name>new_user_event</param-name>
         <param-value>newuser</param-value>
         </init-param>
         <init-param>
         <param-name>dbLookup</param-name>
         <param-value>java:comp/env/jdbc/DBContactos</param-value>
         </init-param>
              <init-param>
         <param-name>login_event</param-name>
         <param-value>login</param-value>
         </init-param>
    </servlet>
    <servlet-mapping>
    <servlet-name>ServletContactosControllerDB</servlet-name>
    <url-pattern>/index.html</url-pattern>
    </servlet-mapping>
    </web-app>
    I know that the configuration in the server.xml is fine because the example in the tutorial worked!!
    so my code in the doPost method in the servlet is:
         Context initCtx = new InitialContext();
    DebugUtility.println("POST 2 ");
    DataSource dataSource = (DataSource)initCtx.lookup("java:comp/env/jdbc/TestDB");
    DebugUtility.println("POST 3 ");
    Connection con = dataSource.getConnection();
                        DebugUtility.println("POST 4");
    it fails in getconnection with the following error:
    Cannot create JDBC driver of class '' for connect URL 'null'
    can anyone figure it out what is happening ? Is my web.xml with a wrong configuration !!
    thx in advance to all of u !

    Finally i have discover the error !!!
    In fact the error reports some irony cause i had said with conviction that
    the error wasn't in the server.xml , but it was :
    <Context path="/contactos_sb" docBase="contactos_sb"
    debug="5" reloadable="true" crossContext="true">
    i was keeping the tutorial path and not my application path so my servlet wasn't able
    to get the class driver and the url !!
    So. it works fine now ! :)�

  • Context.lookup in a Servlet always returns the same Stateful Session Bean

    Hi,
    I am working on an application in which a Servlet should obtain one StateFul Session Bean per client. I read in EJB 3.0 in Action that to do so I should use a jndi lookup and save the result of the lookup in an HttpSession. This works fine for me when I have a single client.
    My issue is that when I have several clients, context.lookup returns the same SFSB for each client. This means that I end up having a single SFSB for the whole application. I've been browsing the web for a while now trying to find a solution but haven't had any luck yet.
    The code I use to obtain and save the SFSB is the following:
    HttpSession session = request.getSession(true);
    DFMServiceRemote service = (DFMServiceRemote) session.getAttribute("DFMService");
    if (null == service)
         service = (DFMServiceRemote) new InitialContext().lookup("DFMService");
         session.setAttribute("DFMService", service);
    }Using different browser, I end up with different HttpSession but a single SFSB. The only workaround I found is to create the context with environment variables or properties. It then returns different SFSBs for different HttpSession. The workaround code is as below:
    Hashtable<String, String> env = new Hashtable<String, String>();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "oc4jadmin");
    env.put(Context.SECURITY_CREDENTIALS, "welcome");
    env.put(Context.PROVIDER_URL, "ormi://localhost:23791/DriverFatigue");
    service = (DFMServiceRemote) new InitialContext(env).lookup("DFMService");My question is the following. How can I get a different instance of an SFSB every time I execute context.lookup without specifying properties.
    Thanks in advance for any help,
    Matthieu Siggen

    I just did something similar in another project using JBoss instead of oc4j and didn't have any problem. I expect I missed a configuration file in oc4j or there is a conflict somewhere.

  • Cannot drop the table because it does not exist in the system catalog. Transaction context in use by another session

    Hi Every one,
    An error has occurred during report processing. (rsProcessingAborted)
    Get Online Help
    Query execution failed for data set 'NonFinTran'. (rsErrorExecutingCommand)
    Get Online Help
    Cannot drop the table '#NonFinTran', because it does not exist in the system catalog. Cannot drop the table '#MultipleNonFinTran',
    because it does not exist in the system catalog. Transaction context in use by another session.
    NOTE: NonFinTran &
    MultipleNonFinTran are
    the Temp table in my storedPoc.
    Please any help me to solve this issue. 
    Thanks & Regards,
    Anil Kumar
    Anil Kumar

    Hi Harsh,
     Below is my Stored Proc
    SELECT @ServerName=datasource from master.dbo.sysservers WHERE catalog='Voyager'    
     SELECT @ServerName3=datasource from master.dbo.sysservers WHERE catalog='AuditLog'    
     SELECT @ServerName2=datasource from master.dbo.sysservers WHERE catalog='Portal'    
     IF @ServerName IS NOT NULL SET @ServerName='[' + @ServerName + '].' ELSE SET @ServerName=''    
     IF @ServerName3 IS NOT NULL SET @ServerName3='[' + @ServerName3 + '].' ELSE SET @ServerName3=''    
     IF @ServerName2 IS NOT NULL SET @ServerName2='[' + @ServerName2 + '].' ELSE SET @ServerName2=''    
     IF Exists(Select * From tempdb.dbo.SysObjects Where Name Like '#NonFinTran%')     
      DROP TABLE #NonFinTran    
     IF Exists(Select * From tempdb.dbo.SysObjects Where Name Like '#MultipleNonFinTran%')     
      DROP TABLE #MultipleNonFinTran    
     CREATE TABLE #NonFinTran (FirstName VARCHAR(40), TaxId VARCHAR(40), TrxID VARCHAR(40), Status VARCHAR(255), Field1 VARCHAR(255), Field2 VARCHAR(255),    
       Field3 VARCHAR(255), Field4 VARCHAR(255), Field5 VARCHAR(255), Field6 VARCHAR(255), DateTime DATETIME,     
       BranchID CHAR(3), BankID CHAR(1), FromAccountID VARCHAR(255), FromAccountType VARCHAR(255))    
     CREATE TABLE #MultipleNonFinTran (FirstName VARCHAR(40), TaxId VARCHAR(40), TrxID VARCHAR(40), Status VARCHAR(255), Field1 VARCHAR(255), Field2 VARCHAR(255),    
       Field3 VARCHAR(255), Field4 VARCHAR(255), Field5 VARCHAR(255), Field6 VARCHAR(255), DateTime DATETIME,     
       BranchID CHAR(3), BankID CHAR(1), FromAccountID VARCHAR(255), FromAccountType VARCHAR(255))     
    INSERT #NonFinTran    
     EXEC('SELECT FirstName, TaxID,     
      TrxID, Status, TrxField1, TrxField2, TrxField3, TrxField4, TrxField5, TrxField6, DateTime, '''', '''', '''', ''''    
     FROM ' + @ServerName3 + 'AuditLog.dbo.CCAuditLogEntryView AS Audit, ' + @ServerName + 'Voyager.dbo.CCUser AS CCUser    
     WHERE CCUser.UserID = Audit.UserID     
      AND Audit.Succeeded = 1     
      AND Audit.TrxID IN (''ChangeBillPayDefaultAccountEdit'',''ChangeExpiryUserPassword'',''ChangePasswordEdit'',    
       ''ChangeUserPassword'',''ManageAddressMaint'',''ManageContactMaint'',''ManageSecretQuestionAnswerEdit'',    
       ''ManageTransLimitMaint'',''OtherBankAccountMaintAdd'',''OtherBankAccountMaintDelete'',''OtherBankAccountMaintEdit'',    
       ''WithinAmBankAccountMaintAdd'',''WithinAmBankAccountMaintDelete'',''WithinAmBankAccountMaintEdit'',    
       ''SetAccountMaskPreferenceAudit'',''ChangeLoginIdAudit'')     
      AND DATEDIFF(DAY, CONVERT(DATETIME, CONVERT(VARCHAR(10), ''' + @StartDate + '''), 103), Audit.DateTime) >= 0     
      AND DATEDIFF(DAY, CONVERT(DATETIME, CONVERT(VARCHAR(10), ''' + @EndDate + '''), 103), Audit.DateTime) <= 0 ')    
     INSERT #MultipleNonFinTran    
     EXEC('SELECT DISTINCT FirstName, TaxID,     
      TrxID, Status, TrxField1, TrxField2, TrxField3, TrxField4, TrxField5, TrxField6, Audit.DateTime as AuditDateTime,    
    (SELECT DISTINCT SUBSTRING(A.BranchCode,3,3)  FROM ' + @ServerName + 'AuditLog.dbo.CCAuditLogEntryView X INNER JOIN ' + @ServerName + 'Voyager.dbo.CCuser U
    ON X.UserId = U.UserId INNER JOIN ' + @ServerName + 'Voyager.dbo.AMHZ_CustomerProfile P ON P.EnrolId = U.TAXID 
    INNER JOIN ' + @ServerName + 'Voyager.dbo.AMHZ_AccountListing A ON A.CIFNO = P.CIFNO
    WHERE X.UserId = Audit.UserId AND A.AccountNo = SUBSTRING(Audit.TrxField1,11,16) AND P.CIFNO = A.CIFNO
    AND (SUBSTRING(A.BranchCode,3,3) <> NULL OR SUBSTRING(A.BranchCode,3,3) <> '''')
    AND CHARINDEX(''AccountID='', Audit.TrxField1, 1) > 0),
      SUBSTRING(TrxField1,14,1), CASE WHEN CHARINDEX(''AccountID='', TrxField1, 1) > 0 THEN     
      SUBSTRING(TrxField1,11,16) ELSE '''' END, CASE WHEN CHARINDEX(''AccountType='', TrxField2, 1) > 0 THEN SUBSTRING(TrxField2,13,3) ELSE '''' END    
     FROM ' + @ServerName3 + 'AuditLog.dbo.CCAuditLogEntryView AS Audit, ' + @ServerName + 'Voyager.dbo.CCUser AS CCUser    
     WHERE CCUser.UserID = Audit.UserID     
      AND Audit.Succeeded = 1     
      AND Audit.TrxID IN (''SetAccountAttributesAudit'',''SetAccountFriendlyNameAudit'',    
      ''AccountProfileMaintULDelete'',''AccountProfileMaintLHAAdd'',''AccountProfileMaintLSCAdd'')
      AND DATEDIFF(DAY, CONVERT(DATETIME, CONVERT(VARCHAR(10), ''' + @StartDate + '''), 103), Audit.DateTime) >= 0     
      AND DATEDIFF(DAY, CONVERT(DATETIME, CONVERT(VARCHAR(10), ''' + @EndDate + '''), 103), Audit.DateTime) <= 0 ')  
      SET @stmt = '    
     SELECT * FROM    
     SELECT BranchName,
     CASE WHEN SUBSTRING(FromAccountID,1,6) IN (''519901'',''559409'')  THEN ''DC''  
    ELSE       
     CASE FromAccountType WHEN ''01'' THEN ''SA '' WHEN ''02'' THEN ''CA '' WHEN ''03'' THEN ''FD ''     
        WHEN ''SA'' THEN ''SA '' WHEN ''CA'' THEN ''CA '' WHEN ''FD'' THEN ''FD '' ELSE FromAccountType + '' ''    
     END 
     END +     
    case when Len(FromAccountID) =16 Then  
       CASE FromAccountType WHEN ''VC'' THEN   
       SUBSTRING(FromAccountID,1,6)+''******''+SUBSTRING(FromAccountID,13,4)      
    WHEN ''MC'' THEN SUBSTRING(FromAccountID,1,6)+''******''+SUBSTRING(FromAccountID,13,4)  END  
         when Len(FromAccountID) =15 Then 
    CASE FromAccountType WHEN ''VC'' THEN   
       SUBSTRING(FromAccountID,1,6)+''******''+SUBSTRING(FromAccountID,13,3)      
    WHEN ''MC'' THEN SUBSTRING(FromAccountID,1,6)+''******''+SUBSTRING(FromAccountID,13,3)  END  
         ELSE FromAccountID   
    ENd  
     AS FromAcctNo,    
     CASE TrxId  
     WHEN ''AccountProfileMaintLHAAdd'' THEN ''Link Account/Card''    
     WHEN ''AccountProfileMaintLSCAdd'' THEN ''Link Account/Card''    
     WHEN ''APMFamilyFirstAdd'' THEN ''Link Family First Account''    
     WHEN ''AccountProfileMaintULDelete'' THEN ''Unlink Account/Card''    
     WHEN ''BalInqFD'' THEN CASE  WHEN Field3 IN (''APMLink=SUCCESS'') THEN ''APMLink Success'' ELSE ''Fixed Deposit Balance Inquiry'' END  
     WHEN ''BalInqCASA'' THEN CASE  WHEN Field3 IN (''APMLink=SUCCESS'') THEN ''APMLink Success'' ELSE
         CASE WHEN FromAccountType IN (''SA'',''01'') THEN ''Savings Account Balance Inquiry'' 
        ELSE ''Current Account Balance Inquiry'' 
       END 
      END    
     WHEN ''StopCheck'' THEN ''Stop Cheque Request''    
     WHEN ''CheckReorder'' THEN ''Order Your Cheque''    
     WHEN ''CheckInquiry'' THEN ''Cheque Inquiry''    
     WHEN ''TransHistFD'' THEN ''Fixed Deposit Transaction History''    
     WHEN ''TransHistCASA'' THEN    
      CASE WHEN FromAccountType IN (''SA'',''01'') THEN ''Savings Account Transaction History'' ELSE ''Current Account Transaction History'' END    
     WHEN ''StmtInqCC'' THEN    
      CASE WHEN FromAccountType IN (''DR'',''03'') THEN ''Debit Card Statement Inquiry'' ELSE ''Credit Card Statement Inquiry'' END    
     WHEN ''StmtInqDA'' THEN    
      CASE WHEN FromAccountType IN (''SA'',''01'') THEN ''Savings Account Statement Inquiry'' ELSE ''Current Account Statement Inquiry'' END    
     WHEN ''StmtReq'' THEN ''Printed Statement Request''    
     WHEN ''StmtInqIAMSTAR'' THEN ''E-AMSTAR Statement Inquiry''    
     WHEN ''Repayment/Transfer Inquiry'' THEN ''Repayment/Transfer Inquiry''    
     WHEN ''Account Inquiry'' THEN ''Account Inquiry''    
     WHEN ''Payment Inquiry'' THEN ''Payment Inquiry''    
     END AS TransType,    
     FirstName AS CustomerName,    
     TaxId, CONVERT(VARCHAR, DateTime, 103) AS Date, CONVERT(VARCHAR, DateTime, 108) AS Time    
     FROM #NonFinTran, ' + @ServerName3 + 'Portal.dbo.TB_Branch AS TB_Branch    
     WHERE     
     BranchId = TB_Branch.BranchCode     
     AND (TB_Branch.InstCode IN (''00001'', ''00003'',''001'',''002''))    
     AND (FromAccountType IN (''SA'', ''CA'', ''FD'', ''01'', ''02'', ''03'')))'    
    EXEC (@stmt)
    IF Exists(Select * From tempdb.dbo.SysObjects Where Name Like '#NonFinTran%')     
     DROP TABLE #NonFinTran    
     IF Exists(Select * From tempdb.dbo.SysObjects Where Name Like '#MultipleNonFinTran%')     
      DROP TABLE #MultipleNonFinTran    
    Anil Kumar

  • Ejb lookup and oc4j container startup

    I have a servlet that is set to auto start on container startup that does a lookup on a ejb in another container. jndi locates the ejbhome but fails to load the class for the ejb home. It knows the name of the class but the classloader cannot find it. This same servlet works fine after the container has started up.
    It feel the problem is a classloader problem or a restriction by oracle. Any help is appreciated.
    Why can't the OC4J default application that auto starts servlets at container startup not find the ejbhome class?
    David Jacobs

    We have previously done it, but it only worked when we are using in 10g AS R1. But now, we are porting to R2, but it doesn't work. We didn't do any other things, just a simple lookup using the url, context factory. In R1 it worked fine, in R2, we are encountering the same, NameNotFoundException. Hope someone could help us also with this. Another thing, when we are using ormi://<rest of url>, it doesn't return any exception and our application hangs, but if we use opmn:ormi://<rest of URL>, that's the time it throws the NameNotFoundException. In R1, we didn't have any problems.

  • Errors installing web service to use dreamweaver extension

    Portal Version: 10g
    OS/Vers. Where Portal is Installed:: Linux AS 2.1
    Errors installing web service to use dreamweaver extension
    Recently I download the dreamweaver extension for portal, but when I try to install it several errors are raised... in the installation guide the next message appear:
    This installation for this feature is an easy 3 step procedure.
    1. Installing the Portal web service
    2. Configuring the web service to work with your portal (one time administrative process)
    3. Installing the PortalTemplates extension for Dreamweaver MX
    well but when I try to run the 1 step everything goes wrong...
    in the guide say:
    # Transfer this file to the OC4J_HOME/j2ee/home directory of the OC4J
    (please make sure that the OC4J is up and running)
    # Use the following command to install the web service
    java -jar admin.jar ormi://<oc4j_host>:<oc4j_ormi_port>
    <username> <password>
    -deploy -file portalTemplate.ear -deploymentName portalTemplate
    here it's where I have some questions,
    1. the ormi referers to the rmi ok (I think that), well then I go tho the iasconsole and search for the ports and is show:
    home RMI 3202
    OC4J_Portal RMI 3203
    OC4J_BI_Forms RMI 3204
    then I use the home-> port 3202
    java -jar admin.jar ormi://myhost.midtierinstall.com:3202
    ias_admin ias_midtier_admin_password -deploy -file portalTemplate.ear -deploymentName portalTemplate
    but the following messages appear :
    Error: Unable to find java:ServerAdministrator : lookup error:javax.naming.AuthenticationException invalid username/passwod for default (ias_admin).... and the error continue... but the problem is that the password works when I use the enterprise manager in that midtier console...
    I want to know if I'm doing something wrong or how I should use this command to install that web service

    The ormi is the rmi port in the OC4J. This coold be found in oc4j_home/j2ee/home/config/rmi.xml file. The default port is 23791.
    Hope this helps,
    Ramya

  • JMS1.1 Domain Unification sample using OC4J 10g

    I am trying to run the JMS1.1 Domain Unification sample using OC4J 10g
    I am not sure why I get the Invalid provider URL exception at run time when trying to run AsyncClient using listenTopic in Ant. The code prints out the provider URL accurately from my ConnectionParam.java file but exception happens after that. I am running the J2EE container using OC4J and can access http://localhost:8888/adminoc4j as an admin user.
    ++++++++++++++++++++++++++++++++
    C:\JMS1.1>c:\apache-ant-1.6.1\bin\ant listenTopic
    Buildfile: build.xml
    listenTopic:
    [java] local url...
    [java] http://localhost:8888/adminoc4j
    [java] env Hashtable populated...
    [java] javax.naming.NamingException: Invalid provider URL
    [java] at com.evermind.server.rmi.RMILocation.parseURL(RMILocation.java
    :83)
    ++++++++++++++++++++++++++
    This is the initialize method from AsyncClient.java.
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
    public void initialize() throws Exception{
    Hashtable env = new Hashtable();
    // set the environment properties
    env.put(Context.INITIAL_CONTEXT_FACTORY,
         "com.evermind.server.rmi.RMIInitialContextFactory");
    System.out.println("local url...");
    System.out.println(ConnectionParams.PROVIDER_URL);
    env.put(Context.PROVIDER_URL, ConnectionParams.PROVIDER_URL);
    env.put(Context.SECURITY_PRINCIPAL, ConnectionParams.USERNAME);
    env.put(Context.SECURITY_CREDENTIALS, ConnectionParams.PASSWORD);
         System.out.println("env Hashtable populated...");
    // get the initial context
    InitialContext ctx = new InitialContext(env);
         System.out.println("got context...");
    // lookup the queue and topic objects
    Destination topic = (Destination) ctx.lookup("jms/sampleTopic");
         System.out.println("looked up topic...");
    // lookup a connection factory
    ConnectionFactory factory = (ConnectionFactory) ctx.lookup("jms/sampleConnectionFactory");
    // create a connection
    Connection connection = factory.createConnection();

    Sorted out the answer myself.
    +++++++++++++++++++++++++++++
    The URL in ConnectionParams should use ormi protocol as given in the sample example.
    Good example and it all works! Thanks.
    +++++++++++++++++++++++++++++++++++++++++++++
    public class ConnectionParams{
    // variable for OC4J Provider URL
    public static String PROVIDER_URL="ormi://localhost:23791";
    +++++++++++++++++++++++++++++++++++++++++++++

Maybe you are looking for