Can you guess where this exception is coming from? - java

I've deployed a GWT app and have set up an exception reporter so that I get log entries on the server when a client throws an exception. Usually this is very helpful and I've killed a lot of bugs with this information. However, this stack trace has me stumped:
com.allen_sauer.gwt.log.server.ServerLogImplJDK14 log: Uncaught Exception:
com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses
at Unknown.EJb(StackTraceCreator.java:147)
at Unknown.SAb(StackTraceCreator.java:387)
at Unknown.eHb(Throwable.java:46)
at Unknown.KXb(com.google.gwt.dev.jjs.ast.JProgram:0)
at Unknown.AM(SimpleEventBus.java:214)
at Unknown.EM(SimpleEventBus.java:103)
at Unknown.bXb(HandlerManager.java:96)
at Unknown.ux(Widget.java:107)
at Unknown.USb(DomEvent.java:116)
at Unknown.xx(UIObject.java:529)
at Unknown.Mx(Widget.java:141)
at Unknown.ixc(DOM.java:1264)
at Unknown.anonymous(DOMImplStandard.java:187)
at Unknown.HIb(Impl.java:214)
at Unknown.anonymous(Impl.java:57)
at .(:0)
at ==================Caused by==================.(:0)
at Unknown.EJb(StackTraceCreator.java:147)
at Unknown.SAb(StackTraceCreator.java:387)
at Unknown.y0c(Throwable.java:46)
at Unknown.KZc(Number.java:192)
at Unknown.Y$c(Float.java:60)
at Unknown.wV(TextBoxBase.java:106)
at Unknown.yTb(ClickEvent.java:53)
at Unknown.AM(SimpleEventBus.java:204)
at Unknown.EM(SimpleEventBus.java:103)
at Unknown.bXb(HandlerManager.java:96)
at Unknown.ux(Widget.java:107)
at Unknown.USb(DomEvent.java:116)
at Unknown.xx(UIObject.java:529)
at Unknown.Mx(Widget.java:141)
at Unknown.ixc(DOM.java:1264)
at Unknown.anonymous(DOMImplStandard.java:187)
at Unknown.HIb(Impl.java:214)
at Unknown.anonymous(Impl.java:57)
These are all GWT files, except StackTraceCreator, which is part of gwt-log, the program reporting these exceptions to me. I've never seen this exception on a development machine, and I don't have even the beginnings of reproduction steps.
How can I start to track this down?

GWT apps are by default compiled with obfuscation turned on.
So you can either turn obfuscation off, or try to re-symbolize your stack traces, as explained in this issue report of gwt-log: http://code.google.com/p/gwt-log/issues/detail?id=38
This should probably be used best together with these options in your .gwt.xml file (I assume, you already did that):
<set-property name="compiler.emulatedStack" value="true" />
<set-configuration-property name="compiler.emulatedStack.recordLineNumbers"
value="true"/>
<set-configuration-property name="compiler.emulatedStack.recordFileNames"
value="true"/>
(see http://code.google.com/p/gwt-log/wiki/GettingStarted)

Related

StackOverflowError in log4j2

I have a strange "infinite loop" in log4j2.
I found it in the tomcat catalina.out and have to idea where it comes from because there is no other packages involved the whole error stack trace.
Is this a know bug or did I configure something wrong.
The version of log4j2 I'm using is 2.17.1
2022-01-25 01:17:03,517 WARN org.apache.commons.logging.LogAdapter$Log4jLog caught java.lang.StackOverflowError logging SimpleMessage: Application exception overridden by rollback exception java.lang.StackOverflowError
at org.apache.logging.log4j.util.StringBuilders.appendSpecificTypes(StringBuilders.java:79)
at org.apache.logging.log4j.message.ParameterFormatter.appendSpecialTypes(ParameterFormatter.java:484)
at org.apache.logging.log4j.message.ParameterFormatter.recursiveDeepToString(ParameterFormatter.java:473)
at org.apache.logging.log4j.message.ParameterFormatter.recursiveDeepToString(ParameterFormatter.java:448)
at org.apache.logging.log4j.message.ParameterFormatter.formatMessage2(ParameterFormatter.java:191)
at org.apache.logging.log4j.message.ParameterizedMessage.formatTo(ParameterizedMessage.java:227)
at org.apache.logging.log4j.message.ParameterizedMessage.getFormattedMessage(ParameterizedMessage.java:203)
at org.apache.logging.log4j.message.ParameterizedNoReferenceMessageFactory.newMessage(ParameterizedNoReferenceMessageFactory.java:105)
at org.apache.logging.log4j.message.AbstractMessageFactory.newMessage(AbstractMessageFactory.java:99)
at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:2057)
at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1931)
at org.apache.logging.log4j.spi.AbstractLogger.warn(AbstractLogger.java:2805)
at org.apache.logging.log4j.spi.AbstractLogger.handleLogMessageException(AbstractLogger.java:2225)
at org.apache.logging.log4j.spi.AbstractLogger.tryLogMessage(AbstractLogger.java:2208)
at org.apache.logging.log4j.spi.AbstractLogger.logMessageTrackRecursion(AbstractLogger.java:2159)
at org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2142)
at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:2058)
at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1931)
at org.apache.logging.log4j.spi.AbstractLogger.warn(AbstractLogger.java:2805)
at org.apache.logging.log4j.spi.AbstractLogger.handleLogMessageException(AbstractLogger.java:2225)
at org.apache.logging.log4j.spi.AbstractLogger.tryLogMessage(AbstractLogger.java:2208)
at org.apache.logging.log4j.spi.AbstractLogger.logMessageTrackRecursion(AbstractLogger.java:2159)
at org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2142)
at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:2058)
at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1931)
at org.apache.logging.log4j.spi.AbstractLogger.warn(AbstractLogger.java:2805)
at org.apache.logging.log4j.spi.AbstractLogger.handleLogMessageException(AbstractLogger.java:2225)
at org.apache.logging.log4j.spi.AbstractLogger.tryLogMessage(AbstractLogger.java:2208)
at org.apache.logging.log4j.spi.AbstractLogger.logMessageTrackRecursion(AbstractLogger.java:2159)
at org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2142)
at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:2058)

How to know from which activity an error comes from my application in production?

My application is 2 months in production and I was checking the section that shows the play console crashing and I have been able to solve some problems, but there are some in which I do not know exactly what activity they come from, mi error is java.lang.IllegalStateException and when I press see more:
java.lang.IllegalStateException:
at androidx.work.impl.utils.ForceStopRunnable.run (ForceStopRunnable.java:115)
at androidx.work.impl.utils.SerialExecutor$Task.run (SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
at java.lang.Thread.run (Thread.java:919)
Caused by: android.database.sqlite.SQLiteCantOpenDatabaseException:
at android.database.sqlite.SQLiteConnection.nativeOpen (Native Method)
at android.database.sqlite.SQLiteConnection.open (SQLiteConnection.java:300)
at android.database.sqlite.SQLiteConnection.open (SQLiteConnection.java:218)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked (SQLiteConnectionPool.java:737)
at android.database.sqlite.SQLiteConnectionPool.open (SQLiteConnectionPool.java:284)
at android.database.sqlite.SQLiteConnectionPool.open (SQLiteConnectionPool.java:251)
at android.database.sqlite.SQLiteDatabase.openInner (SQLiteDatabase.java:1386)
at android.database.sqlite.SQLiteDatabase.open (SQLiteDatabase.java:1331)
at android.database.sqlite.SQLiteDatabase.openDatabase (SQLiteDatabase.java:967)
at android.database.sqlite.SQLiteDatabase.openDatabase (SQLiteDatabase.java:955)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked (SQLiteOpenHelper.java:448)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase (SQLiteOpenHelper.java:391)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase (FrameworkSQLiteOpenHelper.java:145)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase (FrameworkSQLiteOpenHelper.java:106)
at androidx.room.RoomDatabase.beginTransaction (RoomDatabase.java:352)
at androidx.work.impl.utils.ForceStopRunnable.cleanUp (ForceStopRunnable.java:156)
at androidx.work.impl.utils.ForceStopRunnable.run (ForceStopRunnable.java:87)
Out of 750 users who have installed my application it happened to one 5 times, Should a bug that happened to a single user (of 750) be investigated or not?, And most importantly, how can I know exactly where the error came from?
When throwing an exception, put the user that is currently being accessed so you can track it down. Put as much info in the exception as possible that will help you figure out which item might be causing it.
https://stackify.com/best-practices-exceptions-java/
These are some good examples as well as good practices to follow. In those messages that are mentioned, add the user id or something that helps you identify what's going on. Learn to make custom exceptions and catch the most specific exceptions you can. Don't just catch Exception, its better to be specific about the exception your catching rather than casting a wide net.

Ofbiz error: Could not find simple-method

I have repeatedly this error in ofbiz.log:
Error running the simple-method: Could not find <simple-method name="checkProductRelatedPermission"> in XML document
This is weird, because I have a declaration of this method in my ProductServices.xml: <simple-method method-name="checkProductRelatedPermission" short-description="Check Product Related Permission">
I didn't have this error before and the system was running properly for the pass 6 months. (currently product index is increasing)
Is it related to insufficient memory allocated for ofbiz? Because the server is running on limited memory.
[Update]
This is the service declaration in ProductServices.xml
<simple-method method-name="productGenericPermission" short-description="Main permission logic">
<set field="mainAction" from-field="parameters.mainAction"/>
<if-empty field="mainAction">
<add-error>
<fail-property resource="ProductUiLabels" property="ProductMissingMainActionInPermissionService"/>
</add-error>
<check-errors/>
</if-empty>
<set field="callingMethodName" from-field="parameters.resourceDescription"/>
<set field="checkAction" from-field="parameters.mainAction"/>
<call-simple-method method-name="checkProductRelatedPermission"/>
<if-empty field="error_list">
<set field="hasPermission" type="Boolean" value="true"/>
<field-to-result field="hasPermission"/>
<else>
<property-to-field resource="ProductUiLabels" property="ProductPermissionError" field="failMessage"/>
<set field="hasPermission" type="Boolean" value="false"/>
<field-to-result field="hasPermission"/>
<field-to-result field="failMessage"/>
</else>
</if-empty>
</simple-method>
Execution of <call-simple-method method-name="checkProductRelatedPermission"/> throw an exception.
If I restart the server, the same execution of the process won't throw this exception. The error happened after user heavily enter new product and update product. I can see heavy lucene process in the log.
I increased the server memory from 2GB to 4GB, java memory Xmx:1024m to Xmx:1512. Currently the ofbiz is still running properly after 6 hours monitor.
[Update]
java.net.URL url = new java.net.URL("file:/home/ofbiz/ofbiz/applications/product/script/org/ofbiz/product/product/ProductServices.xml");
System.out.println(org.ofbiz.minilang.SimpleMethod.getSimpleMethod(url, "checkProductRelatedPermission"));
Ouput is simple-method which means the method is found.
Beside, same process execute over thousand and error thrown after thousands execution (randomly). Sometime after few hours, sometime after few days.
The declaration in your xml is with "method-name". The error message says you are missing a tag with "name".
Nothing wrong with the configuration. The problem is JobSandbox (createAlsoBoughtProductAssocs) have to many running instance, pending and queued instance. Those jobs consume all memory and make cpu usage high.
Removed createAlsoBoughtProductAssocs jobs and problem disappeared.

Fullscreen Exclusive Unhandled Exception

I am currently implementing a fullscreen-exclusive mode in my Java2D-Application. While testing on several systems (all Windows 7/8.x) with most recent (18. February 2015) JRE, I can reproduce a application crash which does NOT throw an exception:
If you are in fullscreen-exclusive mode (yes: I check for supported display modes) and turn off the monitor which displays the application, the application crashes. No exception thrown. My guess is, that the vsync-component of Java2D crashes, but I lack the required experience in Java. Can someone help me out here on how I can handle this exception (by switching back to windowed-mode for example). Something like "isDisplayDeviceReady()" might also be helpful.
Thank you for your time.
This is what Windows shows me after application crash:
Problemsignatur:
Problemereignisname: APPCRASH
Anwendungsname: javaw.exe Anwendungsversion: 8.0.31.13
Anwendungszeitstempel: 54925fd3 Fehlermodulname: StackHash_915d
Fehlermodulversion: 6.1.7601.18247
Fehlermodulzeitstempel: 521ea8e7 Ausnahmecode: c0000374
Ausnahmeoffset: 000ce753
Betriebsystemversion: 6.1.7601.2.1.0.256.48 Gebietsschema-ID: 2055
Zusatzinformation 1: 915d
Zusatzinformation 2:
915d12e427f130d100a5a047f72f08c0
Zusatzinformation 3: 8dd4
Zusatzinformation 4: 8dd4ced129ecb79ce625a0ed8d82cee9

Questions about native calltrace using Java

We're debugging an error that causing a crash in a Tomcat web application.
The application uses 2 3rd-party apps over jni, one of the 3rd-parties using SmartHeap (it is a memory management library for c/c++ applications), the other don't (it is webMethods broker version 5).
The strange thing is I see in the crash log that webMethods calls its native methods to initiate a connection to the broker server, but if I print the call trace of the thread where the crash happened using WinDbg (loading the minidump file created when the JVM crashed), it contains calls to SmartHeap functions. Now i feel I'm a bit lost... because I've checked, and found no references to this dll from the webMethods binaries.
(actually a memory allocation is called)
My question is how is it possible?
I mean anybody could describe how this part is working? Because I thought that the interpreted/compiled and native frames are called in a fixed order (it is logical).
maybe the call stack is invalid? (now we have many dump files with almost the same call trace)
or the call trace (the calling order of the native functions) is valid, only some of the functions have been reordered before calling (like a lazy object has to be generated before sending it to the webMethods broker, but i don't see any sign of this)
I'm querying the call trace on the dump file by calling ".ecxr" and "kv", the output is:
0:060> .ecxr
eax=4d330554 ebx=4d350010 ecx=4d330010 edx=00000000 esi=4d350010 edi=00000000
eip=4c912f15 esp=4bf1dad0 ebp=3574884d iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010206
shsmp!shi_allocSmall2+0x195:
4c912f15 8b4d00 mov ecx,dword ptr [ebp] ss:0023:3574884d=????????
0:060> k
*** Stack trace for last set context - .thread/.cxr resets it
ChildEBP RetAddr
4bf1daec 4c912bbd shsmp!shi_allocSmall2+0x195
4bf1dafc 4c91b973 shsmp!MemAllocPtr+0x5d
*** WARNING: Unable to verify checksum for awssl50jn.dll
*** ERROR: Symbol file could not be found. Defaulted to export symbols for awssl50jn.dll -
4bf1db14 49abc38d shsmp!shi_malloc_dbg+0x23
WARNING: Stack unwind information not available. Following frames may be wrong.
4bf1db3c 49abeca2 awssl50jn!Java_COM_activesw_api_client_ssl_AwSSLNative_getSecurityInfo+0xa1cd
4bf1db48 49ab5e66 awssl50jn!Java_COM_activesw_api_client_ssl_AwSSLNative_getSecurityInfo+0xcae2
4bf1db4c 49ab5e55 awssl50jn!Java_COM_activesw_api_client_ssl_AwSSLNative_getSecurityInfo+0x3ca6
4bf1db60 49ab667d awssl50jn!Java_COM_activesw_api_client_ssl_AwSSLNative_getSecurityInfo+0x3c95
4bf1db80 49abdbbc awssl50jn!Java_COM_activesw_api_client_ssl_AwSSLNative_getSecurityInfo+0x44bd
4bf1dc20 4c912f4f awssl50jn!Java_COM_activesw_api_client_ssl_AwSSLNative_getSecurityInfo+0xb9fc
4bf1dc78 49abd607 shsmp!shi_allocSmall2+0x1cf
00000000 00000000 awssl50jn!Java_COM_activesw_api_client_ssl_AwSSLNative_getSecurityInfo+0xb447`
Any help would be appreciated!

Categories