Bug 778041 (SOA-566)

Summary: helloworld_tx_sql_action - running it twice fails - DB connection not closed?
Product: [JBoss] JBoss Enterprise SOA Platform 4 Reporter: Len DiMaggio <ldimaggi>
Component: JBossESB, ExamplesAssignee: Len DiMaggio <ldimaggi>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2 CP02   
Target Milestone: ---   
Target Release: 4.2 CP02   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/SOA-566
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
CP02, CR1 build
Last Closed: 2008-06-24 18:58:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
server.log none

Description Len DiMaggio 2008-06-10 20:55:34 UTC
Date of First Response: 2008-06-17 08:52:01
project_key: SOA

Un-deploying and deploying the QS raises this exception - server.log attached

16:51:23,549 INFO  [JBoss4ESBDeployer] create esb service, Quickstart_helloworld_TX_SQL_action.esb
16:51:23,728 ERROR [H2Database] Failed to start database
org.h2.jdbc.JdbcSQLException: Exception opening port 9095 (port may be in use), cause: java.net.BindException: Address already in use [90061-68]
        at org.h2.message.Message.getSQLException(Message.java:91)
        at org.h2.util.NetUtils.createServerSocketTry(NetUtils.java:103)
        at org.h2.util.NetUtils.createServerSocket(NetUtils.java:66)
        at org.h2.server.TcpServer.start(TcpServer.java:182)
        at org.h2.tools.Server.start(Server.java:412)
        at org.jboss.internal.soa.esb.dependencies.H2Database$1.run(H2Database.java:434)
Caused by: java.net.BindException: Address already in use
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
        at java.net.ServerSocket.bind(ServerSocket.java:319)
        at java.net.ServerSocket.<init>(ServerSocket.java:185)
        at java.net.ServerSocket.<init>(ServerSocket.java:97)
        at org.h2.util.NetUtils.createServerSocketTry(NetUtils.java:97)
        ... 4 more

Comment 1 Len DiMaggio 2008-06-10 20:56:04 UTC
Link: Added: This issue related SOA-514


Comment 2 Len DiMaggio 2008-06-10 20:58:41 UTC
To recreate the bug:

ant deploy
ant runtest
ant undeploy
ant deploy



Comment 3 Len DiMaggio 2008-06-10 20:58:41 UTC
Attachment: Added: server.log


Comment 4 Len DiMaggio 2008-06-11 14:41:30 UTC
Is this related to this change in:  
     jboss-soa-p.4.2.0/jboss-as/samples/quickstarts/helloworld_tx_sql_action/quickstart-ds.xml

<?xml version="1.0" encoding="UTF-8"?>
<datasources>
   <local-tx-datasource>
         <jndi-name>HelloworldTxSqlDB</jndi-name>
         <connection-url>jdbc:h2:tcp://localhost:9095/;DB_CLOSE_ON_EXIT=FALSE</connection-url>
         <driver-class>org.h2.Driver</driver-class>
         <user-name>sa</user-name>
         <password/>
         <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
         <min-pool-size>5</min-pool-size>
         <max-pool-size>20</max-pool-size>
         <idle-timeout-minutes>0</idle-timeout-minutes>
         <prepared-statement-cache-size>32</prepared-statement-cache-size>
         <depends>jboss:service=HelloworldTxSqlDB</depends>
   </local-tx-datasource>

   <mbean code="org.jboss.internal.soa.esb.dependencies.H2Database" name="jboss:service=HelloworldTxSqlDB">
        <attribute name="Database">HelloworldTxSqlDB</attribute>
        <attribute name="ServerMode">true</attribute>
        <attribute name="Port">9095</attribute>
        <attribute name="InMemoryMode">false</attribute>
   </mbean>
</datasources>
~                                                                                                                 
~                                                                                                                 
~                                     

Comment 5 Len DiMaggio 2008-06-16 12:28:54 UTC
This is a new problem in CP02. 



Comment 6 Kevin Conner 2008-06-17 12:52:01 UTC
The shutdown of the H2 server in H2Database.stopRemoteDatabase() is not shutting down the tcp server.

We only use this type of database for the example so we could choose to document it and fix it later.

Comment 7 Kevin Conner 2008-06-18 11:49:47 UTC
Link: Added: This issue depends JBESB-1818


Comment 8 Kevin Conner 2008-06-19 11:18:58 UTC
Fixed in CR3.

Comment 9 Len DiMaggio 2008-06-23 20:08:34 UTC
Still a problem in CP02 CR3 build:

16:07:15,177 INFO  [JDBCDataStore] Generated token 'authToken:F954B680-415F-11DD-A575-9832292E2E8C' for user: 'jbossesb/JBoss ESB User'
16:07:15,216 INFO  [DeleteBindingFunction] Publisher 'jbossesb' deleted BindingTemplate with key: EFE3B880-415F-11DD-A575-D5DD9D3530D3
16:07:15,248 INFO  [ConnectionFactoryBindingService] Unbound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=HelloworldTxSqlDB' from JNDI name 'java:HelloworldTxSqlDB'
16:07:30,559 INFO  [JBoss4ESBDeployer] create esb service, Quickstart_helloworld_TX_SQL_action.esb
16:07:30,619 ERROR [H2Database] Failed to start database
org.h2.jdbc.JdbcSQLException: Exception opening port 9095 (port may be in use), cause: java.net.BindException: Address already in use [90061-68]
        at org.h2.message.Message.getSQLException(Message.java:91)
        at org.h2.util.NetUtils.createServerSocketTry(NetUtils.java:103)
        at org.h2.util.NetUtils.createServerSocket(NetUtils.java:66)
        at org.h2.server.TcpServer.start(TcpServer.java:182)
        at org.h2.tools.Server.start(Server.java:412)
        at org.jboss.internal.soa.esb.dependencies.H2Database$1.run(H2Database.java:434)
Caused by: java.net.BindException: Address already in use
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
        at java.net.ServerSocket.bind(ServerSocket.java:319)
        at java.net.ServerSocket.<init>(ServerSocket.java:185)
        at java.net.ServerSocket.<init>(ServerSocket.java:97)
        at org.h2.util.NetUtils.createServerSocketTry(NetUtils.java:97)
        ... 4 more
16:07:30,627 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=HelloworldTxSqlDB' to JNDI name 'java:HelloworldTxSqlDB'
16:07:30,634 INFO  [DatabaseInitializer] java:/HelloworldTxSqlDB datasource is already initialized
16:07:30,763 INFO  [JDBCDataStore] Generated token 'authToken:029E7D70-4160-11DD-A575-CD22C89B8CE5' for user: 'jbossesb/JBoss ESB User'
16:07:31,583 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.


Comment 11 Kevin Conner 2008-06-24 08:47:14 UTC
There was a miscommunication between Trev and myself, none of the changes associated with this merge were pulled into the build.

Comment 12 Len DiMaggio 2008-06-24 18:58:11 UTC
Verified resolved in CP02 CR4 build.