I'm getting XARecovery Exception due to mysql replication breaks.
WARN [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016027: Local
XARecoveryModule.xaRecovery got XA exception XAException.XAER_NOTA:
com.mysql.jdbc.jdbc2.optional.MysqlXAException: XAER_NOTA: Unknown XID
Default timeout is 10 sec.
How to increase to orphanSafetyInterval timeout?
Thanks!
This property can be applied in standalone-full.xml under system property
<system-properties>
<property name="com.arjuna.ats.jta.orphanSafetyInterval" value="50000"/>
<property name="com.arjuna.ats.jta.xaAssumeRecoveryComplete" value="true"/>
</system-properties>
Moreover you also use xaAssumeRecoveryComplete to handle unknown id error while xa transaction
For more info please go through below link:
https://access.redhat.com/documentation/en-us/jboss_enterprise_application_platform/6.3/html/development_guide/limitations_of_the_xa_recovery_process
You can add orphanSafetyInterval as a System Variable, for example:
-Dcom.arjuna.ats.jta.common.orphanSafetyInterval=20000
Related
I have installed both Business Central and Kie Execution Server 7.1 on WildFly 14.
Business Central is available at: http://localhost:8080/kie-wb
Kie Execution Server is available at: http://localhost:8080/kie-server
I'm trying to figure out how to deploy one Project designed in the Business Central to the Kie Execution Server.
I have set the following properties on WildFly:
<property name="org.kie.server.controller.user" value="Administrator"/>
<property name="org.kie.server.controller.password" value="Password1!"/>
<property name="org.kie.server.location" value="http://localhost:8080/kie-server/services/rest/server"/>
<property name="org.kie.server.id" value="demo-server"/>
<property name="org.kie.server.controller" value="http://localhost:8080/kie-wb/rest/controller"/>
However, I still have a "No Remote Servers"
And the following WARN in the logs:
10:24:44,212 WARN [org.kie.server.services.impl.controller.DefaultRestControllerImpl] (KieServer-ControllerConnect) Exception encountered while syncing with controller at http://localhost:8080/kie-wb/rest/controller/server/demo-server error Error while sending PUT request to http://localhost:8080/kie-wb/rest/controller/server/demo-server response code 401
What is wrong with my configuration?
I have solved it. I wrongly deployed also the kie-server-controller.war that was not needed. I've added a short tutorial with all the steps in case it could help.
If kie-server and business-central war deployed on same wildfly instance then try adding below properties in system-properties tag
<property name="org.kie.server.user" value="Administrator"/>
<property name="org.kie.server.pwd" value="Password1!"/>
My logs are getting hammered by below log message in JBOSS 7. Can you anyone suggest how to stop this log message.
2018-02-28 13:37:13,618 WARN [com.arjuna.ats.arjuna] (default-threads - 48) ARJUNA012141: Multiple last resources have been added to the current transaction. This is transactionally unsafe and should not be relied upon. Current resource is LastResourceRecord(XAOnePhaseResource(LocalXAResourceImpl#5d70439b[connectionListener=653eac5d connectionManager=7f6856e8 warned=false currentXid=null productName=MySQL productVersion=10.2.13-MariaDB-log jndiName=java:/jdbc/db_jndi]))
In your standalone.xml file, in the logging section, add something like this under the appropriate handler element:
<filter>
<not>
<match pattern="ARJUNA012141"/>
</not>
</filter>
Of course, you should add these lines using the jboss-cli utility. Did you know that changes to logging don't require a server restart, but will be picked up at the defined refresh interval?
I am trying to insert a record into Oracle 11g database using MyBatis-Spring, but the insert hangs. Select works fine.
I need another set of eyes to help me figure out what is going on.
Here are the snippets of codes that matter:
Logging output: (it hangs forever on the last line)
Running persistence.PartyMapperUnitTest
DEBUG [main] - Cache Hit Ratio [persistence.mapper.PartyMapper]: 0.0
DEBUG [main] - ==> Preparing: SELECT PARTY_ID, PARTY_SUBTYPE_CD, LIFECYCLE_CD, PARTY_STATUS_CD FROM PARTY WHERE PARTY_ID =2
DEBUG [main] - ==> Parameters:
DEBUG [main] - <== Total: 1
DEBUG [main] - ==> Preparing: INSERT INTO PARTY (PARTY_SUBTYPE_CD, LIFECYCLE_CD, PARTY_STATUS_CD, CREATED_BY) VALUES (?,?,?,?)
DEBUG [main] - ==> Parameters: partySubtypeCode1438810529048(String), lifecycleCode(String), partyStatusCode(String), createdBy(String)
***==== The application hangs forever at this log line ====***
Testing.sql (this works fine)
INSERT INTO PARTY (PARTY_SUBTYPE_CD, LIFECYCLE_CD, PARTY_STATUS_CD, CREATED_BY)
VALUES ( 'a', 'b', 'c', 'd');
applicationContext.xml
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
</bean>
PartyMapper.java
public interface PartyMapper<PartyEntity> {
public PartyEntity fetch(Object entityId);
public int insert(PartyEntity entity);
}
PartyMapper.xml
<insert
id="insert"
parameterType="persistence.entity.PartyEntity"
keyProperty="partyId"
keyColumn="PARTY_ID"
useGeneratedKeys="true">
INSERT INTO PARTY
(PARTY_SUBTYPE_CD, LIFECYCLE_CD, PARTY_STATUS_CD, CREATED_BY)
VALUES
(#{partySubtypeCode},#{lifecycleCode},#{partyStatusCode},#{createdBy})
</insert>
PartyMapperUnitTest.java
PartyEntity expectedParty = new PartyEntity();
expectedParty.setPartySubtypeCode("a");
expectedParty.setLifecycleCode("b");
expectedParty.setPartyStatusCode("c");
expectedParty.setCreatedBy("d");
partyMapper.insert(expectedParty);
=== EDIT ===
There are only two threads running when the UnitTest runs. I don't see anything wrong in here.
Added a Thread.dumpStack() before the insert, but did not see anything wrong with it:
Thread.dumpStack()
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#77ab3f0: defining beans [transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,sqlSessionFactory,dataSource,org.mybatis.spring.mapper.MapperScannerConfigurer#0,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,mapper,partyMapper,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1365)
at td.com.naccms.cps.persistence.PartyMapperUnitTest.insert(PartyMapperUnitTest.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
...
...
How many connections do you have in your connection pool? I've seen this happen often when the DB pool has 1 connection and there are 2 concurrent transactions (so MyBatis cannot get a DB connection, and the jdbc connection pool is the one actually hanging). You can debug your app and 'pause' it when it hangs. You should be able to see the threads and trace which one id blocked and where. Another option, but more rare, is that the table is locked. You can google for some queries that will show you all the current locks in your DB.
edit after your comment
To get a proper error when this happens, my suggestion is to set the defaultStatementTimeout in mybatis. This, at least, will throw an exception, rather than hang forever.
You also might want to configure some timeouts in your database connection pool too, as some pools wait forever by default (and that's a loooong time :).
In my application we are using Toplink with Jpa.
Here the problem is we are using stored procedures in this application, we are taking the connection using Jndi connection for Stored Procedure calling, and we are using EntityManger for remaining queries. But here if we launching the application it is taking two connections from connection pool. After the application launching I am calling the Stored Procedure(sp)
one sp I am taking one connection but in websphere connection pool it is creating two connections?
can U plese help me how to overcome this problem.....
I won't using JTA, to get the JDBC connection I am using
EntityManager em = getJpaTemplate().getEntityManagerFactory().createEntityManager();
this way I am getting the JDBC Connection...and I configured the persitence.xml file following code...
<properties>
<property name="toplink.logging.level" value="OFF"/>
<property name="toplink.cache.type.default" value="NONE"/>
<property name="com.thoughtinc.runtime.persistence.sql.syntax" value="db2" />
</properties>
So, please kindly look into this and tell me any if I am doing any wrong here.
Are you using JTA or non-JTA? Are you releasing the connection back to the pool after using it?
Depending on your configuration (include your persistence.xml), if you have a non-JTA login configured TopLink may use this for non-transactional read queries. This is configurable in your persistence.xml.
To get the JDBC Connection from a TopLink (EclipseLink) EntityManager use em.unwrap(Connection.class)
How do I make the log server\\log\serve.log to be appended. i.e. whenver I restart JBoss it should not override the content of the log but continue from the end of it?
Add <param name="Append" value="true"/> to the <Appender> in your conf/jboss-log4j.xml file. There may be multiple appenders defined, so make sure you get the one that handles server.log.
Try setting <param name="Append" value="true"/> in your log4j.xml. This may be on a FileAppender och RollingFileAppender section. Just look for the appender that writes to server.log.
Short answer: change the log file name (e.g. myapp.log)
Longer answer: We've also seen a case where the server.log got truncated in jboss. Somewhere, someone is truncating the server.log file in some static initialization block we couldn't find. Changing the file name seems to work and the contents was appended to.
we had the same issue on our remote Ubuntu 16.04 Linuxes running Jboss EAP 6.4.0 but not when we ran our Jboss server locally in Eclipse/Windows.
The append property was already set to true.
I finally made it work by declaring the property append before the filename in the standalone-full.xml.
<properties>
<property name="append" value="true"/>
<property name="fileName" value="${jboss.server.log.dir}/server.log"/>