[EJB 3.0] - Re: how to customize the TM for my EJB3 app?
by mazz
Ah...good suggestion. I just tried that (looked up the java:/TransactionManager from JNDI and executed the getTransaction() method from the object that lookup returned.
And, it turns out, it looks like I don't even have to do that much. I found that rather than going through JNDI, I can simply do this:
com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.getTransaction()
Turn out that static method call returns the exact same reference as would the call to getTransaction from the TransactionManager I looked up in JNDI.
Unfortunately, this doesn't get me what I want. I'm going to return this thread over to the JBossTM forum because this is no longer an EJB3 question - I see no way of me adding my own CheckedAction to the transaction through this API. I need a JBossTM API to do this.
But, if I DID have a JBossTM API to add my own CheckedAction, it would have been easy from the EJB3 standpoint:
<interceptor-binding>
| <ejb-name>*</ejb-name>
| <interceptor-class>org.abc.TransactionInterruptInterceptor</interceptor-class>
| </interceptor-binding>
and my interceptor would install its CheckedAction in the JBossTM transaction where the CheckedAction would be something like:
public class TransactionInterruptCheckedAction extends CheckedAction {
| @Override
| public synchronized void check(boolean isCommit, Uid actUid, Hashtable list) {
| for (...each thread in the list...) {
| thread_from_list.interrupt();
| }
| super.check(isCommit, actUid, list);
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4193202#4193202
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4193202
16 years, 3 months
[Microcontainer] - Alternative JAR extensions
by bob.mcwhirter
I've started working on my RailsStructure structure deployer again.
I'm hoping to deploy "myapp.rails" which is just a JAR archive with a magical extension of ".rails".
I've found that if I modify conf/deployers.xml and add
<value>.rails</value>
to the JARStructure, then my .rails archives are recognized as vfszip files, correctly.
If my RailsStructure calls the underlying JarUtils.addJarSuffix( ".rails" ) in its own constructor, though, it fails to recognize my .rails file as a Jar, and ends up with a FileHandler handling it, instead of a JarHandler.
public RailsStructure() {
| setRelativeOrder( -10000 );
| JarUtils.addJarSuffix( ".rails" );
| }
I've also attempted to do the install callback against JARStructure, with my RailsStructure implementing JarExtensionProvider.
public String getJarExtension() {
| return ".rails";
| }
<install bean="JARStructure" method="addJarExtension">
| <parameter>
| <this/>
| </parameter>
| </install>
| <uninstall bean="JARStructure" method="removeJarExtension">
| <parameter>
| <this/>
| </parameter>
| </uninstall>
This also results in failure.
I'd like to not have to have edits to deployers.xml, as that breaks the self-contained-ness of my deployer. But I seem otherwise unable to get ".rails" added as a vfszip-handleable type.
Any pointers would be appreciated.
Thanks!
-Bob
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4193196#4193196
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4193196
16 years, 3 months
[JCA/JBoss] - How to set HSQLDB datasource in JBoss
by RaviCKota
Hi, I wanted to use my application to connect to HSQLDB database running as a separate process via TCP. I'm not sure what changes needs to be made for this. Below are the steps I followed, but ended up with socket creation failure.
I started HSQLDB in server mode, running at 127.0.0.1 and port 9001.
I made the hsqldb-ds.xml reflect like below
code:
--------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?> <local-tx-datasource> <jndi-name>DefaultDS</jndi-name> <connection-url>jdbc:hsqldb:hsql://127.0.0.1:9001</connection-url> <driver-class>org.hsqldb.jdbcDriver</driver-class> <user-name>sa</user-name> <min-pool-size>5</min-pool-size> <max-pool-size>20</max-pool-size> <idle-timeout-minutes>0</idle-timeout-minutes> <track-statements/> <security-domain>HsqlDbRealm</security-domain> <prepared-statement-cache-size>32</prepared-statement-cache-size> <type-mapping>Hypersonic SQL</type-mapping> </local-tx-datasource> 9001 127.0.0.1 true default false true
--------------------------------------------------------------------------------
I dropped this xml file in deploy folder of jboss default location (C:\sun\jboss\server\default\deploy) and started my JBoss
I'm recieving the below error
code:
--------------------------------------------------------------------------------
23:32:40,079 ERROR [STDERR] [Server@13d5f21]: [Thread[HSQLDB Server @13d5f21,5,jboss]]: run()/openServerSocket(): 23:32:40,089 ERROR [STDERR] java.net.BindException: Address already in use: JVM_Bind 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.(ServerSocket.java:185) at org.hsqldb.HsqlSocketFactory.createServerSocket(Unknown Source) at org.hsqldb.Server.openServerSocket(Unknown Source) at org.hsqldb.Server.run(Unknown Source) at org.hsqldb.Server.access$000(Unknown Source) at org.hsqldb.Server$ServerThread.run(Unknown Source)
--------------------------------------------------------------------------------
Apparently from the error message, I could see socket connection is not established to DB server. However, I was able to connect to HSQLDB DatabaseManager externally. But having problem with JBoss.
I went and connected using DatabaseManager and I could see some new tables,
HILOSEQUENCES, JMS_MESSAGES, JMS_ROLES, JMS_SUBSCRIPTIONS, JMS_TRANSACTIONS, JMS_USERS being created.
One more thing to mention here is I could not see any statement mentioning that DefaultDS is bound in server.log.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4193187#4193187
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4193187
16 years, 3 months