0 Replies Latest reply on Feb 18, 2005 5:53 AM by Luca Iacono

    JNDI Configuration Error

    Luca Iacono Newbie

      Hi,
      here I am at my first post on JBoss ( 3.2.6 ).
      I have been trying to deploy an application that makes use of SAP db, ejb, etc. When the AS starts parsing the sapdb-ds.xml, it generates a series of exceptions I don't quite understand. Here it is: ( The main exception is in red )

      DEBUG [org.jboss.deployment.MainDeployer] using deployer org.jboss.deployment.XSLSubDeployer@717d91
      DEBUG [org.jboss.deployment.XSLSubDeployer] transformed into doc:

      <?xml version="1.0"?>
      <server>
       <mbean code="org.jboss.resource.connectionmanager.LocalTxConnectionManager" name="jboss.jca:service=LocalTxCM,name=EnacDS">
       <depends optional-attribute-name="ManagedConnectionFactoryName">
       <mbean code="org.jboss.resource.connectionmanager.RARDeployment" name="jboss.jca:service=LocalTxDS,name=EnacDS">
       <attribute name="JndiName">EnacDS</attribute>
       <attribute name="ManagedConnectionFactoryProperties">
       <properties>
       <config-property name="ConnectionURL" type="java.lang.String">jdbc:sapdb://10.0.0.173/GESTELDB</config-property>
       <config-property name="DriverClass" type="java.lang.String">com.sap.dbtech.jdbc.DriverSapDB</config-property>
      
       <config-property name="UserName" type="java.lang.String">USER</config-property>
       <config-property name="Password" type="java.lang.String">PASSWORD</config-property>
       </properties>
       </attribute>
      
       <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper</depends>
       </mbean>
       </depends>
       <depends optional-attribute-name="ManagedConnectionPool">
       <mbean code="org.jboss.resource.connectionmanager.JBossManagedConnectionPool" name="jboss.jca:service=LocalTxPool,name=EnacDS">
       <attribute name="MinSize">0</attribute>
       <attribute name="MaxSize">101</attribute>
       <attribute name="BlockingTimeoutMillis">5000</attribute>
       <attribute name="IdleTimeoutMinutes">5</attribute>
       <attribute name="Criteria">ByContainer</attribute>
       </mbean>
       </depends>
       <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager</depends>
       <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager</depends>
       <attribute name="TransactionManager">java:/TransactionManager</attribute>
      
       <depends>jboss.jca:service=RARDeployer</depends>
      
       </mbean>
      </server>



      DEBUG [org.jboss.deployment.SARDeployer] Using existing deployment.document
      DEBUG [org.jboss.deployment.SARDeployer] about to copy 0 local directories
      2005-02-17 16:41:08,503 DEBUG [org.jboss.deployment.SARDeployer] looking for nested deployments in : file:/usr/local/jboss-3.2.6/server/default/deploy/sapdb-ds.xml
      DEBUG [org.jboss.management.j2ee.LocalJBossServerDomain] handleNotification: javax.management.Notification[source=jboss.system:service=ServiceDeployer][type=org.jboss.deployment.SubDeployer.init][message=]
      DEBUG [org.jboss.deployment.DeploymentInfo] createLoaderRepository from config: LoaderRepositoryConfig(repositoryName: JMImplementation:service=LoaderRepository,name=Default, repositoryClassName: null, configParserClassName: null, repositoryConfig: null)
      DEBUG [org.jboss.mx.loading.UnifiedClassLoader] New jmx UCL with url file:/usr/local/jboss-3.2.6/server/default/tmp/deploy/tmp18924sapdb-ds.xml
      DEBUG [org.jboss.mx.loading.UnifiedClassLoader] setRepository, r=org.jboss.mx.loading.UnifiedLoaderRepository3@1b9ce4b, ucl=org.jboss.mx.loading.UnifiedClassLoader3@11ff451{ url=file:/usr/local/jboss-3.2.6/server/default/tmp/deploy/tmp18924sapdb-ds.xml ,addedOrder=0}
      DEBUG [org.jboss.mx.loading.UnifiedClassLoader] setRepository, r=org.jboss.mx.loading.UnifiedLoaderRepository3@1b9ce4b, ucl=org.jboss.mx.loading.UnifiedClassLoader3@11ff451{ url=file:/usr/local/jboss-3.2.6/server/default/tmp/deploy/tmp18924sapdb-ds.xml ,addedOrder=0}
      DEBUG [org.jboss.mx.loading.UnifiedLoaderRepository3] Adding org.jboss.mx.loading.UnifiedClassLoader3@11ff451{ url=file:/usr/local/jboss-3.2.6/server/default/tmp/deploy/tmp18924sapdb-ds.xml ,addedOrder=0}
      DEBUG [org.jboss.deployment.MainDeployer] found 0 subpackages of file:/usr/local/jboss-3.2.6/server/default/deploy/sapdb-ds.xml
      DEBUG [org.jboss.deployment.MainDeployer] Watching new file: file:/usr/local/jboss-3.2.6/server/default/deploy/sapdb-ds.xml
      DEBUG [org.jboss.deployment.MainDeployer] create step for deployment file:/usr/local/jboss-3.2.6/server/default/deploy/sapdb-ds.xml
      DEBUG [org.jboss.deployment.SARDeployer] Deploying SAR, create step: url file:/usr/local/jboss-3.2.6/server/default/deploy/sapdb-ds.xml
      DEBUG [org.jboss.deployment.SARDeployer] Registering service UCL=jmx.loading:UCL=11ff451
      DEBUG [org.jboss.mx.modelmbean.ModelMBeanInvoker] No persistence-manager descriptor found, null persistence will be used
      DEBUG [org.jboss.system.ServiceCreator] About to create bean: jboss.jca:service=LocalTxCM,name=EnacDS with code: org.jboss.resource.connectionmanager.LocalTxConnectionManager
      DEBUG [org.jboss.mx.modelmbean.ModelMBeanInvoker] No persistence-manager descriptor found, null persistence will be used
      DEBUG [org.jboss.system.ServiceCreator] Created bean: jboss.jca:service=LocalTxCM,name=EnacDS
      DEBUG [org.jboss.system.ServiceCreator] About to create bean: jboss.jca:service=LocalTxDS,name=EnacDS with code: org.jboss.resource.connectionmanager.RARDeployment
      DEBUG [org.jboss.mx.modelmbean.ModelMBeanInvoker] No persistence-manager descriptor found, null persistence will be used
      DEBUG [org.jboss.system.ServiceCreator] Created bean: jboss.jca:service=LocalTxDS,name=EnacDS
      DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
      DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
      DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true

      INFO [org.jboss.system.ServiceConfigurator] Problem configuring service jboss.jca:service=LocalTxDS,name=EnacDS
      org.jboss.deployment.DeploymentException: No Attribute found with name: JndiName
      at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:340)


      I have followed the instructions to the letter, so, I have edited conf/login-config.xml by adding the following:
       <application-policy name = "SapDbRealm">
       <authentication>
       <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
       flag = "required">
       <module-option name = "dsJndiName">java:/EnacDS</module-option>
       <module-option name = "principalsQuery">select PWD from ACCOUNT where USERNAME=? And ISELIMINATO = FALSE</module-option>
       <module-option name = "rolesQuery">select PROFILO, PROFILO from ACCOUNT where USERNAME=?</module-option>
       <module-option name = "ManagedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=EnacDS</module-option>
       </login-module>
       </authentication>
       </application-policy>
      
      


      You have seen sapdb-ds.xml. On top, I have added jbosscmp-jdbc.xml to META-INF containing the following:

      <jbosscmp-jdbc>
       <defaults>
       <datasource>java:/EnacDS</datasource>
       <datasource-mapping>SapDB</datasource-mapping>
       <create-table>true</create-table>
       <remove-table>false</remove-table>
       <read-only>false</read-only>
       <pk-constraint>true</pk-constraint>
       <preferred-relation-mapping>foreign-key</preferred-relation-mapping>
       <!-- <read-ahead>
       <strategy>on-load</strategy>
       <page-size>1000</page-size>
       <eager-load-group>*</eager-load-group>
       </read-ahead> -->
      
      <!-- <list-cache-max>1000</list-cache-max> -->
      
       </defaults>
      ...



      Allow me to state the obvious: the sapjdbc.jar is indeed in the lib directory.
      One last thing. the ejb's are not in the ejb-jar. but are all bundled with the application within the ear and the db is on a remote machine. (10.0.0.173 is not the JBoss AS host)
      Your help would be very much appreciated
      Luca