[Snowdrop] - Re: TransactionManager and UserTransaction
by Andreas Panagiotidis
Andreas Panagiotidis [https://community.jboss.org/people/apanag] created the discussion
"Re: TransactionManager and UserTransaction"
To view the discussion, visit: https://community.jboss.org/message/746024#746024
--------------------------------------------------------------
It's exactly like this, I had the same problem with Spring and JBoss 4.2. Exception
Caused by: org.springframework.transaction.TransactionSystemException:
JTA TransactionManager is not available at JNDI location [java:/TransactionManager];
nested exception is
org.springframework.jndi.TypeMismatchNamingException:
*Object* of type [class org.jboss.tm.*TxManager*]
available at JNDI location [java:/TransactionManager] *is not assignable*
to [*javax.transaction.TransactionManager*]
My application had added in the EAR its own JTA library, thus this one was used instead of the jta that comes from JBoss.
I use maven, so excluding the JTA artifacts in my pom solved the problem.
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<exclusions>
...
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>1.8.4</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</exclusion>
</exclusions>
</dependency>
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/746024#746024]
Start a new discussion in Snowdrop at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 6 months
[Javassist] - Matching and replacing a sequence of bytecodes/instructions
by susanin
susanin [https://community.jboss.org/people/susanin] created the discussion
"Matching and replacing a sequence of bytecodes/instructions"
To view the discussion, visit: https://community.jboss.org/message/745206#745206
--------------------------------------------------------------
Hi,
I have the following problem to solve:
I need to detect assignments to a specific field, where the right-hand side is also of a specific form, e.g. it is the same field (or the field of the same specific type) of another object:
obj1.fieldX = obj2.fieldX
The reason for looking for such a pattern is an (peephole) optimization of the code that I generate using Javassist. Currently, I have my basic transformation working (using *javassist.expr.FieldAccess*), but it treats such assignments as two independent operations:
read from fieldX of obj2
write into fieldX of obj1
and I cannot see that they are used in combination and cannot optimize such a typical use-case. As a result, the generated code is rather inefficient at run-time and is about 2-3 times slower, because both transformations done independently result in prodicing a lot of heap-allocated intermediary objects of complex types. Those objects are generated as a result of a read and some of their fields are initialized from obj2.fieldX. Then write does the opposite action, i.e. copies some of those fields of a newly allocated object into a target object, i.e. into ob1.fieldX. And then the intermediary object is not used any more. My wish is to directly copy some information from obj2.fieldX into obj1.fieldX, without generating all those useless intermediary objects on heap.
Therefore I have questions:
1) Is it in principle possible using Javassist to detect something like this and to replace the whole expression by a new code or transform it?
I've seen that BCEL has something like this for matching sequences of byte-codes - it has code matching using regular expressions, like "NOP+(ILOAD|ALOAD)*" (http://commons.apache.org/bcel/manual.html, section 3.3.7). May be Javassist also has it in a certain form?
2) May be FieldAccess allows access to additional information using $_, $0 or $1, so that one can try to match a pattern against a the target (i.e. $_) of read or value argument of a write and perform a dedicated action if it is detected?
3) May be there are other ways rather than code matching at the bytecode level to achieve my goal?
Thanks,
Leo
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/745206#745206]
Start a new discussion in Javassist at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 6 months
[IronJacamar] - Destroying connection that could not be successfully matched - Jboss 7
by Anderson Vasconcelos
Anderson Vasconcelos [https://community.jboss.org/people/andersonvass] created the discussion
"Destroying connection that could not be successfully matched - Jboss 7"
To view the discussion, visit: https://community.jboss.org/message/745817#745817
--------------------------------------------------------------
Hi
In my application i get the connection of datasource like this:
*dataSource = (DataSource) lookup(name, this.localContext);*
*conn = ds.getConnection(databaseUser, databasePassword);*
But sometimes i receive this warning message:
*
*
*11:19:19,577 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (http--127.0.0.1-8080-2) IJ000612: Destroying connection that could not be successfully matched:* org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@1583f79[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection@1f83728 connection handles=0 lastUse=1341325073977 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@ed3bb2 pool internal context=SemaphoreArrayListManagedConnectionPool@66ee25[pool=TESTE_CONNECTION_23@DOMAIN_999] xaResource=XAResourceWrapperImpl@a7e7be[xaResource=org.jboss.jca.adapters.jdbc.xa.XAManagedConnection(a)1f83728 pad=false overrideRmValue=false productName=Oracle productVersion=Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options jndiName=java:/TESTE_CONNECTION_23@DOMAIN_999] txSync=null]
How to solve this in Jboss 7? I found some solutions , like <application-managed-security></application-managed-security>, but this don't work in Jboss 7.
Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/745817#745817]
Start a new discussion in IronJacamar at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 6 months