Android APK Build Error. Showing an Interesting Error - java

Why? Need to know the reason. Console shows when building the project.
Android Application. When i try to Build the app this error is shown in the console. Anybody know the fix please help. And one main thing is its showing only for one project all other projects are working correctly.I think its the problem with "Android Build Tools"
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.NullPointerException
at com.android.dx.util.ByteArray.<init>(ByteArray.java:76)
at com.android.dx.cf.direct.DirectClassFile.<init>(DirectClassFile.java:206)
at com.android.dx.command.dexer.Main.processClass(Main.java:661)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
at com.android.dx.command.dexer.Main.access$600(Main.java:78)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:596)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
at com.android.dx.command.dexer.Main.run(Main.java:230)
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 com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:187)
at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:786)
at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:597)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:321)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:396)
at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
at org.eclipse.core.internal.resources.Project.build(Project.java:124)
at com.android.ide.eclipse.adt.internal.project.ProjectHelper.doFullIncrementalDebugBuild(ProjectHelper.java:1143)
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:155)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:855)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:704)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1047)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1251)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
[2014-03-11 10:34:21 - User] Dx 1 error; aborting
[2014-03-11 10:34:21 - User] Conversion to Dalvik format failed with error 1

This Solves my problem. Well that happend to me as I tried to build my latest project. Solution was quite simple but… strange. Just remove all newer Android SDK build-tools (i.e. 19) until the Version 18.1.1 with the Android SDK Manager. Restart Eclipse. And it will work. If not, try to add the Support Libraries (Right click on your Android Project in Eclipse, choose Android Tools, Add Support Library)
https://stackoverflow.com/questions/22316924/why-need-to-know-the-reason-console-shows-when-building-the-project

Related

Codenameone build server error java.lang.NullPointerException

Dev Platform: Mac OSX
IDE: NetBeans
Targeted Device: Android
Topic: Build Server Issues
Details:
I resurrected an old CN1 project that I last sent to the build server ~2 years ago. I have spent a good amount of time doing extensive refactoring and it works great on the simulator. Note that the app uses a custom cn1lib, where I have a fair amount of code. The simulator seems good with this.
However, when I try to "send Android build" to the build server, it gets a java.lang.NullPointerException. Just to make sure that my Android certs were correct, I sent your "KitchenSink" demo to the build server and all worked well. But no good with my app. I'm not sure what to do from here. Any suggestions?
The exception on my app, when sent to the build server looks like this:
java.lang.NullPointerException
at com.codename1.build.client.CodeNameOneBuildTask.execute(CodeNameOneBuildTask.java:330)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:286)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:555)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
BUILD FAILED (total time: 2 seconds)
The error also references this section of the build.xml file:
<target name="build-for-android-device" depends="clean,copy-android-override,copy-libs,jar,clean-override">
<codeNameOne
jarFile="${dist.jar}"
displayName="${codename1.displayName}"
packageName = "${codename1.packageName}"
mainClassName = "${codename1.mainName}"
version="${codename1.version}"
icon="${codename1.icon}"
vendor="${codename1.vendor}"
subtitle="${codename1.secondaryTitle}"
targetType="android"
keystoreAlias="${codename1.android.keystoreAlias}"
keystore="${codename1.android.keystore}"
certPassword="${codename1.android.keystorePassword}"
automated="${automated}"
/>
</target>
Thanks in advance for any help.
Okay, I resolved the problem. It seems that I had some obsolete cn1lib files in my lib directory. These I had later consolidated into a single cn1lib file. I suspect that they were conflicting.
All seems good now. Sorry for the false alarm!
(Initial problem was solved, I'm posting here just for anyone who may suffer from similar problem.)
I recently encountered the same error message on Windows - Eclipse Oxygen - CN4.0
build.xml:287: java.lang.NullPointerException
at com.codename1.build.client.CodeNameOneBuildTask.execute(CodeNameOneBuildTask.java:337)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor192.invoke(Unknown Source)
...
...
In my case it turns out that the icon file was not 512x512. Replacing the icon with another .png solved the problem. Debug message provided doesn't tell much about the cause, so it's like a trial and error.
Edit: Another symptom was failure to CN1 settings -> Basics if the icon was damaged

Unable to convert to DEX format

I'm using Unity5, JDK 1.8 and I'm building for min android sdk = 10 and max = 22.
I can do a development build without any problems but when I'm trying to create an .apk file for the Google Play Store I get an error.
Error log:
CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
F:/Java/JDK\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="F:/Android/SDK\tools" -Dfile.encoding=UTF8 -jar "F:/Programs/Unity5/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -
stderr[
UNEXPECTED TOP-LEVEL EXCEPTION:
java.util.zip.ZipException: zip file is empty
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:220)
at java.util.zip.ZipFile.<init>(ZipFile.java:150)
at java.util.zip.ZipFile.<init>(ZipFile.java:164)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:632)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at SDKMain.main(SDKMain.java:129)
1 error; aborting
]
And then a lot of lines that go like "processnig [path to .class file]".
I've tried switching to JDK 1.7 but to no avail.
I think I've eliminated the possibility of the multiple plugin error as there are no duplicate .jar's.
Any ideas what's causing this?
Solved!
For some reason the classes.jar file in the Unity program folder was corrupted, I replaced it with the one I had in my Android Studio project and now it works.
try this instead.
In my projects there were two androidAppCompact files were there 1.0.6 and 1.0.7. I deleted 1.0.6 and now its working fine

New Relic Android agent error with gradle

I have a project that uses the gradle build system and I'm willing to add New Relic monitoring to it.
The project (including New Relic) is working fine on Linux (Fedora 20), but won't build on my Mac development system, and gives out an error stating Agent JAR loaded but agent failed to initialize.
Here is the full log of the error:
Dev-1:test 0x4d$ ./gradlew clean
> Configuring > 1/2 projects > :appobjc[4437]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
[newrelic.error] Agent startup error
java.lang.IllegalAccessException: Can not set static final java.lang.Object field java.util.logging.Logger.treeLock to com.newrelic.agent.compile.RewriterAgent$InvocationDispatcher
at sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(UnsafeFieldAccessorImpl.java:73)
at sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(UnsafeFieldAccessorImpl.java:77)
at sun.reflect.UnsafeQualifiedStaticObjectFieldAccessorImpl.set(UnsafeQualifiedStaticObjectFieldAccessorImpl.java:77)
at java.lang.reflect.Field.set(Field.java:741)
at com.newrelic.agent.compile.RewriterAgent.createInvocationDispatcher(RewriterAgent.java:772)
at com.newrelic.agent.compile.RewriterAgent.premain(RewriterAgent.java:137)
at com.newrelic.agent.compile.RewriterAgent.agentmain(RewriterAgent.java:102)
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 sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:382)
at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:407)
> Configuring > 1/2 projects > :appExcjava.lang.reflect.InvocationTargetException
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 sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:382)
at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:407)
Caused by: java.lang.RuntimeException: java.lang.IllegalAccessException: Can not set static final java.lang.Object field java.util.logging.Logger.treeLock to com.newrelic.agent.compile.RewriterAgent$InvocationDispatcher
at com.newrelic.agent.compile.RewriterAgent.premain(RewriterAgent.java:168)
at com.newrelic.agent.compile.RewriterAgent.agentmain(RewriterAgent.java:102)
... 6 more
Caused by: java.lang.IllegalAccessException: Can not set static final java.lang.Object field java.util.logging.Logger.treeLock to com.newrelic.agent.compile.RewriterAgent$InvocationDispatcher
at sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(UnsafeFieldAccessorImpl.java:73)
at sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(UnsafeFieldAccessorImpl.java:77)
at sun.reflect.UnsafeQualifiedStaticObjectFieldAccessorImpl.set(UnsafeQualifiedStaticObjectFieldAccessorImpl.java:77)
at java.lang.reflect.Field.set(Field.java:741)
at com.newrelic.agent.compile.RewriterAgent.createInvocationDispatcher(RewriterAgent.java:772)
at com.newrelic.agent.compile.RewriterAgent.premain(RewriterAgent.java:137)
... 7 more
> Configuring > 1/2 projects > :appAgent failed to start!
[newrelic] Error encountered while loading the New Relic agent
com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize
at sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:121)
at com.newrelic.agent.android.NewRelicGradlePlugin.apply(NewRelicGradlePlugin.java:47)
at com.newrelic.agent.android.NewRelicGradlePlugin.apply(NewRelicGradlePlugin.java:15)
at org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(DefaultPluginContainer.java:104)
at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInternal(DefaultPluginContainer.java:68)
at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:34)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:39)
at org.gradle.api.Project$apply.call(Unknown Source)
at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
at org.gradle.api.Script$apply.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at build_hf6jnn002tc8mnuv025i0lb49.run(/Users/0x4d/Desktop/test/app/build.gradle:15)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:156)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:38)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:25)
at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:507)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:82)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:31)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:46)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.Main.main(Main.java:37)
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.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
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.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/0x4d/Desktop/test/app/build.gradle' line: 15
* What went wrong:
A problem occurred evaluating project ':app'.
> com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 14.094 secs
I have also tested with a freshly generated, bare-bones project, but it fails with the exact same error.
I use the JDK 1.7u55 version, if that matters.
Thanks
Unfortunately u55 introduced a change that breaks the New Relic agent. For now, if possible, use an older version of Java to work around this issue while building. This shouldn't affect the resulting APK. New Relic is aware of this issue and is working to fix it as fast as possible.
I emailed New Relic support, and I got the following response:
Hello,
Thanks for writing into New Relic support.
A new version of the New Relic for Mobile Apps Android SDK is in beta
and includes a fix for compatibility with JDK v7u55 and JDK v8
It is available here:
https://gist.github.com/asm/bed819fb32253e4cb072.
We're waiting to release this agent until we hear from users like you
that the SDK is running smoothly and instrumentation is now working
correctly.
Please let us know if you have any trouble installing this SDK.
I'm going to leave this ticket open so that you can send us an update.
Our automatic system will ping you to see how you're doing in a few
days and then try to close the ticket a few days after that. If it
does, don't worry, write back any time and we'll get right to helping
you.
There's a new version of new relic client available. It resolves issues that V3.361.0 had around newer JDKs and proguard. Here's what you should use to resolve the JDK problem.
classpath 'com.newrelic.agent.android:agent-gradle-plugin:3.378.0'
Paste this into your build.gradle where you have listed your dependencies. Let me know if it doesn't work.

Deploy to app engine stopped working: NoClassDefFoundError GoogleLogin

I'm getting the following error:
!ENTRY org.eclipse.ui 4 0 2014-01-03 19:04:22.670
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NoClassDefFoundError: Could not initialize class com.google.gdt.eclipse.login.GoogleLogin
at com.google.appengine.eclipse.core.deploy.ui.DeployProjectHandler.execute(DeployProjectHandler.java:67)
at com.google.appengine.eclipse.core.deploy.ui.DeployProjectAction.run(DeployProjectAction.java:27)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4166)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1489)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1474)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4012)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3651)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
Some background information: I'm running eclipse kepler 20130919-0819, os x 10.9.1, google suite plugin 3.5.1.
Deployment now does not work on any of my projects. I recently updated the plugin and there was a message that it required java 1.7. Development was working as usual after that message and I had no problems until I tried to deploy. (When I change the java compatibility on the project I get an error that GAE required 1.7.)
This may be related to the problem I'm having with java. According to mac preferences, java 1.7 is installed yet when I start a terminal session and issue the java command to check the version, it indicated 1.6. eclipse also seems to be running on 1.6 and I can't figure out how to rectify this. It may or may not be related.
My question is: can I fix this problem in place or do I have to back out updates and reinstall? I can continue to develop but am unable to deploy until I have a solution.
Thanks in advance.
Thanks to Rajeev, I have a lead but the problem is not fixed yet.
So I find the keplar eclipse.ini file. There is no -vm entry. It has the following contents:
/System/Library/Java/JavaVirtualMachines is 1.6.0.jdk. I assume that this is where eclipse is picking up the jvm.
So I find and add an entry in the .ini file following the pattern in eclipse wiki:
I get the following Alert:
Then I go to the Mac Java Preferences which says that java is 1.7 is installed under:
/Library/Internet Plug-Ins/JavaAppletPlugin/Contents/Home/bin/java
This is where java gets installed when you go to java.com to install.
Then I get:
So this is like an adventure game, but not as much fun.
I see that I have to update the .ini file, but where or how do I get the right java?

Eclipse refactoring fails -> Keeps throwing exceptions!

I'm using Eclipse Helios and for every refactoring that spans multiple files it plainly fails! Nothing happens. On examining the logs here's the error that I see:
!ENTRY org.eclipse.ltk.ui.refactoring 4 10000 2011-03-13 14:15:31.842
!MESSAGE Internal Error
!STACK 0
java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.run(RefactoringWizardDialog2.java:330)
at org.eclipse.ltk.ui.refactoring.RefactoringWizard.internalPerformFinish(RefactoringWizard.java:573)
at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.performFinish(UserInputWizardPage.java:153)
at org.eclipse.jdt.internal.ui.refactoring.reorg.RenameTypeWizardInputPage.performFinish(RenameTypeWizardInputPage.java:144)
at org.eclipse.ltk.ui.refactoring.RefactoringWizard.performFinish(RefactoringWizard.java:646)
at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.okPressed(RefactoringWizardDialog2.java:454)
at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:472)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:180)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:192)
at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:115)
at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:38)
at org.eclipse.jdt.internal.ui.refactoring.UserInterfaceStarter.activate(UserInterfaceStarter.java:62)
at org.eclipse.jdt.internal.ui.refactoring.reorg.RenameUserInterfaceStarter.activate(RenameUserInterfaceStarter.java:31)
at org.eclipse.jdt.ui.refactoring.RenameSupport.openDialog(RenameSupport.java:159)
at org.eclipse.jdt.ui.refactoring.RenameSupport.openDialog(RenameSupport.java:116)
at org.eclipse.jdt.internal.corext.refactoring.RefactoringExecutionStarter.startRenameRefactoring(RefactoringExecutionStarter.java:438)
at org.eclipse.jdt.internal.ui.refactoring.actions.RenameJavaElementAction.run(RenameJavaElementAction.java:203)
at org.eclipse.jdt.internal.ui.refactoring.actions.RenameJavaElementAction.run(RenameJavaElementAction.java:101)
at org.eclipse.jdt.ui.actions.RenameAction.run(RenameAction.java:108)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jst/jsp/core/internal/java/search/JSPIndexManager
at org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport.searchRunnable(JSPSearchSupport.java:424)
at org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport.searchRunnable(JSPSearchSupport.java:349)
at org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant.createChangesFor(JSPRenameParticipant.java:215)
at org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant.createChange(JSPRenameParticipant.java:153)
at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.createChange(ProcessorBasedRefactoring.java:308)
at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:124)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:209)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Root exception:
java.lang.NoClassDefFoundError: org/eclipse/jst/jsp/core/internal/java/search/JSPIndexManager
at org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport.searchRunnable(JSPSearchSupport.java:424)
at org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport.searchRunnable(JSPSearchSupport.java:349)
at org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant.createChangesFor(JSPRenameParticipant.java:215)
at org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant.createChange(JSPRenameParticipant.java:153)
at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.createChange(ProcessorBasedRefactoring.java:308)
at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:124)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:209)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
This error doesn't make much sense for me to be able to navigate around and even 'try' fixing it. For refactorings that are 'local' to the file/methods it seems to work fine. I've tried figuring this one out but just aghast! I tend to use the refactor feature A LOT. I'm working with J2EE + Glassfish v3. I have JARs for freemarker, restlet and that for DBUtils on the build path.
Any ideas? Has anyone encountered (and fixed :) this problem??
Thanks in advance!
Looks like a plugin issue. The root exception is,
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jst/jsp/core/internal/java/search/JSPIndexManager
Meaning some class that should exist can't be found. Have you recently installed/removed plugins? You might have to reinstall eclipse.
Since I only had 2 plugins it was easy to figure out the problem. It seems there is a dependency conflict between JBoss and Glassfish Plugins (says so on update). Removing the JBoss Plugin (Help > Eclipse MarketPlace > Installed - select a plugin, click 'uninstall' and select all the components in it and click Next/Finish).
That seemed to fix the refactoring without reinstalling. Thanks to user654801 for pointing it out as a plug-in issue. It'd have been difficult to nail it down otherwise!
I have the same problem. I solve it similarly to Nupul.
I disabled the J2EE standard tools sience i don't need them:
Eclipse Europa:
Help -> Sowtware Updates -> Manage Configuration
disable J2EE Standard Tools (JST) Project SDK

Categories