JDBC datasoure that works for embedded OC4J server of JDeveloper 10.1.3.4

Hi all,
I have this in the Application Module as JDBC datasource: java:comp/env/jdbc/DBCON
That works fine if I deploy the application on Oracle application- or tomcat-server.
On the connections tab in JDeveloper I have made a database connection with the name DBCON.
But when I run the application from Jdeveloper with the embedded OC4J server I get this error:
Unable to lookup Data Source at context java:comp/env/jdbc/DBCON
What do I do wrong?
Thanks in advance.

Hi,
Edit the <application_name>-data-sources.xml file under the root directory of your application, and setup a managed data source and connection pool with the data source having the correct jndi name, eg. jdbc/DBCON
You can either do this manually (which I find easier), or use the tool within JDev
Tools - > Embedded OC4J Preferences -> Current Workspace -> Data Sources -> New
-chris

Similar Messages

  • Embeded OC4J server within JDeveloper does not pick latest JAR files.

    Hi,
    Currently OC4J seems to be using an older version of JAXB1.0. Hence I created a shared library in my standalone OC4J server and imported the shared library while deploying my applicatoin in the ClassLoader task.I am trying to replicate the same in
    my embeded OC4J server within JDeveloper.
    I followed as indicated in readme.txt file in the \j2ee\home\shared-lib\ folder.
    1) I created a folder called "jaxb" within /j2ee/home/shared-lib/. I then created a folder with the name "2.0" indicating the version number of the API.
    2) I then added the relevant jaxb JARS to the jaxb/2.0 folder.
    3) In the server.xml file available under /j2ee/home/config/ , I added the following entries.
    <shared-library name="jaxb" version="2.0">
              <code-source path="jaxb-api.jar"/>
              <code-source path="activation.jar"/>
              <code-source path="jaxb1-impl.jar"/>
              <code-source path="jaxb-impl.jar"/>
              <code-source path="jsr173_1.0_api.jar"/>
              <code-source path="jaxb-xjc.jar"/>
         </shared-library>
    I am still facing the issue where my embedded OC4J server is picking up the jaxb version 1.0.
    What are the steps that needs to be taken to ensure that the embeded OC4J
    takes in the jaxb2.0 version.

    Refer
    Re: SUN Jaxb2.0 incompatible with OC4J included in JDEV/OC4J ??

  • JDeveloper 10.1.3.3 and Embedded OC4J server

    This is the Embedded OC4J server on JDeveloper 10.1.3.3 I have pointed it to compile in Java SDK 1.4.2_14
    I have set up the projects datasources to use the JDBC driver ojdbc14.jar
    [Starting OC4J using the following ports: HTTP=8988, RMI=23891, JMS=9227.]
    **** Unable to obtain password from principals.xml. Using default.
    C:\jdev\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\config>
    C:\j2sdk1.4.2_14\bin\javaw.exe -ojvm -classpath C:\jdev\j2ee\home\oc4j.jar;C:\jdev\jdev\lib\jdev-oc4j-embedded.jar -Xverify:none -DcheckForUpdates=adminClientOnly -Doracle.application.environment=development -Doracle.j2ee.http.socket.timeout=500 -Doc4j.jms.usePersistenceLockFiles=false oracle.oc4j.loader.boot.BootStrap -config C:\jdev\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\config\server.xml
    [waiting for the server to complete its initialization...]
    *WARNING: Code-source C:\jdev\jdbc\lib\ojdbc14.jar (from <library> in /C:/jdev/jdev/mywork/NJTransit/NJTransit-oc4j-app.xml) has the same filename but is not identical to /C:/jdev/jdbc/lib/ojdbc14dms.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\jdev\j2ee\home\oc4j.jar). If it contains different versions of the same classes, it will be masked as the latter is already visible in the search path of loader current-workspace-app.root:0.0.0.
    *Ready message received from Oc4jNotifier.
    Embedded OC4J startup time: 4421 ms.
    Target URL -- http://207.200.160.250:8988/NJTransit-NJTransit-context-root/index.jsp
    12/03/08 14:58:05 Oracle Containers for J2EE 10g (10.1.3.0.0) initialized
    My question is why is it having trouble distinguishing between ojdbc14.jar and ojdbc14dms.jar
    as a result I am getting unexpected behavior from the Application
    Declaration in my code
    int mypidm;
    String sql1 = "SELECT SPRIDEN_PIDM FROM SPRIDEN WHERE SPRIDEN_ID = UPPER(?)";
    try{
    PreparedStatement pstmt = conn.prepareStatement(sql1);
    pstmt.setString(1, studid);
    ResultSet rs;
    rs = pstmt.executeQuery();
    //mypidm = rs.getInt("SPRIDEN_PIDM");
    This part of the code drops through i.e. rs.next() always gets a false result
    while (rs.next()) //evaluates to false so mypidm is always zero.
    mypidm = rs.getInt("SPRIDEN_PIDM");
    I am thinking that these two things are related.
    Any Thoughts.

    The tables are not created by default. You can configure your persistence.xml to define how you want tables to be created. The persistence.xml properties are defined in the TopLink class, EntityManagerFactoryProvider (oracle.toplink.<essentials>.ejb.cmp3).
    Set the property, "toplink.ddl-generation" to "drop-and-create-tables" if you want them recreated every time your redeploy. Note this will delete all previous data in the tables, so make sure you do not leave this setting on when you go into production.

  • How to set up data source for JDeveloper's embedded OC4J Server?

    Help needed. I Created a BMP EJB and tried to test
    it with JDeveloper's( version 9.0.3) embedded
    OC4J server. For JDBC, I created a data source
    in data-source.xml lacated in JdeveloperHome\j2ee\home\config. However,
    when I run the test client. I got the error
    from JNDI lookup:
    java.rmi.RemoteException: jdbc/entdatasource not found
    Could anybody with similar experience help?
    Thank you in advance.
    -John Wang

    Try making your changes in the data-source.xml located @ JDev_root\jdev\system9.0.3.1035\oc4j-config.
    You can tell that this is the one to be modified by watching the log when you start the OC4J server. Look for the line that says C:\JDEV\JDK\bin\javaw.exe -ojvm -classpath . . .
    the -config option will point to where the server.xml is used from, the same dir should be where you get your data-source.xml

  • Ajax functionality works in embedded OC4J, but not on iAS 10.1.2

    Hi,
    For a customer, we made an ADF application using JDeveloper 10.1.2. Using instructions from http://www.oracle.com/technology/pub/articles/vohra-ajax.html we coded a servlet, to find a description from a code the user entered in the application, and show this on the webpage without page refresh (the application uses JSP and Struts). This works fine in the embedded oc4j server JDeveloper provides, and also works fine on the Standalone OC4J server. However, when the application is deployed to the iAS from the customer, everything works fine, except the ajax functionality, the description fields simply are not shown.
    Does anyone have a clue what could be the problem? We also runned the application on the iAS server itself, and this gives the same error (no ajax functionality).
    Thanks in advance,
    Remco

    Hi dvohra,
    Thanks for your reply. I'm afraid I overlooked something, which is the reason of the ajax functionality not working. The Servlet that made the Ajax functionality used a datasource, and the same was in the Embedded OC4J Preferences. The ADF Business Components part was changed to use the datasource declared on the iAS. The Servlet however was not...
    So, all works now.

  • JDeveloper 10.1.3.1 - injection works partiin embedded OC4J

    Hi,
    there are a few simple examples which do not work under embedded OC4J:
    Example #1:
    public class ContextListener implements ServletContextListener {
    @PersistenceUnit(unitName="myUnitName")
    private EntityManagerFactory emf;
    public ContextListener() {
    System.out.println( "constructor" );
    public void contextInitialized(ServletContextEvent event) {
    System.out.println( "init: emf = " + emf );
    When I run using embedded OC4J (testing servlet) - I see message 'constructor',
    but then hothing happens - no message from contextInitialized(), no response
    from servlet - IE displays 'page not found' message.
    Example 2:
    public class CatalogServlet extends HttpServlet {
    @PersistenceUnit(unitName="myUnitName")
    private EntityManagerFactory emf;
    public CatalogServlet( ) {
    System.out.println( "constructor" );
    public void init() throws ServletException {
    System.out.println( "Servlet init, emf = " + emf );
    Here results are a bit different: I see 'contrustor' message, then exception
    stack trace - and init() method of servlet did not get called.
    Note that:
    1) If instead of injecting EntityManagerFactory I try to inject session facade
    bean (using @EJB) - this works both in listener and in servlet.
    2) Injecting EntityManagerFactory works in my session facade bean,
    using the same @PersistenceUnit(unitName="myUnitName").
    3) Both examples above work well if I deploy application to WAR file
    and then deploy that WAR file to GlassFish application server.
    Is there something wrong with my code, or is there something wrong with
    embedded OC4J? May be some settings for OC4J that I missed?
    Regards, Leonid.

    Hello,
    It is a bug in the way the embedded OC4J is initializing the application.
    You can deploy successfuly deploy/run in the stand alone OC4J, so could you please for this purpose use the standalone version.
    Regards
    Tugdual Grall

  • Error on Opening "Embedded OC4J Server Preferences"

    When I tried to open Tools-->Embedded OC4J Server Preferences, I got the following error:
    java.lang.NullPointerException
         at oracle.ide.net.URLFactory.newURL(URLFactory.java:85)
         at oracle.jdevimpl.runner.oc4j.Oc4jWorkspaceConfig.transmogrifyConfigFiles(Oc4jWorkspaceConfig.java:224)
         at oracle.jdevimpl.runner.oc4j.Oc4jWorkspaceConfig.configureAll(Oc4jWorkspaceConfig.java:112)
         at oracle.jdevimpl.runner.oc4j.EmbeddedServerAdminCommand.doit(EmbeddedServerAdminCommand.java:50)
         at oracle.ide.CommandProcessor.invokeImpl(CommandProcessor.java:391)
         at oracle.ide.CommandProcessor.invoke(CommandProcessor.java:343)
         at oracle.ide.CommandProcessor.invoke(CommandProcessor.java:110)
         at oracle.ide.IdeAction.performAction(IdeAction.java:665)
         at oracle.ide.IdeAction$1.run(IdeAction.java:857)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    But it works in my colleague machine. What is wrong in my environment? We use Jdev 10g 9.05.1
    Dan

    If you have Web project, check if HTML Root Directory has got a Null value ?
    Double-click on the project to bring up project properties
    Select Input Paths
    See the value for HTML Root Directory.
    If it is Null or invalid, edit to make sure it is valid and Click ok.
    If not, create a new/empty project and see if you can launch Embedded OC4J server preferences dialog for that project.
    raghu
    JDev Team

  • How to use the HTTP Analyzer with the embedded OC4J server?

    JDeveloper version: Studio Edition Version: 10.1.3.0.3.3412
    I have a web application, which I run in the embedded OC4J server.
    I tried to use the HTTP analyzer to inspect http requests and responses, but I could not make the analyzer work.
    I tried to setup the HTTP analyzer by looking at the help entry, but I could not make it work.
    If the HTTP analyzer works for you in the embedded OC4J server, please write the steps on how to setup the analyzer.
    (Maybe I could not make the correct settings about port numbers?)
    Thanks in advance,
    Regards,
    Turgay Zengin

    I was able to use the HTTP Analyzer by changing the proxy setting directly in Internet Options. Check the browser/proxy settings set in JDeveloper preferences and copy them to the Connections tab of Internet Options. See if that works for you.

  • Embeded Oc4j server not starting up in Jdeveloper 10g 10.1.3.0.3

    hi,
    I have created simle hello.jsp , but i try to run it with the embedded OC4j server i get the following error .
    C:\jdk1.4\bin\javaw.exe -client -classpath C:\jdev\j2ee\home\oc4j.jar;C:\jdev\jdev\lib\jdev-oc4j-embedded.jar -Dhttp.proxyHost=172.16.233.34 -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=local.|localhost|127.0.0.1 -Dhttps.proxyHost=172.16.233.34 -Dhttps.proxyPort=8080 -Dhttps.nonProxyHosts=local.|localhost|127.0.0.1 -Xverify:none -DcheckForUpdates=adminClientOnly -Doracle.application.environment=development -Doracle.j2ee.dont.use.memory.archive=true -Doracle.j2ee.http.socket.timeout=500 -Doc4j.jms.usePersistenceLockFiles=false oracle.oc4j.loader.boot.BootStrap -config C:\jdev\jdev\system\oracle.j2ee.10.1.3.34.12\embedded-oc4j\config\server.xml
    [waiting for the server to complete its initialization...]
    Sep 30, 2005 6:23:17 PM com.evermind.server.XMLDataSourcesConfig parseRootNode
    INFO: Legacy datasource detected...attempting to convert to new syntax.
    Error: cannot read: java.lang.Enum
    05/09/30 18:23:23 Application: system is in state FAILED
    05/09/30 18:23:23 Error initializing server: Error initializing ejb-modules: Error loading module file:/C:/jdev/jdev/system/oracle.j2ee.10.1.3.34.12/embedded-oc4j/applications/admin_ejb.jar: Syntax error in source or compilation failed in: C:\jdev\jdev\system\oracle.j2ee.10.1.3.34.12\embedded-oc4j\application-deployments\admin_ejb\generated\MBeanServerEjbRemote_StatefulSessionBeanWrapper0.java
    Error: cannot read: java.lang.Enum
    05/09/30 18:23:24 Fatal error: server exiting
    Process exited with exit code 1.
    Can anyone help

    The 10.1.3 version of JDeveloper (and the embedded OC4J) requires JDK 5.0 to run.
    You can however set your project to work with JDK 1.4 in the project properties.

  • SQL not showing in Embedded OC4J Server window

    Previously, when we'd run a page through JDeveloper, the sql statements that were used to execute the query would appear in the Embedded OC4J Server window in JDeveloper. Now they no longer appear (along with a lot of other logging data that used to appear). Is there a configuration setting somewhere to make this info appear again?

    There is no such setting for OC4J log. Are you sure that you are looking at the right tab because there are generally 3 tabs on the bottom most log window which are Messages, Compiler and Embedded OC4J Server.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problems upgrading to JDBC 5.1 driver for MS SQL Server

    Hi,
    I recently upgraded to the Weblogic JDBC 5.1 driver for MS SQL Server and I am
    now receiving exceptions in my application when attempting to execute a prepared
    statement. I was previously using the Weblogic JDBC 4.x driver for MS SQL Server
    and everything was working fine without any problems. For some reason I am receiving
    a java.lang.CloneNotSupportedException using the new driver. I am using the setLong(),
    setString(), and setObject() methods of the PreparedStatement and then attempting
    to execute. The application code has not changed, so it seems that something
    has changed in the new driver implementation. Has anyone else had this problem
    or know a work around? Here is a snippet of the actual exception:
    S2 [09/30/02 10:46]: java.sql.SQLException: java.lang.CloneNotSupportedException
    : Error in TdsParameter clone: cannot make duplicate of Stream object
    S2 [09/30/02 10:46]: at weblogic.jdbcbase.mssqlserver4.TdsPreparedInputStream
    .<init>(TdsPreparedInputStream.java:99)
    S2 [09/30/02 10:46]: at weblogic.jdbcbase.mssqlserver4.TdsStatement.doEscapeP
    rocessing(TdsStatement.java:1317)
    S2 [09/30/02 10:46]: at weblogic.jdbcbase.mssqlserver4.TdsStatement.execute(T
    dsStatement.java:173)
    S2 [09/30/02 10:46]: at weblogic.jdbcbase.mssqlserver4.TdsStatement.executeUp
    date(TdsStatement.java:94)
    S2 [09/30/02 10:46]: at weblogic.jdbcbase.mssqlserver4.TdsStatement.executeUp
    date(TdsStatement.java:1438)
    Thanks, Nadeem.

    Nadeem Khokhar wrote:
    Is it true that the Weblogic jDriver for MS SQL Server is deprecated? That's the
    message that I got from BEA Support and here is the link they sent:
    http://edocs.bea.com/wls/docs70/mssqlserver4/install_jmsq4.html#415356
    It recommends using Microsoft's JDBC driver instead. Any thoughts on this? From
    what I understand and what I have read on the newsgroups, the Microsoft JDBC driver
    is still quite buggy and has numerous problems.
    Thanks, Nadeem.It is deprecated, but still supported, and is more recent in the download than the one in
    the 5.1 server. We do recommend MS's driver, or that of www.inetsoftware.de. The
    MS driver is fairly stable now, and may certainly have bugs, as does our driver. The MS
    driver is good because it is not deprecated, and supports JDBC 2.0 etc.
    Joe
    >
    >
    Joseph Weinstein <[email protected]> wrote:
    What version of 5.1? You should be running with the latest service pack.
    If that doesn't help, please download the latest 5.1 driver from our
    site, and
    make sure it's in the weblogic.classpath ahead of all other stuff, by
    editting the
    startWeblogic script.
    Joe
    Nadeem Khokhar wrote:
    Hi,
    I recently upgraded to the Weblogic JDBC 5.1 driver for MS SQL Serverand I am
    now receiving exceptions in my application when attempting to executea prepared
    statement. I was previously using the Weblogic JDBC 4.x driver forMS SQL Server
    and everything was working fine without any problems. For some reasonI am receiving
    a java.lang.CloneNotSupportedException using the new driver. I amusing the setLong(),
    setString(), and setObject() methods of the PreparedStatement and thenattempting
    to execute. The application code has not changed, so it seems thatsomething
    has changed in the new driver implementation. Has anyone else hadthis problem
    or know a work around? Here is a snippet of the actual exception:
    S2 [09/30/02 10:46]: java.sql.SQLException: java.lang.CloneNotSupportedException
    : Error in TdsParameter clone: cannot make duplicate of Stream object
    S2 [09/30/02 10:46]: at weblogic.jdbcbase.mssqlserver4.TdsPreparedInputStream
    <init>(TdsPreparedInputStream.java:99)
    S2 [09/30/02 10:46]: at weblogic.jdbcbase.mssqlserver4.TdsStatement.doEscapeP
    rocessing(TdsStatement.java:1317)
    S2 [09/30/02 10:46]: at weblogic.jdbcbase.mssqlserver4.TdsStatement.execute(T
    dsStatement.java:173)
    S2 [09/30/02 10:46]: at weblogic.jdbcbase.mssqlserver4.TdsStatement.executeUp
    date(TdsStatement.java:94)
    S2 [09/30/02 10:46]: at weblogic.jdbcbase.mssqlserver4.TdsStatement.executeUp
    date(TdsStatement.java:1438)
    Thanks, Nadeem.

  • BUG: JDev 10.1.3.0.4 Embedded OC4J Server Preferences

    If we specify in the Embedded OC4J Server Preferences->startup a OC4J installation to use for running and debbuging, click ok, and then delete the choosen directory and try again to access the Embedded OC4J Server Preferences, an error occurs. Appears an dialog and we can not alter this anymore.

    Hi,
    not sure on the limitation of dbms_output.put, but 4000 characters happens to be the maximum size of a varchar2 column....
    I normally use dbms_output.put_line for debugging PL/SQL.
    You could also post in the database forum if you have no luck here.
    regards,
    Brenden

  • How to Deploy HTML file in embedded OC4J Server

    Hi,
    I have a problem with deploying the HTML file.
    How to deploy a HTML file in embedded oc4j server.
    I'm running this in a Standalone and JDeveloper9i version.
    I don't know where to deploy and how to deploy ?
    Thanks
    James

    Hi Deepak,
    I tryed that but i was NOT successful.
    I'm getting 404 error page could not find in the Server.
    Any other idea ?

  • HELP!!! Failed to start Embedded OC4J Server in JDev

    Hi,
    I have installed Oracle JDeveloper 10.1.2.1.0 and have tried to run simple test(for example index.jsp - Welcome) but I get error. - Failed to start Embedded OC4J Server in JDev
    OC4J with simple test have started well in other computers. This situation first time for me.
    Why OC4J can't start?
    This is OC4J log mess
    [Starting OC4J using the following ports: HTTP=8988, RMI=23891, JMS=9227.]
    C:\JDeveloper\jdev\system10.1.2.1.0.1913\oc4j-config>
    C:\JDeveloper\jdk\bin\javaw.exe -ojvm -classpath C:\JDeveloper\j2ee\home\oc4j.jar;C:\JDeveloper\jdev\lib\jdev-oc4j.jar -Dhttp.proxyHost=coates-proxy -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts=coatesnet*|phoenix*|ev_evs1*|ev*|evs*|dr002*|dr001*|raptor*|cweb01*|cweb03*|cweb02*|orangepages*|unity*|dw01*|intra-apps*|intranet*|prod02*|prod01*|dev3*|dev2*|dev1*|app03*|app02*|app01*|localhost|127.0.0.1 -Xverify:none -Ddisable.checkForUpdate=true -Doracle.j2ee.dont.use.memory.archive=true -Doracle.j2ee.http.socket.timeout=500 -Doracle.dms.sensors=NONE -Doc4j.jms.usePersistenceLockFiles=false com.evermind.server.OC4JServer -config C:\JDeveloper\jdev\system10.1.2.1.0.1913\oc4j-config\server.xml
    [waiting for the server to complete its initialization...]
    Process exited with exit code -1073741819.
    Help me please!

    Did the setup for JDEV_USER_HOME with the proper path (C:\OAFRAME\jdevhome\jdev) ,
    Keep the dbc file in the directory and setup the front end as well as back end login details in cluding responsibility details.

  • Embedded OC4J Server could not be started up

    hi ,
    we are using java web services(JAX-RAC) in jdevloper for oaf page , for getting data from another application, if i run page from jdevlope with web services it is showing "failed to start embbed oc4j server". if i run without web services it is not showing any error.
    please hlep me, advanced thanks.
    regards,
    kishore
    Edited by: Saurabh on Nov 4, 2011 7:00 AM

    When I try to open the Tools/Embedded OC4J Server Preferences...
    the following error stack trace pops up:
    java.lang.NullPointerException
         at oracle.ide.net.URLFactory.newURL(URLFactory.java:85)
         at oracle.jdevimpl.runner.oc4j.Oc4jWorkspaceConfig.transmogrifyConfigFiles(Oc4jWorkspaceConfig.java:224)
         at oracle.jdevimpl.runner.oc4j.Oc4jWorkspaceConfig.configureAll(Oc4jWorkspaceConfig.java:112)
         at oracle.jdevimpl.runner.oc4j.EmbeddedServerAdminCommand.doit(EmbeddedServerAdminCommand.java:50)
         at oracle.ide.CommandProcessor.invokeImpl(CommandProcessor.java:391)
         at oracle.ide.CommandProcessor.invoke(CommandProcessor.java:343)
         at oracle.ide.CommandProcessor.invoke(CommandProcessor.java:110)
         at oracle.ide.IdeAction.performAction(IdeAction.java:665)
         at oracle.ide.IdeAction$1.run(IdeAction.java:857)
         at java.awt.event.InvocationEvent.dispatch InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    Any other way of checking the configuration? Corrupt files somewhere?
    Thanks,
    Gonzalo

Maybe you are looking for