Unable to Acquire the State Change Lock - java

Our products are using the latest production-ready release of SWT, 3.7.2. Now since no one back then knew what the next Java version would be called (and how would they know that 8 came after 7, that's like higher mathematics), we were forced to swap the org.eclipse.osgi from 3.7.2 to 3.10.0, so that we can now support Java 8. While that's maybe not the best of ideas, in theory it should work.
Of course, being the major screw-up that Eclipse Luna is, there is this one "error" when we start our applications (about 50 percent of the time, I'd guess):
org.osgi.framework.BundleException: Unable to acquire the state change lock for the module: osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.0.v20140606-1445"; singleton:="true" [id=0] STARTED [STARTED] invalid
at org.eclipse.osgi.container.Module.lockStateChange(Module.java:329)
at org.eclipse.osgi.container.SystemModule.init(SystemModule.java:44)
at org.eclipse.osgi.container.SystemModule.start(SystemModule.java:170)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:412)
at org.eclipse.equinox.internal.simpleconfigurator.ConfigApplier.startBundles(ConfigApplier.java:307)
at org.eclipse.equinox.internal.simpleconfigurator.ConfigApplier.install(ConfigApplier.java:108)
at org.eclipse.equinox.internal.simpleconfigurator.SimpleConfiguratorImpl.applyConfiguration(SimpleConfiguratorImpl.java:129)
at org.eclipse.equinox.internal.simpleconfigurator.SimpleConfiguratorImpl.applyConfiguration(SimpleConfiguratorImpl.java:143)
at org.eclipse.equinox.internal.simpleconfigurator.Activator.start(Activator.java:48)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
at org.eclipse.osgi.container.Module.doStart(Module.java:571)
at org.eclipse.osgi.container.Module.start(Module.java:439)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
at org.eclipse.osgi.container.SystemModule.startWorker(SystemModule.java:242)
at org.eclipse.osgi.container.Module.doStart(Module.java:571)
at org.eclipse.osgi.container.Module.start(Module.java:439)
at org.eclipse.osgi.container.SystemModule.start(SystemModule.java:172)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:412)
at org.eclipse.osgi.launch.Equinox.start(Equinox.java:115)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:320)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:232)
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:483)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
There's not much information on the web what the problem is, most suggest to just delete the workspace, but for most it only happens when starting up Eclipse, not the final applications - nonetheless, I deleted workspaces and the runtime-folders. Nothing helps. The "error" gets thrown in the exported product as well, but as far as I can tell, everything still works as expected.
Is there a way to fix it? And if not, is there a way to just hide that stupid exception (disable logging for a moment, clearing the log, whatever, I'm not picky)?

I solved problem by following these simple steps,
Go to your eclipse directory and open configuration directory.
open org.eclipse.osgi directory.
open .manager folder.
Delete .fileTableLock file.
Restart your eclipse.

This looks like the framework start up starts simpleconfigurator which tries to start the framework again. The framework detects this recursion and throws an exception to escape it. The problem appears to be in simpleconfigurator attempting the start the framework which is starting it.

I faced same issue.Deleting the given .log file from configuration folder and restarting eclipse should resolve your problem.

I use Red Hat Developer Studio 10.4 (Eclipse 4.6) and i tried use Eclipse Checkstyle plugin.
After install i restarted my IDE and received the crash notification.
I tried all suggestions but only when i delete a file called framework.info.34 my problem was solved.
This file is in %eclipse_home%/configuration/org.eclipse.osgi folder.

Issue pop-up after upgrading eclipse neon through update-site along with installation of some new plugins.
Step 01:
I removed .fileTable.* lock files from ${eclipse_home}/configuration/org.eclipse.osgi/.manager directory.
Step 02:
Removed osgi cache and other plugins cache by starting in eclipse clean mode
eclipse -clean

i have the same issue,
i removed the files from respective places
1) "eclipse\configuration\org.eclipse.osgi.manager"
.fileTableLock
.fileTable3
.fileTable4
2) eclipse\configuration
*.log
after that i opened the eclipse, it worked with out any restart of PC.

for people that have this problem until runing eclipse in runtime from eclipse :
clean folder :
[yourEclipseSourceWorkspace]/.metadata/.plugins/org.eclipse.pde.core/[yourRunConfiguration]/org.eclipse.osgi/.manager
[yourEclipseSourceWorkspace]/.metadata/.plugins/org.eclipse.pde.core/[yourRunConfiguration]/org.eclipse.osgi remove all files (not folder)
then add to your configuration -clean as programm arg

The solution is simple. Just start your eclipse in clean mode.
Find location of "eclipse.exe" file. (Let's assume : C:\eclipse\eclipse.exe )
Go to run command (Windows+R)
Enter [location] +[space][-]clean
Ex: C:\eclipse\eclipse.exe -clean

Faced the same issue . Remove the .fileTableLock from "eclipse\configuration\org.eclipse.osgi.manager" and restart eclipse . It works .

Related

Error: Eclipse 4.5 MARS NullPointerException (JUnit-Tests)

I do have a problem with Eclipse 4.5 when building a JUnit Test Class.
I can build all tests with the help of ant in its repository.
I think it is a configuration problem in Eclipse.
I already followed a lot of solutions in this forum:
Cleaning the path of eclipse itself
restarting eclipse
try to compile with JUnit3
try to compile with JUnit4
try another JRE
start the project in a different workspace
The reason why I haven't updated my Eclipse is because my company only uses Eclipse 4.5. So I can't accept an answer to update it.
The error log:
!ENTRY org.eclipse.core.jobs 4 2 2019-09-09 17:55:58.495
!MESSAGE An internal error occurred during: "Launching JUnitEntityDBUtility".
!STACK 0
java.lang.NullPointerException
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate$ClasspathLocalizer.localURL(JUnitLaunchConfigurationDelegate.java:429)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate$ClasspathLocalizer.entryString(JUnitLaunchConfigurationDelegate.java:418)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate$ClasspathLocalizer.addEntry(JUnitLaunchConfigurationDelegate.java:405)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate$ClasspathLocalizer.localizeClasspath(JUnitLaunchConfigurationDelegate.java:396)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.getClasspath(JUnitLaunchConfigurationDelegate.java:373)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.launch(JUnitLaunchConfigurationDelegate.java:147)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Delete and recreate your JUnitEntityDBUtility launch configuration.
The stack trace can be found here and here. At the second finding you will find the explanation and a workaround by Moritz Eysholdt for your issue as follows (highlighting by me):
That NPE occurs if you execute a test's launch config in an Eclipse
that does not have the plugin org.eclipse.jdt.junit4.runtime.patch
installed when the launch config was created by an Eclipse that did
actually have org.eclipse.jdt.junit4.runtime.patch installed.
Workaround: Install org.eclipse.jdt.junit4.runtime.patch via the Xpect
update site or delete+recreate your launch configuration.
[...]

Tess4J error after distributing as war NoClassDefFoundError: Could not initialize class net.sourceforge.tess4j.TessAPI

I have Spring boot Webserver project which works ok in my PC under Intellij IDEA, but it not works after distributing to the same PC as war file - NoClassDefFoundError: Could not initialize class net.sourceforge.tess4j.TessAPI.
my code:
ITesseract instance = new Tesseract(); // JNA Interface Mapping
instance.setDatapath(new File(datapath).getPath());
instance.setLanguage("eng");
try {
String result = instance.doOCR(imageFile);
} catch (TesseractException e) {
System.err.println(e.getMessage());
}
I have only one maven dependency, releted to Tess4J:
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>3.0.0</version>
</dependency>
I've got the error after running my distributed war:
There was an unexpected error (type=Internal Server Error, status=500).
Could not initialize class net.sourceforge.tess4j.TessAPI
Full Tomcat log:
java.lang.NoClassDefFoundError: Could not initialize class net.sourceforge.tess4j.TessAPI
at net.sourceforge.tess4j.Tesseract.init(Tesseract.java:367) ~[tess4j-3.0.0.jar:3.0.0]
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:280) ~[tess4j-3.0.0.jar:3.0.0]
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:212) ~[tess4j-3.0.0.jar:3.0.0]
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:196) ~[tess4j-3.0.0.jar:3.0.0]
at ocr.OCRController.handleFileUpload(OCRController.java:127) ~[classes/:0.3.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_51]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_51]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_51]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_51]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222) ~[spring-web-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) ~[spring-web-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) ~[spring-webmvc-4.2.3.RELEASE.jar:4.2.3.RELEASE]
How can I fix the error? I have the plan to host this app in Windows Azure under Tomcat. Thank you for any help, friends!
The problem was in temp folder - it does not contain all necessary dlls.
Info for community:
1. Check temp folder under tomact - for me the path to it is:
D:\Programs_Files\apache-tomcat-8.0.27\temp
This temp folder MUST contain the directory tess4j\win32-x86-64 with next 3 files: gsdll64.dll, liblept171.dll, libtesseract304.dll (or your version)
I had my problem because the directory tess4j\win32-x86-64 have never been created in temp.
BUT
My app works ok under Intellij IDEA because another Temp folder (for IDEA) works ok - C:\Users\Iuliia\AppData\Local\Temp\
contains tess4j\win32-x86-64\gsdll64.dll, tess4j\win32-x86-64\liblept171.dll, tess4j\win32-x86-64\libtesseract304.dll as expected.
Note, that this files are created in process of calling Tesseract in your code. Not early.
HOW I FIX THE PROBLEM with temp under Tomcat
I've added win32-x86-64\gsdll64.dll, win32-x86-64\liblept171.dll, win32-x86-64\libtesseract304.dll to the resources directory in my project.
Look at my project structure:
After deploying to tomcat, the necessary dlls is under classes directory (important!) - it means they are is in the scope.
Now it will be added to
D:\Programs_Files\apache-tomcat-8.0.27\temp\tess4j\win32-x86-64 as expected.
Another fix for the NoClassDefFoundError is e.g. installing the respective Microsoft C++ Runtime (scroll to the bottom and expand Other Tools and Frameworks):
Since the DLLs are built using Visual Studio 2015/2017, please ensure you have Visual C++ 2015 Redistributable or VC++ 2017 Redistributable installed.
Refer to the Tess4J development tutorial for more details.
I upgraded to Windows 10 and all of a sudden tessarct no longer worked for my app.
As per the Tess4J docs, you need to have VC++ 2017 Redistributable installed.
After I installed it on Windows 10, it all worked fine again.
If you've upgraded to Windows 10, and you are having the above problem, and it worked before, then this is likely your issue.

java.lang.NullPointerException when creating first android app in OS X 10.9.4

I just download Eclipse JUNO IDE for Android Developers v. 23.0.2.1259578
I am using as a jre:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
but i can't get rid of this error when i build my first android app.
Errors occurred during the build.
Errors running builder 'Android Resource Manager' on project 'HelloWorld'.
java.lang.NullPointerException
I am following this tutorial, but i can't even reach the last step (the problem occurs when i click the Finish button) : http://developer.android.com/training/basics/firstapp/creating-project.html
Here the see workspace/.metadata/.log :
!MESSAGE Errors running builder 'Android Resource Manager' on project 'HelloWorld'.
!STACK 0
java.lang.NullPointerException
at com.android.ide.eclipse.adt.internal.build.builders.BaseBuilder.abortOnBadSetup(BaseBuilder.java:327)
at com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.build(ResourceManagerBuilder.java:92)
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:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Solved !
Bring up $ADT_DIR/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini in an editor. Before the -vmargs line, insert these two lines:
-vm
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java
The newer versions of Android require JDK 1.7. I would try using that.
I run into such problem recently too. When i create a new Activity, i click the finish or next button in the final step, but nothing happens. When i create a new project that error message pop up every time. Then i recalled that i installed SVN on Eclipse about two month ago. So i uninstalled SVN yesterday, everything works out fine now!!! So i think maybe some plugins you installed on your eclipse prevent Android Resource Manager form working properly.
So i suggest you uninstall your plugins and find out whether some of them is wrong.
Hope this would help!

java.lang.NullPointerException when launching Eclipse

I'm using Eclipse Juno and I get this error when I launch it on a certain workspace:
An error has occurred. See error log for more details.
java.lang.NullPointerException
Other workspaces that are checked out from the same SVN repository work well. Does anyone know why this might happen?
In the workspace log, I get the following exception:
!ENTRY org.eclipse.m2e.logback.appender 4 0 2014-03-11 13:26:25.798
!MESSAGE Could not add repository index
!ENTRY org.eclipse.ui.workbench 4 2 2014-03-11 13:26:37.470
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
!STACK 0
java.lang.NullPointerException
at org.tigris.subversion.subclipse.ui.history.SVNHistoryPage$2.getElements(SVNHistoryPage.java:631)
at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:1010)
at org.eclipse.jface.viewers.ColumnViewer.getRawChildren(ColumnViewer.java:703)
at org.eclipse.jface.viewers.AbstractTableViewer.getRawChildren(AbstractTableViewer.java:1087)
at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredViewer.java:917)
at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:1067)
at org.eclipse.jface.viewers.AbstractTableViewer.internalRefreshAll(AbstractTableViewer.java:701)
at org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:649)
at org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:636)
at org.eclipse.jface.viewers.AbstractTableViewer$2.run(AbstractTableViewer.java:592)
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:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
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:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Solved: cleaned up my .metadata folder and re-imported projects in eclipse
For me, the below steps works.
Right click on project > Select Run As > Run Configurations
Click on Select Other link next to Using VisualVM Launcher
Select Eclipse EDT launcher
Click ok
If you are installed Hiber object in your eclipse and when you are creating a new project as like vaadin 8 project then showing that notification.
go to your eclipse market place search hiber object and expand the update/installed button then click uninstall and follow that instruction.
For me I changed the system variable "java_home" to work with other software and that caused eclipse to show that error.
after changing it back to the original directory I was able to launch eclipse without any issues.
so for those who don't want to take risk losing something I would recommend checking if the "java_home" variable didn't change or even got deleted.
simply do the following:
click on the window logo or search bar if it is enabled.
write "variable".
you see "Edit the system environment variables".
click on "system variables" and if you don't see it check if you are in "advanced" tab.
you can see two spaces "user variables" and "system variables" check if you can see "java_home" or "JAVA_HOME".
if you don't then just add it and if you do see it check the value if it points to the right directory of your JDK.

error after sofware upgrade with eclipse

I recently updated some of the addons for eclipse (3.7). To do so, I started eclipse with sudo (as not doing so caused some errors while installing new Software earlier). Now I get an error immediatly before the splash screen would appear when I start eclipse without using sudo:
!ENTRY org.eclipse.equinox.launcher 4 0 2012-09-20 12:27:48.447
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
I do not get this error when I start eclipse with "sudo eclipse". Any suggestions on how to solve this issue? I am using Ubuntu 11.04.
Cheers
Nebwi
A wild guess. This could be permission issue.
Did you give permissions to the folders as a sudo. Please right click and see the properties of the files in org.eclipse.core.runtime.adaptor.EclipseStarter
And give the read and execute permissions and try. Hope this may help.
While you were "sudo"ing, you may have changed ownership of the files so that you can no longer read them as you. In a command window cd to you install and type:
ls -al
If the owner is root, then you will need to change it back to you. To do this you really need to know your group. It could be your username, the word "staff", "user" etc. To find out for sure, just do that same ls command in your home directory. If you need to change the owners, then type:
sudo chown -R yourUserName.yourUserGroup *
On some unix systems it is "yourUserName:yourUserGroup". Then try eclipse.

Categories

Resources