How to install i-net OPTA in JBoss 2.1 or higher

Please note: You need i-net OPTA v2.06 or higher.

JBoss Server Configuration

  1. To add the driver to the classpath of JBoss you need to copy the file Opta.jar to the jboss directory $JBOSS_ROOT/lib/ext.
  2. Add the JDBC driver class name com.inet.tds.TdsDriver in the file jboss.jcml to the drivers list. The file can be found in %JBOSS_HOME%/conf/<config-name>. Search for the entry <attribute name=“Drivers”>. After you have edited it this looks like:
    <attribute name="Drivers">
    org.hsql.jdbcDriver,org.enhydra.instantdb.jdbc.idbDriver,com.inet.tds.TdsDriver
    </attribute>
  3. Start jBoss and check if the JDBC-driver has been found. If JBoss has found the driver it looks like:
    [JdbcProvider] Loaded JDBC-driver:com.inet.tds.TdsDriver
  4. To create a XA DataSource you need to add a <mbean> tag the file jboss.jcml (everything within {} is to be replaced by your value including the {}):
    <mbean code="org.jboss.jdbc.XADataSourceLoader"
    name="DefaultDomain:service=XADataSource,name={MyConnectionPool}">
        <attribute name="PoolName">{MyConnectionPool}</attribute>
        <attribute name="DataSourceClass">com.inet.tds.DTCDataSource</attribute>
        <attribute name="Properties">serverName={YourHost};
        database={YourDatabase}</attribute>
        <attribute name="GCMinIdleTime">1200000</attribute>
        <attribute name="JDBCUser">{sa}</attribute>
        <attribute name="MaxSize">10</attribute>
        <attribute name="Password">{}</attribute>
        <attribute name="GCEnabled">false</attribute>
        <attribute name="InvalidateOnError">false</attribute>
        <attribute name="TimestampUsed">false</attribute>
        <attribute name="Blocking">true</attribute>
        <attribute name="GCInterval">120000</attribute>
        <attribute name="IdleTimeout">1800000</attribute>
        <attribute name="IdleTimeoutEnabled">false</attribute>
        <attribute name="LoggingEnabled">false</attribute>
        <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
        <attribute name="MinSize">0</attribute>
    </mbean>

    *** If you can't install the Resource Manager Proxy in the SQL Server then you can use com.inet.tds.XDataSource instead of com.inet.tds.DTCDataSource.

  5. Start jBoss and check if a new DataSource is loaded.

You can see the following lines:

[MyConnectionPool] Initializing
[MyConnectionPool] Initialized

EJB Deployment

  1. Start EJX (java -jar ejx.jar within the /bin directory)
  2. Load your EJB jar file and select the JAWS.xml or create one
  3. Insert MyConnectionPool as the datasource name ( or the datasource name you specifed in step 4)
  4. Set the datatype mapping from the list MS SQLSERVER?

Problems with the Installation

[MyConnectionPool] Starting
[MyConnectionPool] Stopped
[MyConnectionPool] java.lang.NoSuchMethodException
[MyConnectionPool] at java.lang.Class.getMethod0(Native Method)
[MyConnectionPool] at java.lang.Class.getMethod(Unknown Source)
[MyConnectionPool] at org.jboss.jdbc.XADataSourceLoader.startService(XADataSourceLoader.java:277)
[MyConnectionPool] at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:93)
[MyConnectionPool] at java.lang.reflect.Method.invoke(Native Method)
[MyConnectionPool] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
[MyConnectionPool] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
[MyConnectionPool] at org.jboss.util.ServiceControl.start(ServiceControl.java:97)
[MyConnectionPool] at java.lang.reflect.Method.invoke(Native Method)
[MyConnectionPool] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
[MyConnectionPool] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
[MyConnectionPool] at org.jboss.Main.<init>(Main.java:217)
[MyConnectionPool] at org.jboss.Main$1.run(Main.java:121)
[MyConnectionPool] at java.security.AccessController.doPrivileged(Native Method)
[MyConnectionPool] at org.jboss.Main.main(Main.java:117)

Cause: You have add the property URL. Our DataSource not support the property URL. You need to remove this property.


java.lang.NullPointerException
     at org.jboss.logging.Log.log(Log.java:95)
     at org.jboss.logging.Log.log(Log.java:100)
     at org.jboss.util.ServiceMBeanSupport.init(ServiceMBeanSupport.java:62)
     at org.jboss.util.ServiceMBeanSupport.preRegister(ServiceMBeanSupport.java:161)
     at com.sun.management.jmx.MBeanServerImpl.preRegisterInvoker(MBeanServerImpl.java:2245)
     at com.sun.management.jmx.MBeanServerImpl.createMBean(MBeanServerImpl.java:765)
     at javax.management.loading.MLet.getMBeansFromURL(MLet.java:540)
     at javax.management.loading.MLet.getMBeansFromURL(MLet.java:369)
     at org.jboss.Main.<init>(Main.java:119)
     at org.jboss.Main$1.run(Main.java:87)
     at java.security.AccessController.doPrivileged(Native Method)
     at org.jboss.Main.main(Main.java:83)

Cause: You have to add the MLET tag to the top of the file and not at the end of the file.


[MyConnectionPool] com.inet.tds.SQLException: java.net.UnknownHostException: YourHost,database=YourDatabase
[MyConnectionPool] java.net.UnknownHostException: YourHost,database=YourDatabase
[MyConnectionPool]     at java.net.InetAddress.getAllByName0(Unknown Source)
[MyConnectionPool]     at java.net.InetAddress.getAllByName0(Unknown Source)
[MyConnectionPool]     at java.net.InetAddress.getByName(Unknown Source)
[MyConnectionPool]     at java.net.Socket.<init>(Unknown Source)
[MyConnectionPool]     at com.inet.tds.TdsDriver.a(Unknown Source)
[MyConnectionPool]     at com.inet.tds.TdsDriver.connect(Unknown Source)
[MyConnectionPool]     at com.inet.tds.TdsDataSource.getConnection(Unknown Source)
[MyConnectionPool]     at com.inet.tds.DTCDataSource.getXAConnection(Unknown Source)
[MyConnectionPool]     at org.jboss.minerva.factories.XAConnectionFactory.createObject(XAConnectionFactory.java:232)
[MyConnectionPool]     at org.jboss.minerva.pools.ObjectPool.createNewObject(ObjectPool.java:801)
[MyConnectionPool]     at org.jboss.minerva.pools.ObjectPool.getObject(ObjectPool.java:549)
[MyConnectionPool]     at org.jboss.minerva.datasource.XAPoolDataSource.getConnection(XAPoolDataSource.java:169)
[MyConnectionPool]     at org.jboss.jdbc.XADataSourceLoader.initializePool(XADataSourceLoader.java:288)
[MyConnectionPool]     at org.jboss.jdbc.XADataSourceLoader.startService(XADataSourceLoader.java:252)
[MyConnectionPool]     at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:92)
[MyConnectionPool]     at java.lang.reflect.Method.invoke(Native Method)
[MyConnectionPool]     at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
[MyConnectionPool]     at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
[MyConnectionPool]     at org.jboss.dependencies.DependencyManager.startMBean(DependencyManager.java:284)
[MyConnectionPool]     at org.jboss.dependencies.DependencyManager.loadService(DependencyManager.java:261)
[MyConnectionPool]     at org.jboss.dependencies.DependencyManager.processService(DependencyManager.java:243)
[MyConnectionPool]     at org.jboss.dependencies.DependencyManager.processService(DependencyManager.java:238)
[MyConnectionPool]     at org.jboss.dependencies.DependencyManager.startMBeans(DependencyManager.java:117)
[MyConnectionPool]     at org.jboss.Main.<init>(Main.java:162)
[MyConnectionPool]     at org.jboss.Main$1.run(Main.java:87)
[MyConnectionPool]     at java.security.AccessController.doPrivileged(Native Method)
[MyConnectionPool]     at org.jboss.Main.main(Main.java:83)

Cause: The properties need to be separated by semicolon and not by comma.


[MyConnectionPool] Initializing
[MyConnectionPool] Initialized
[Default] javax.management.RuntimeMBeanException: RuntimeException thrown in the MBean's setter
[Default]     at com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java:1417)
[Default]     at com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java:1331)
[Default]     at org.jboss.configuration.ConfigurationService.load(ConfigurationService.java:139)
[Default]     at java.lang.reflect.Method.invoke(Native Method)
[Default]     at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
[Default]     at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
[Default]     at org.jboss.Main.<init>(Main.java:143)
[Default]     at org.jboss.Main$1.run(Main.java:87)
[Default]     at java.security.AccessController.doPrivileged(Native Method)
[Default]     at org.jboss.Main.main(Main.java:83)

Cause:

  1. Maybe you use an older version of i-net OPTA. You need release 2.06 or higher.
  2. You have set a value for the URL. i-net OPTA's XADataSource does not need and does not support an URL.
 

© Copyright 1996 - 2017, i-net software; All Rights Reserved.