7 Replies Latest reply on Sep 27, 2006 6:30 AM by Olaf Heimburger-Oracle

    oc4j gives problem during starting

    535567
      Hi,

      When I test a struts application via jDeveloper, it gives me the following error, any idea why it is giving this problem. Your quick help is highly appreciated.

      When opened the file oc4j-connectors.xml, it has nothing in it.

      Thanks in advance,

      Mansoor.

      06/09/24 20:45:26 Error initializing server: Error instantiating default application at Unable to get ApplicationConfig for default : Error parsing connectors config at file:/D:/softwares/jdeveloper/jdev/system/oracle.j2ee.10.1.3.36.73/embedded-oc4j/config/oc4j-connectors.xml: /D:/softwares/jdeveloper/jdev/system/oracle.j2ee.10.1.3.36.73/embedded-oc4j/config/oc4j-connectors.xml, Fatal error at line 1 offset 1 in file:/D:/softwares/jdeveloper/jdev/system/oracle.j2ee.10.1.3.36.73/embedded-oc4j/config/oc4j-connectors.xml: .<Line 1, Column 1>: XML-20108: (Fatal Error) Start of root element expected.
        • 1. Re: oc4j gives problem during starting
          Olaf Heimburger-Oracle
          Strange.

          Here is my content:
          <?xml version="1.0" standalone='yes'?>

          <oc4j-connectors
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/oc4j-connectors-10_0.xsd"
          schema-major-version="10"
          schema-minor-version="0"
          >

          <!--
          An example JCA resource adapter that stores its native shared library or dll
          in the lib directory

          <connector name="myExampleAdpater" path="myExampleAdapter.rar">
          <native-library>lib</native-library>
          </connector>
          -->

          <!--
          Comment this if you don't want to deploy Oracle's JCA 1.5
          compliant jms resource adapter to talk to OracleAS JMS
          -->

          <connector name="OracleASjms" path="OracleASjms.rar" >
          <config-property name="lookupMethod" value="resourceProvider"/>
          <config-property name="resourceProviderName" value="oc4jjms"/>

          <adminobject-config location="OracleASjms/Queues">
          <adminobject-class>
          oracle.j2ee.ra.jms.generic.AdminObjectQueueImpl
          </adminobject-class>
          <config-property name="resourceProviderName" value="oc4jjms"/>
          </adminobject-config>

          <adminobject-config location="OracleASjms/MyQueue1">
          <adminobject-class>
          oracle.j2ee.ra.jms.generic.AdminObjectQueueImpl
          </adminobject-class>
          <config-property name="jndiName" value="jms/demoQueue"/>
          <config-property name="resourceProviderName" value="oc4jjms"/>
          </adminobject-config>

          <adminobject-config location="OracleASjms/Topics">
          <adminobject-class>
          oracle.j2ee.ra.jms.generic.AdminObjectTopicImpl
          </adminobject-class>
          <config-property name="resourceProviderName" value="oc4jjms"/>
          </adminobject-config>

          <adminobject-config location="OracleASjms/MyTopic1">
          <adminobject-class>
          oracle.j2ee.ra.jms.generic.AdminObjectTopicImpl
          </adminobject-class>
          <config-property name="jndiName" value="jms/demoTopic"/>
          <config-property name="resourceProviderName" value="oc4jjms"/>
          </adminobject-config>

          </connector>

          <connector name="datasources" path="datasources.rar" />

          </oc4j-connectors>
          • 2. Re: oc4j gives problem during starting
            535567
            Hi,

            Thank you for your quik and helpful response.

            I have one more query. I get the following error when I work in Standalone oc4j. This is when I try to use DataSource for getting connection to a database from my J2EE application.

            Exception: javax.naming.NameNotFoundException: jdbc/TestDS not found.
            I have just made the following entry to data-sources.xml, is that sufficient, or do I need to configure something else?

            <data-source
            class="com.evermind.sql.DriverManagerDataSource"
            name="TestDS"
            location="jdbc/TestDS"
            xa-location="jdbc/xa/OmanXADS"
            ejb-location="jdbc/TestDS"
            connection-driver="oracle.jdbc.driver.OracleDriver"
            username="system"
            password="manager"
            url="jdbc:oracle:thin:@localhost:1521:testdb"
            inactivity-timeout="30"
            />

            Thank you,

            Mansoor.
            • 3. Re: oc4j gives problem during starting
              Avi Abrami
              Mansoor,
              You may need to change the "default-data-source" attribute of the "orion-application" element in the "application.xml" configuration file.

              Good Luck,
              Avi.
              • 4. Re: oc4j gives problem during starting
                Olaf Heimburger-Oracle
                The values for the location and ejb-location attributes must be different. ejb-location is usually the one you use in your JNDI lookup. A good name for location is jdbc/TestCoreDS.
                • 5. Re: oc4j gives problem during starting
                  514494
                  Mansoor,
                  When using OC4J standalone I have found that manually modifying the data-sources.xml file along with application and others adds complication to the deployment process. I am using the follow syntax which you can get by typing java -jar <ORACLE_HOME>/oc4j/j2ee/home/admin.jar.

                  java -jar < ORACLE_HOME >/oc4j/j2ee/home/admin.jar ormi://localhost:23791 admin <oc4j password> -application ae_sms_xml -installDataSource -url jdbc:oracle:thin:@<DB_HOST>:<DB_PORT>:<DB_SID> -location jdbc/TravelDS -username travel -password <schema password> -connectionDriver oracle.jdbc.driver.OracleDriver -className oracle.jdbc.pool.OracleConnectionPoolDataSource

                  There my be another way, but in my environment on Sun Solaris I place this command in a shell file in order to execute.

                  I've also had succes when using the Web interface to set the data sources, but this is with OC4J standalone 10.1.3x which you may not be using. Let me know how it works out.

                  Darren
                  • 6. Re: oc4j gives problem during starting
                    514494
                    After posting I noticed items specific to our application, ae_sms_xml, TravelDS, travel. Please substitute with your appropriate values.

                    Darren
                    • 7. Re: oc4j gives problem during starting
                      Olaf Heimburger-Oracle
                      You can also use application specific data-sources without modifying the global data-sources.xml.

                      JDeveloper does this all the time unless you tell it not to do it. Try a simple test with a defined database connection and let JDev create an EAR for you.