Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UUID NoClassDefFoundError exceptions #26

Closed
Jordi-m opened this issue Feb 20, 2014 · 2 comments
Closed

UUID NoClassDefFoundError exceptions #26

Jordi-m opened this issue Feb 20, 2014 · 2 comments

Comments

@Jordi-m
Copy link
Contributor

Jordi-m commented Feb 20, 2014

During the development of our Android app Standby we now and than see errors which we cannot trace to our own code/implementation ('NoClassDefFoundError'). We're wondering if any one has seen these errors as wel before and maybe even know how we can fix this.

At this point even we are unable to reproduce this when we want to. For now it seems to happen at random for us (we didn't figure out yet what actually triggers these errors).

Error seen during testing on:

  • Samsung Galaxy SII (Android 4.1.2)
  • Samsung Galaxy S (Android 2.2.1)
  • HTC Wildfire (Android 2.2.1)
  • Nexus 5 (Android 4.4.2)

EVE version: 2.1.0-SNAPSHOT

Stacktrace:

01-02 09:15:18.915: ERROR/com.askcs.standby.agent.AgentRunnable(3727): Agent runnable caught
java.lang.NoClassDefFoundError: com/almende/util/uuid/UUIDGen
at com.almende.util.uuid.UUID.(UUID.java:81)
at com.almende.eve.rpc.jsonrpc.JSONRPC.createRequest(JSONRPC.java:508)
at com.almende.eve.agent.AgentHost$1.invoke(AgentHost.java:198)
at $Proxy4.getParentGroups(Native Method)
at com.askcs.standby.modules.groups.GroupsMembersRefreshRunnable.runAgent(GroupsMembersRefreshRunnable.java:35)
at com.askcs.standby.agent.AgentRunnable.run(AgentRunnable.java:95)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)
01-02 09:15:19.015: ERROR/com.askcs.standby.agent.AgentRunnable(3727): Agent runnable caught
java.lang.NoClassDefFoundError: com/almende/util/uuid/UUIDGen
at com.almende.util.uuid.UUID.(UUID.java:81)
at com.almende.eve.rpc.jsonrpc.JSONRPC.createRequest(JSONRPC.java:508)
at com.almende.eve.agent.AgentHost$1.invoke(AgentHost.java:198)
at $Proxy4.getParentMonitorsWithBalance(Native Method)
at com.askcs.standby.modules.groups.GroupsOverviewRefreshRunnable.runAgent(GroupsOverviewRefreshRunnable.java:29)
at com.askcs.standby.agent.AgentRunnable.run(AgentRunnable.java:95)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)
01-02 09:15:19.100: ERROR/com.askcs.standby.agent.AgentRunnable(3727): Agent runnable caught
java.lang.NoClassDefFoundError: com/almende/util/uuid/UUIDGen
at com.almende.util.uuid.UUID.(UUID.java:81)
at com.almende.eve.rpc.jsonrpc.JSONRPC.createRequest(JSONRPC.java:508)
at com.almende.eve.agent.AgentHost$1.invoke(AgentHost.java:198)
at $Proxy7.getSlotsCombined(Native Method)
at com.askcs.standby.agent.StandByAgent.getSlotsCombined(StandByAgent.java:345)
at com.askcs.standby.modules.agenda.SlotRefreshRunnable.runAgent(SlotRefreshRunnable.java:42)
at com.askcs.standby.agent.AgentRunnable.run(AgentRunnable.java:95)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)
01-02 09:15:19.180: ERROR/com.askcs.standby.agent.AgentRunnable(3727): Agent runnable caught
java.lang.NoClassDefFoundError: com/almende/util/uuid/UUIDGen
at com.almende.util.uuid.UUID.(UUID.java:81)
at com.almende.eve.rpc.jsonrpc.JSONRPC.createRequest(JSONRPC.java:508)
at com.almende.eve.agent.AgentHost$1.invoke(AgentHost.java:198)
at $Proxy8.getMonitorAgents2(Native Method)
at com.askcs.standby.agent.StandByAgent.refreshAssemblies(StandByAgent.java:306)
at com.askcs.standby.modules.current.AssemblyRefreshRunnable.runAgent(AssemblyRefreshRunnable.java:22)
at com.askcs.standby.agent.AgentRunnable.run(AgentRunnable.java:95)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)
01-02 09:15:19.400: ERROR/com.askcs.standby.agent.AgentRunnable(3727): Agent runnable caught
java.lang.NoClassDefFoundError: com/almende/util/uuid/UUIDGen
at com.almende.util.uuid.UUID.(UUID.java:81)
at com.almende.eve.rpc.jsonrpc.JSONRPC.createRequest(JSONRPC.java:508)
at com.almende.eve.agent.AgentHost$1.invoke(AgentHost.java:198)
at $Proxy9.getAllQuestions(Native Method)
at com.askcs.standby.modules.messages.AlertRefreshRunnable.runAgent(AlertRefreshRunnable.java:41)
at com.askcs.standby.agent.AgentRunnable.run(AgentRunnable.java:95)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)
01-02 09:15:19.600: ERROR/com.askcs.standby.agent.AgentRunnable(3727): Agent runnable caught
java.lang.NoClassDefFoundError: com/almende/util/uuid/UUIDGen
at com.almende.util.uuid.UUID.(UUID.java:81)
at com.almende.eve.rpc.jsonrpc.JSONRPC.createRequest(JSONRPC.java:508)
at com.almende.eve.agent.AgentHost$1.invoke(AgentHost.java:198)
at $Proxy10.getAllMessages(Native Method)
at com.askcs.standby.modules.messages.MessageRefreshRunnable.runAgent(MessageRefreshRunnable.java:62)
at com.askcs.standby.agent.AgentRunnable.run(AgentRunnable.java:95)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)

@ludost
Copy link
Member

ludost commented Feb 20, 2014

Hi Jordi,

Can you try the two steps the following accepted Stackoverflow answer mentions:
http://stackoverflow.com/questions/8678630/noclassdeffounderror-for-code-in-an-java-library-on-android

This makes sure that all dependencies are correctly exported in the APK.

Another reason for this specific error could be that part of the app is reloaded by the VM, while other classes are still in memory. This might happen if e.g. a thread remains active while the main activity is reloaded. This might be triggered by putting the app in the background, do some foreground work and returning to the app.

@ludost
Copy link
Member

ludost commented Mar 3, 2014

Ok, after some good searching by @3R1K , he found out this is a secondary issue, triggered by an initialisation error in the UUIDGen class. Basically the UUIDGen class contains a static block, which does network interfacing (obtaining mac-address) which on Android is not allowed in the visualisation-thread. This threw an exception, after which this class was not available for usage anymore, leading to above stacktrace.

A possible workaround can be to make sure the class first gets initialized in a background thread.

@ludost ludost closed this as completed Mar 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants