Failure while running flutter - flutter

I'am trying to run my flutter app on my android device but everytime
I try to run it I'am getting an error but the things is that the flutter
app is a newly created flutter project and I haven't run any code
yet but the android device is the one I always use to run my flutter apps
this is the error:
Launching lib\main.dart on SM G9250 in debug mode...
Running Gradle task 'assembleDebug'...
F/CoreApps(23818): [1][CommonFeature] ###versionCode : 115082101, CONTACT_PROFILE_SERVICE_ENABLE : true, FREE_MESSAGE_ENABLE : true
F/CoreApps(23818): [1][CommonFeature] ###versionCode : 115082101, CONTACT_PROFILE_SERVICE_ENABLE : true, FREE_MESSAGE_ENABLE : true
F/CoreApps(23818): [ELog][1][EasySignUp] [NotRegistered][014dade2924475c9ae5e0ed07254fa66fa9f1650bb]
F/CoreApps(24071): [1][CommonFeature] ###versionCode : 115082101, CONTACT_PROFILE_SERVICE_ENABLE : true, FREE_MESSAGE_ENABLE : true
F/CoreApps(24071): [1][CommonFeature] ###versionCode : 115082101, CONTACT_PROFILE_SERVICE_ENABLE : true, FREE_MESSAGE_ENABLE : true
F/CoreApps(24071): [ELog][1][EasySignUp] [NotRegistered][014dade2924475c9ae5e0ed07254fa66fa9f1650bb]
F/CoreApps(24352): [1][CommonFeature] ###versionCode : 115082101, CONTACT_PROFILE_SERVICE_ENABLE : true, FREE_MESSAGE_ENABLE : true
F/CoreApps(24352): [1][CommonFeature] ###versionCode : 115082101, CONTACT_PROFILE_SERVICE_ENABLE : true, FREE_MESSAGE_ENABLE : true
F/CoreApps(24352): [ELog][1][EasySignUp] [NotRegistered][014dade2924475c9ae5e0ed07254fa66fa9f1650bb]
F/CoreApps(24586): [1][CommonFeature] ###versionCode : 115082101, CONTACT_PROFILE_SERVICE_ENABLE : true, FREE_MESSAGE_ENABLE : true
F/CoreApps(24586): [1][CommonFeature] ###versionCode : 115082101, CONTACT_PROFILE_SERVICE_ENABLE : true, FREE_MESSAGE_ENABLE : true
F/CoreApps(24586): [ELog][1][EasySignUp] [NotRegistered][014dade2924475c9ae5e0ed07254fa66fa9f1650bb]
F/Finsky:background(25198): [62819] kce.h(3): Service object is not present when stopServiceSafely was called.
F/Finsky:background(25198): com.google.android.flib.log.WhatATerribleException
F/Finsky:background(25198): at adil.h(PG:2)
F/Finsky:background(25198): at com.google.android.finsky.utils.FinskyLog.k(PG:3)
F/Finsky:background(25198): at kce.h(PG:3)
F/Finsky:background(25198): at kce.g(PG)
F/Finsky:background(25198): at kce.e(PG:2)
F/Finsky:background(25198): at kcp.h(PG)
F/Finsky:background(25198): at kcn.a(PG:4)
F/Finsky:background(25198): at kcp.j(PG:1)
F/Finsky:background(25198): at kcp.c(PG)
F/Finsky:background(25198): at jzy.e(PG:12)
F/Finsky:background(25198): at jzv.apply(PG:117)
F/Finsky:background(25198): at j$.util.stream.s.accept(SourceFile:45)
F/Finsky:background(25198): at j$.util.a.forEachRemaining(SourceFile:20)
F/Finsky:background(25198): at j$.util.stream.c.y(SourceFile:21)
F/Finsky:background(25198): at j$.util.stream.c.G(SourceFile:8)
F/Finsky:background(25198): at j$.util.stream.Z0.e(SourceFile:1)
F/Finsky:background(25198): at j$.util.stream.c.J(SourceFile:35)
F/Finsky:background(25198): at j$.util.stream.A1.collect(SourceFile:83)
F/Finsky:background(25198): at jzm.a(PG:57)
F/Finsky:background(25198): at akic.e(PG:2)
F/Finsky:background(25198): at akie.run(PG:9)
F/Finsky:background(25198): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
F/Finsky:background(25198): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
F/Finsky:background(25198): at htq.run(PG:40)
F/Finsky:background(25198): at java.lang.Thread.run(Thread.java:818)
F/Finsky:background(26867): [62984] kce.h(3): Service object is not present when stopServiceSafely was called.
F/Finsky:background(26867): com.google.android.flib.log.WhatATerribleException
F/Finsky:background(26867): at adil.h(PG:2)
F/Finsky:background(26867): at com.google.android.finsky.utils.FinskyLog.k(PG:3)
F/Finsky:background(26867): at kce.h(PG:3)
F/Finsky:background(26867): at kce.g(PG)
F/Finsky:background(26867): at kce.e(PG:2)
F/Finsky:background(26867): at kcp.h(PG)
F/Finsky:background(26867): at kcn.a(PG:4)
F/Finsky:background(26867): at kcp.j(PG:1)
F/Finsky:background(26867): at kcp.c(PG)
F/Finsky:background(26867): at jzy.e(PG:12)
F/Finsky:background(26867): at jzv.apply(PG:117)
F/Finsky:background(26867): at j$.util.stream.s.accept(SourceFile:45)
F/Finsky:background(26867): at j$.util.a.forEachRemaining(SourceFile:20)
F/Finsky:background(26867): at j$.util.stream.c.y(SourceFile:21)
F/Finsky:background(26867): at j$.util.stream.c.G(SourceFile:8)
F/Finsky:background(26867): at j$.util.stream.Z0.e(SourceFile:1)
F/Finsky:background(26867): at j$.util.stream.c.J(SourceFile:35)
F/Finsky:background(26867): at j$.util.stream.A1.collect(SourceFile:83)
F/Finsky:background(26867): at jzm.a(PG:57)
F/Finsky:background(26867): at akic.e(PG:2)
F/Finsky:background(26867): at akie.run(PG:9)
F/Finsky:background(26867): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
F/Finsky:background(26867): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
F/Finsky:background(26867): at htq.run(PG:40)
F/Finsky:background(26867): at java.lang.Thread.run(Thread.java:818)

Related

flutter_tex not able to render on my Samsung galaxy A1 but able to render on Infinix hot S3

Whenever I try to render it on the Samsung galaxy A1, below is what I see at the debug console
I/ViewRootImpl#479f7f7[MainActivity](29510): ViewPostIme pointer 0
I/ViewRootImpl#479f7f7[MainActivity](29510): ViewPostIme pointer 1
D/ConnectivityManager(29510): requestNetwork; CallingUid : 10246, CallingPid : 29510
D/ConnectivityManager(29510): requestNetwork; CallingUid : 10246, CallingPid : 29510
I/BufferQueue(29510): [unnamed-29510-2](this:0x74bff06800,id:2,api:0,p:-1,c:-1) BufferQueue core=(29510:com.kumah.learnmath)
E/libc (29510): Access denied finding property "vendor.debug.bq.dump"
I/BufferQueueConsumer(29510): [unnamed-29510-2](this:0x74bff06800,id:2,api:0,p:-1,c:29510) connect(C): consumer=(29510:com.kumah.learnmath) controlledByApp=true
E/libc (29510): Access denied finding property "vendor.debug.bq.dump"
I/BufferQueueConsumer(29510): [unnamed-29510-2](this:0x74bff06800,id:2,api:0,p:-1,c:29510) setConsumerName: unnamed-29510-2
E/libc (29510): Access denied finding property "vendor.debug.bq.dump"
I/BufferQueueConsumer(29510): [SurfaceTexture-0-29510-2](this:0x74bff06800,id:2,api:0,p:-1,c:29510) setConsumerName: SurfaceTexture-0-29510-2
D/Surface (29510): Surface::connect(this=0x7475ac2000,api=1)
D/Surface (29510): Surface::setBufferCount(this=0x7475ac2000,bufferCount=3)
I/BufferQueueConsumer(29510): [SurfaceTexture-0-29510-2](this:0x74bff06800,id:2,api:0,p:-1,c:29510) setDefaultBufferSize: width=720 height=2
I/chromium(29510): [INFO:CONSOLE(1)] "Uncaught ReferenceError: initView is not defined", source: chrome-error://chromewebdata/ (1)
W/IMGSRV (29510): glGetString:4370: Override GL_RENDERER PowerVR SGX Doma
W/IMGSRV (29510): glGetString:4370: Override GL_RENDERER PowerVR SGX Doma
but it worked on the Infinix hot S3

Flutter, simple method channel not working

I followed this https://docs.flutter.dev/development/platform-integration/platform-channels
D/InputTransport(12698): Input channel constructed: 'ClientS', fd=180
D/InputMethodManager(12698): prepareNavigationBarInfo() DecorView#9959d90[MainActivity]
D/InputMethodManager(12698): getNavigationBarColor() -16711423
V/InputMethodManager(12698): Starting input: tba=com.abc ic=null mNaviBarColor -16711423 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager(12698): startInputInner - Id : 0
I/SurfaceControl(12698): nativeRelease nativeObject s[-5476376642254367232]
I/SurfaceControl(12698): nativeRelease nativeObject e[-5476376642254367232]
I/SurfaceControl(12698): nativeRelease nativeObject s[-5476376642254367552]
I/SurfaceControl(12698): nativeRelease nativeObject e[-5476376642254367552]
continuously shows this.
The strange thing is that in Android project, clean project, rebuild, and turn off and restart Android studio sometimes works. (Only sometimes I can see the print("it works"); in MainActivity more specifically, inside of "configureFlutterEngine" function

flutter-keyboard hides itself when clicked on textfield

I/ViewRootImpl#799941b[MainActivity](12513): ViewPostIme pointer 0
I/ViewRootImpl#799941b[MainActivity](12513): ViewPostIme pointer 1
D/InputMethodManager(12513): SSI - flag : 0 Pid : 12513 view : com.example.facatte
D/InputMethodManager(12513): prepareNavigationBarInfo() DecorView#f0b7259[MainActivity]
D/InputMethodManager(12513): getNavigationBarColor() -855310
D/InputMethodManager(12513): prepareNavigationBarInfo() DecorView#f0b7259[MainActivity]
D/InputMethodManager(12513): getNavigationBarColor() -855310
V/InputMethodManager(12513): Starting input: tba=com.example.facatte ic=io.flutter.plugin.editing.InputConnectionAdaptor#8b758fe mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager(12513): startInputInner - Id : 0
I/InputMethodManager(12513): startInputInner - mService.startInputOrWindowGainedFocus
D/InputTransport(12513): Input channel destroyed: 'ClientS', fd=93
W/IInputConnectionWrapper(12513): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper(12513): requestCursorAnchorInfo on inactive InputConnection
I/ViewRootImpl#799941b[MainActivity](12513): MSG_RESIZED: frame=(0,0,1080,2340) ci=(0,83,0,989) vi=(0,83,0,989) or=1
I/ViewRootImpl#799941b[MainActivity](12513): Relayout returned: old=(0,0,1080,2340) new=(0,0,1080,2340) req=(1080,2340)0 dur=12 res=0x1 s={true 518951051264} ch=false
D/InputMethodManager(12513): HSIFW - flag : 0
I/ViewRootImpl#799941b[MainActivity](12513): MSG_RESIZED: frame=(0,0,1080,2340) ci=(0,83,0,126) vi=(0,83,0,126) or=1
I/ViewRootImpl#799941b[MainActivity](12513): Relayout returned: old=(0,0,1080,2340) new=(0,0,1080,2340) req=(1080,2340)0 dur=12 res=0x1 s={true 518951051264} ch=false
This is the output in console when tapping on the textfield.
The keyboard comes up for 2 seconds and then hides automatically. It doesnt throw any error too !
GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
final _formKey = GlobalKey<FormState>();
TextEditingController textEditingController = new TextEditingController();
return Scaffold(
key: _scaffoldKey,
body : Form(
key: _formKey,
child: TextField(
controller: textEditingController,
decoration: new InputDecoration(
hintText: 'Type Your Data',
),
),
));
Or If you are using Multiple TextFields then use a separate controller for each TextField. I hope this will work for you.

contact picker causing app crash after I am selecting contact from contact list

I am using Flutter contact picker 0.0.2. But it is giving some weird error. It shows the contact list when I call selectContact Future, however, after selecting a particular contact from the list, the app crashes, and it gives me the below-mentioned error on console.
I have also tried with adding permission in android, even though it is not required, still, it does not work.
Code :
class _MobileNumberWidgetState extends State<MobileNumberWidget> {
final TextEditingController _phoneNumberController = TextEditingController();
final ContactPicker _contactPicker = new ContactPicker();
Contact _contact;
#override
Widget build(BuildContext context) {
return AppWidgets.shadowContainerComplete(
child:Row(
children: <Widget>[
Expanded(
child: TextField(
controller: _phoneNumberController,
decoration: AppStyles.textField(hint: "Enter Phone Number", iconData: Icons.phone_iphone),
),
),
IconButton(
icon: Icon(Icons.format_list_numbered),
onPressed: () async{
Contact contact = await _contactPicker.selectContact();
setState(() {
_contact = contact;
});
},
)
],
)
);
}
}
Console :
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk...
D/FlutterActivity(17398): Using the launch theme as normal theme.
D/FlutterActivityAndFragmentDelegate(17398): Setting up FlutterEngine.
D/FlutterActivityAndFragmentDelegate(17398): No preferred FlutterEngine was provided. Creating a new FlutterEngine for this FlutterFragment.
D/FlutterActivityAndFragmentDelegate(17398): Attaching FlutterEngine to the Activity that owns this Fragment.
D/FlutterView(17398): Attaching to a FlutterEngine: io.flutter.embedding.engine.FlutterEngine#43c3a74
D/FlutterActivityAndFragmentDelegate(17398): Executing Dart entrypoint: main, and sending initial route: /
Debug service listening on ws://127.0.0.1:28145/jPIcHt_yF9E=/ws
Syncing files to device Android SDK built for x86...
D/EGL_emulation(17398): eglMakeCurrent: 0xe121a6c0: ver 3 1 (tinfo 0xe120f8a0)
D/eglCodecCommon(17398): setVertexArrayObject: set vao to 0 (0) 1 0
D/EGL_emulation(17398): eglMakeCurrent: 0xe121a180: ver 3 1 (tinfo 0xe120fa70)
D/FlutterView(17398): Detaching from a FlutterEngine: io.flutter.embedding.engine.FlutterEngine#43c3a74
D/AndroidRuntime(17398): Shutting down VM
E/AndroidRuntime(17398): FATAL EXCEPTION: main
E/AndroidRuntime(17398): Process: maaz.easyapproach.kashbak, PID: 17398
E/AndroidRuntime(17398): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2015, result=-1, data=Intent { dat=content://com.android.contacts/data/1 flg=0x1 }} to activity {maaz.easyapproach.kashbak/maaz.easyapproach.kashbak.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.ContentResolver android.app.Activity.getContentResolver()' on a null object reference
E/AndroidRuntime(17398): at android.app.ActivityThread.deliverResults(ActivityThread.java:4845)
E/AndroidRuntime(17398): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4886)
E/AndroidRuntime(17398): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
E/AndroidRuntime(17398): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(17398): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(17398): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
E/AndroidRuntime(17398): at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(17398): at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(17398): at android.app.ActivityThread.main(ActivityThread.java:7356)
E/AndroidRuntime(17398): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(17398): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime(17398): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/AndroidRuntime(17398): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.ContentResolver android.app.Activity.getContentResolver()' on a null object reference
E/AndroidRuntime(17398): at net.goderbauer.flutter.contactpicker.ContactPickerPlugin.onActivityResult(ContactPickerPlugin.java:68)
E/AndroidRuntime(17398): at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEnginePluginRegistry.java:634)
E/AndroidRuntime(17398): at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onActivityResult(FlutterEnginePluginRegistry.java:367)
E/AndroidRuntime(17398): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:546)
E/AndroidRuntime(17398): at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:594)
E/AndroidRuntime(17398): at android.app.Activity.dispatchActivityResult(Activity.java:8110)
E/AndroidRuntime(17398): at android.app.ActivityThread.deliverResults(ActivityThread.java:4838)
E/AndroidRuntime(17398): ... 11 more
I/Process (17398): Sending signal. PID: 17398 SIG: 9
Lost connection to device.

Unable to enlist connection in transaction: enlistResource returns 'false'

All of sudden I got the following error continuously for a select query.
Unable to enlist connection in transaction: enlistResource returns 'false'
This appears to be thrown from DBCP (https://commons.apache.org/proper/commons-dbcp/jacoco/org.apache.commons.dbcp2.managed/TransactionContext.java.html)
Essentially, this code calls javax.transaction.Transaction.enlistResource
Looking at the API, it says "Enlist the resource specified with the transaction associated with the target Transaction object. true if the resource was enlisted successfully; otherwise false."
I am still not clear why this exception thrown.
What is enlist the resource to transaction?
When enlist resource returns false? I mean when transaction will not be able to enlist the resource?
How to avoid this problem?
Tech Stack:
TomEE 7.0.4
JPA
MariaDB
Data source config:
<Resource id="jdbc/myDS" type="javax.sql.DataSource">
dataSourceCreator = tomcat
jtaManaged = true
driverClassName = ${jdbc.driver}
url = ${jdbc.url}
username = ${jdbc.username}
password = ${jdbc.password}
initialSize = 5
maxActive = 100
maxIdle = 10
minIdle = 5
maxWait = 30000
validationQuery = SELECT 1
testOnBorrow = false
testOnReturn = false
testWhileIdle = true
timeBetweenEvictionRunsMillis = 1800000
numTestsPerEvictionRun = 2
minEvictableIdleTimeMillis = 1800000
accessToUnderlyingConnectionAllowed = false
</Resource>
Stack Trace:
Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Unable to enlist connection in transaction: enlistResource returns 'false'.
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:218) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:198) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$000(LoggingConnectionDecorator.java:58) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection.prepareStatement(LoggingConnectionDecorator.java:250) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:133) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator$ConfiguringConnection.prepareStatement(ConfiguringConnectionDecorator.java:139) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:133) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$RefCountConnection.prepareStatement(JDBCStoreManager.java:1642) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:122) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:513) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:493) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.jdbc.sql.SelectImpl.prepareStatement(SelectImpl.java:480) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:421) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:392) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:427) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:230) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:220) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:93) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.open(QueryImpl.java:2075) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:33) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1257) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1013) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:869) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:800) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:541) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:274) ~[openjpa-2.4.2.jar:2.4.2]
at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:290) ~[openjpa-2.4.2.jar:2.4.2]
Just had the same issue and digged a little more into my log file. Right before the first appearance of
enlistResource returns 'false'
I found a
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Checking further up and found a
WARNING [https-jsse-nio-8443-exec-1] org.apache.geronimo.transaction.manager.TransactionImpl.enlistResource Unable to enlist XAResource org.apache.openejb.resource.jdbc.managed.local.LocalXAResource#2ce72e5a, errorCode: 0
javax.transaction.xa.XAException: Count not turn off auto commit for a XA transaction
All this leaded me to a old post from tomee-openejb mailing list. So my recent tomee.xml configuration looked like that:
<Resource id="[Resourcename]" type="javax.sql.DataSource">
jdbcDriver = com.mysql.jdbc.Driver
jdbcUrl = jdbc:mysql://localhost:3306/[Databasename]
userName = [Username]
password = [Password]
</Resource>
Now I changed it to the following config:
<Resource id=[Name] type="javax.sql.DataSource">
jdbcDriver = com.mysql.jdbc.Driver
jdbcUrl = jdbc:mysql://localhost:3306/[Databasename]
jtaManaged = true
username = [Username]
password = [Password]
defaultAutoCommit = false
testOnReturn = true
testWhileIdle = true
timeBetweenEvictionRunsMillis = 60
initialSize = 2
minIdle = 2
validationQuery = "select 1"
</Resource>
Finger crossed that it will work without any further issue. If I don't update here anymore it will just have worked fine.
Further information:
Tomee DataSource Configuration