2 Replies Latest reply: Mar 28, 2012 3:18 AM by Areak Huang RSS

Error in JBoss 7.1.0 datasource configuration

Peter Penzov Newbie

Hi,

  I tried to configure datasource configuration in JBoss 7.1.0. This is the configuration:

 

 

<subsystem xmlns="urn:jboss:domain:datasources:1.0">
            <datasources>
                <datasource jndi-name="Oracle" pool-name="Oracle_Pool" enabled="true" jta="true" use-java-context="true" use-ccm="true">
                    <connection-url>
                        jdbc:oracle:thin:@localhost:oracle
                    </connection-url>
                    <driver>
                        ojdbc6.jar
                    </driver>
                    <transaction-isolation> TRANSACTION_READ_COMMITTED </transaction-isolation>
                     <pool>
                <min-pool-size> 20 </min-pool-size>
                <max-pool-size> 300</max-pool-size>
                 </pool>                    
                    <security>
                        <user-name>
                            admin
                        </user-name>
                        <password>
                            qwerty
                        </password>
                    </security>                    
                    <validation>
                <validate-on-match> false </validate-on-match>
                <background-validation> false </background-validation>
                <useFastFail> false </useFastFail>
                </validation>
            <statement>
                    <prepared-statement-cache-size> 100 </prepared-statement-cache-size>
                    <share-prepared-statements/>
            </statement>                    
                 </datasource>
            </datasources>
        </subsystem>

 

 

When I start JBoss this error appears:

 

 

[root@Testserver bin]# ./standalone.sh 
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /opt/jboss-as-7.1.0.CR1b

  JAVA: /opt/jdk1.7.0_01/bin/java

  JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

15:30:58,473 INFO  [org.jboss.modules] JBoss Modules version 1.1.0.CR6
15:30:58,858 INFO  [org.jboss.msc] JBoss MSC version 1.0.1.GA
15:30:58,921 INFO  [org.jboss.as] JBoss AS 7.1.0.CR1b "Flux Capacitor" starting
15:30:59,903 INFO  [org.jboss.as] JBoss AS 7.1.0.CR1b "Flux Capacitor" stopped in 8ms
15:30:59,894 ERROR [org.jboss.as.controller] JBAS014601: Error booting the container: java.lang.RuntimeException: org.jboss.as.controller.persistence.ConfigurationPersistenceException: JBAS014676: Failed to parse configuration
    at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:161) [jboss-as-controller-7.1.0.CR1b.jar:7.1.0.CR1b]
    at java.lang.Thread.run(Thread.java:722) [:1.7.0_01]
Caused by: org.jboss.as.controller.persistence.ConfigurationPersistenceException: JBAS014676: Failed to parse configuration
    at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:125) [jboss-as-controller-7.1.0.CR1b.jar:7.1.0.CR1b]
    at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:187) [jboss-as-controller-7.1.0.CR1b.jar:7.1.0.CR1b]
    at org.jboss.as.server.ServerService.boot(ServerService.java:256) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]
    at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:155) [jboss-as-controller-7.1.0.CR1b.jar:7.1.0.CR1b]
    ... 1 more
Caused by: javax.xml.stream.XMLStreamException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[90,17]
Message: "Jndi name have to start with java:/ or java:jboss/"
    at org.jboss.as.connector.subsystems.datasources.DataSourcesExtension$NewDataSourceSubsystemParser.readElement(DataSourcesExtension.java:723)
    at org.jboss.as.connector.subsystems.datasources.DataSourcesExtension$NewDataSourceSubsystemParser.readElement(DataSourcesExtension.java:279)
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:100) [staxmapper-1.0.0.Final.jar:1.0.0.Final]
    at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69) [staxmapper-1.0.0.Final.jar:1.0.0.Final]
    at org.jboss.as.server.parsing.StandaloneXml.parseServerProfile(StandaloneXml.java:897) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]
    at org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_1(StandaloneXml.java:319) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]
    at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:120) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]
    at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:97) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:100) [staxmapper-1.0.0.Final.jar:1.0.0.Final]
    at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:59) [staxmapper-1.0.0.Final.jar:1.0.0.Final]
    at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:117) [jboss-as-controller-7.1.0.CR1b.jar:7.1.0.CR1b]
    ... 4 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[90,17]
Message: "Jndi name have to start with java:/ or java:jboss/"
    at org.jboss.as.controller.SimpleAttributeDefinition.parse(SimpleAttributeDefinition.java:154) [jboss-as-controller-7.1.0.CR1b.jar:7.1.0.CR1b]
    at org.jboss.as.controller.SimpleAttributeDefinition.parseAndSetParameter(SimpleAttributeDefinition.java:207) [jboss-as-controller-7.1.0.CR1b.jar:7.1.0.CR1b]
    at org.jboss.as.connector.subsystems.datasources.DsParser.parseDataSource(DsParser.java:544)
    at org.jboss.as.connector.subsystems.datasources.DsParser.parseDataSources(DsParser.java:193)
    at org.jboss.as.connector.subsystems.datasources.DsParser.parse(DsParser.java:164)
    at org.jboss.as.connector.subsystems.datasources.DataSourcesExtension$NewDataSourceSubsystemParser.readElement(DataSourcesExtension.java:715)
    ... 14 more

[root@Testserver bin]# 

 

 

Can you give me some advice how to fix the problem?

 

Regards

  • 1. Re: Error in JBoss 7.1.0 datasource configuration
    Wolf-Dieter Fink Master

    As the message said rename the JNDI name of your datasource:

    <datasource jndi-name="java:jboss/Oracle"

  • 2. Re: Error in JBoss 7.1.0 datasource configuration
    Areak Huang Newbie

    I know how to bound the datasource.I use AS7.1

     

    First at standalone.xml or domain.xml

     

    <subsystem xmlns="urn:jboss:domain:datasources:1.0">

                <datasources>

                    <datasource jndi-name="java:jboss/OracleDS" pool-name="OracleDS" enabled="true" jta="true" use-java-context="true" use-ccm="true">

                        <connection-url>

                           jdbc:oracle:thin:@*.*.*.:1521:*

                        </connection-url>

                        <driver>

                            oracle

                        </driver>

                        <transaction-isolation> TRANSACTION_READ_COMMITTED </transaction-isolation>

                         <pool>

                                                                                    <min-pool-size> 20 </min-pool-size>

                                                                                    <max-pool-size> 300</max-pool-size>

                                                                     </pool>                   

                        <security>

                            <user-name>*</user-name>

                             <password>*</password>

                        </security>                   

                                                      <statement>

                                                                          <prepared-statement-cache-size> 100 </prepared-statement-cache-size>

                                                                          <share-prepared-statements/>

                                                      </statement>                   

                     </datasource>

                      <drivers>

                        <driver name="oracle" module="com.oracle.ojdbc14">

                           <driver-class>oracle.jdbc.OracleDriver</driver-class>

                        </driver>

                    </drivers>

                </datasources>

            </subsystem>

     

    then remember to add folder like this:     jboss-as-7.1.0.Final\modules\com\oracle\ojdbc14\main

     

    in the "main" folder you must create module.xml and ojdbc14.jar

     

    module.xml:

     

    <?xml version="1.0" encoding="UTF-8"?>

    <module xmlns="urn:jboss:module:1.1" name="com.oracle.ojdbc14">

        <resources>

            <resource-root path="ojdbc14.jar"/>

            <!-- Insert resources here -->

        </resources>

        <dependencies>

            <module name="javax.api"/>

                        <module name="javax.transaction.api"/>

        </dependencies>

    </module>

     

    so, you can start the server, and input http://localhost:9990/ you can see the datasource:

     

    Name                                               JNDI                                             Enabled?

    java:jboss/OracleDS                 

    OracleDS                                    

    true




     

     

    OK.

    Areak.