NumberFormatException on eclipse start - java

I'm a novice at Java and eclipse IDE. I'm trying to create a plugin to my installed eclipse 4.4.0 by the official IBM article.
I've added plug-in description to the plugin.xml:
<extension point="org.eclipse.debug.core.launchConfigurationTypes">
<launchConfigurationType
name="MyConfiguration"
delegate="com.myplugin.first.launching.MyLaunchConfiguration"
modes="run, debug"
id="com.myplugin.first.launching.myConfiguration">
</launchConfigurationType>
</extension>
and I've created empty configuration delegate with required dependencies.
Unfortunately I cannot launch a new eclipse application with my plugin because every time I get the following error:
java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at org.eclipse.osgi.storagemanager.StorageManager.updateTable(StorageManager.java:511)
at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:708)
at org.eclipse.osgi.storage.Storage.getChildStorageManager(Storage.java:1747)
at org.eclipse.osgi.storage.Storage.getInfoInputStream(Storage.java:1764)
at org.eclipse.osgi.storage.Storage.(Storage.java:124)
at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:84)
at org.eclipse.osgi.internal.framework.EquinoxContainer.(EquinoxContainer.java:75)
at org.eclipse.osgi.launch.Equinox.(Equinox.java:31)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:297)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:232)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
An error has occurred. See the log file
null.
I have not found the log file with the error.
What's wrong? What should I do?
Maybe somebody knows the problem.

Try deleting everything in eclipse\configuration folder except config.ini and start your eclipse. Also paste the contents of the latest log file from eclipse\configuration for complete error.

Well! I,ve fixed the problem. I just created a new workspace and copied my project and config files to the workspace.
So the problem was in a broken workspace. I guess some workspace config file was corrupted. Anyway thank redoc for the idea.

Related

Java NoSuchMethodError for regex.Matcher.results() when running .jar file

When I run my app as a .jar file, it returns the below error:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrc
der.java:61)
Caused by: java.lang.NoSuchMethodError: java.util.regex.Matcher.results()Ljav
til/stream/Stream;
at SalesToExcel.start(SalesToExcel.java:108)
at SalesToExcel.main(SalesToExcel.java:45)
... 5 more
However, it works when I run it inside of the Eclipse IDE. Any ideas? I'm not sure if I'm somehow missing a proper jar file even though java.utils.regex should come included in rt.jar. Is there a way to check if this is missing somehow when I package the jar?
So, this is your problem. java.util.regex.Matcher.results is in Java since Java 9 and you are running the .jar with Java 8.
Eclipse runs with Java11.
Install as default JRE at least Java9 in your OS (Windows ?).

Unknown Source in Stacktrace Java Eclipse

I have the very annoying problem, that when exporting a jar-file out of my source code in eclipse I will get no information in the stacktrace about the source and line number in which the error occurs. I have checked the compiler settings in ecplise for the project and all options in the section classfile generation are set.
I'm developing plugins for Minecraft which are executed by the server software bukkit. My source is in the package de.celestialcraft.agentestate. On occurance of an exception I get such a stacktrace:
23:43:57 [INFO] com.sk89q.worldedit.CuboidClipboard#fb44f99
23:43:57 [SEVERE] Could not pass event BlockDamageEvent to AgentEstate v2.1alpha
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
va:363)
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
a:62)
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
ava:477)
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
ava:462)
at de.celestialcraft.AgentEstate.AgentEstateBlockListener.onBlockBreak(U
nknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
va:361)
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
a:62)
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
ava:477)
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
ava:462)
at ir.b(ItemInWorldManager.java:393)
at ir.a(ItemInWorldManager.java:200)
at iv.a(NetServerHandler.java:782)
at ei.a(Packet14BlockDig.java:67)
at cg.b(TcpConnection.java:467)
at iv.d(NetServerHandler.java:220)
at iw.b(NetworkListenThread.java:57)
at ht.b(DedicatedServerListenThread.java:34)
at net.minecraft.server.MinecraftServer.r(MinecraftServer.java:981)
at ho.r(DedicatedServer.java:309)
at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:857)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:744)
at fy.run(ThreadMinecraftServer.java:16)
Caused by: java.lang.NullPointerException
at com.sk89q.worldedit.schematic.MCEditSchematicFormat.save(Unknown Sour
ce)
at de.celestialcraft.AgentEstate.Estate.saveState(Unknown Source)
at de.celestialcraft.AgentEstate.Estate.create(Unknown Source)
at de.celestialcraft.AgentEstate.Estate.create(Unknown Source)
at de.celestialcraft.AgentEstate.AgentEstateBlockListener.onBlockDamage(
Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
va:361)
... 25 more
I have set the jdk path in the build path settings as the lib for the project. I hope you can help me with this issue.
Thank you.
Since Bukkit is an API, when you code a bukkit plugin you are creating blocks of code in such a way that only Bukkit knows what to do with said code. In order to find out what is causing the error you have posted here, you need to look at the top line if the "at" lines in the StackTrace and find it in the Bukkit source files on Github. For example, in this stacktrace you have this at the top:
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:363)
You can see that there is a Bukkit EventException caused by an error in the JavaPluginLoader at line 363. In order to find out exactly what went on there, you should visit https://github.com/Bukkit/Bukkit/releases and download the appropriate source version for the MC version you are coding for. In this zip file you would find the source folder at src/main/java/ and follow the path in line 2 of this stacktrace (org/bukkit/plugin/java/JavaPluginLoader) and in line 363 of that file you will see where the error occurred.
Since I do not know what version of Bukkit you are coding for, I can't help you out past here except to say that whichever method in that file has line 363 as part of it is the one that relates to your problem. If you figure out what that method does, it is what Bukkit tried to do with your plugin code and failed.
Your project should be marked to enable project specific settings and on Java Compiler -> Classfile generation, the option Add line number... should be unmarked.

Suddenly unable to export to war file from eclipse

I been working on this Servlet project all morning and now suddenly I cannot get eclipse to export the project to a war file. I tried restarting eclipse and cleaning the project but I just get the same result. Any ideas?
org.eclipse.core.runtime.CoreException: Extended Operation failure:
org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentExportOperation
at org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard.performFinish(DataModelWizard.java:182)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:742)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:373)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:618)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
at org.eclipse.jface.window.Window.open(Window.java:796)
at org.eclipse.ui.actions.ExportResourcesAction.run(ExportResourcesAction.java:180)
at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:168)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:546)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
org.eclipse.core.runtime.CoreException[0]: org.eclipse.core.commands.ExecutionException: Error exportingWar File
at org.eclipse.jst.j2ee.internal.archive.operations.J2EEArtifactExportOperation.execute(J2EEArtifactExportOperation.java:103)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl$1.run(DataModelPausibleOperationImpl.java:376)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1797)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(DataModelPausibleOperationImpl.java:401)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(DataModelPausibleOperationImpl.java:352)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.doExecute(DataModelPausibleOperationImpl.java:242)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.executeImpl(DataModelPausibleOperationImpl.java:214)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.cacheThreadAndContinue(DataModelPausibleOperationImpl.java:89)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.execute(DataModelPausibleOperationImpl.java:202)
at org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard$1$CatchThrowableRunnableWithProgress.run(DataModelWizard.java:211)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Caused by: org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException: IWAE0017E Unable to replace original archive: C:\Users\mark\uploads\myfirstjsp.war
at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.cleanupAfterTempSave(ArchiveImpl.java:322)
at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.saveAsNoReopen(ArchiveImpl.java:1182)
at org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentExportOperation.export(WebComponentExportOperation.java:54)
at org.eclipse.jst.j2ee.internal.archive.operations.J2EEArtifactExportOperation.execute(J2EEArtifactExportOperation.java:95)
... 10 more
Well I guess I should have read the whole error as it does say that the problem is it can't write to the file. The interesting part was what was causing the file to be locked. Firefox had the file open so eclipse couldn't write to the file. I have no idea why firefox had the file open though I was using it to upload the war file to the server.

Java - Unable to launch the application

I can't seem to launch a .jar file. An error comes up when I launch it. Help would be appreciated, here is the error:
CouldNotLoadArgumentException[ Could not load file/URL specified: C:\Users\Donavon\AppData\Local\Temp\javaws12]
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
First, please check if your TEMP folder is still there.
Second, if you can find jawaaws12 in there, move it to somewhere else. Then uninstall and re-install java. The appropriate file should be created automatically.

how make excutable for my java application with JDeveloper

I want to create an excutable file for my java project, previous time I do it by Jbuilder or netbean as I remember but I dont know how I should do it in JDeveloper to make Excutable file(EXE file)
please advice me, please describe clearly...
EDIT:
It's simple desktop application.it is not web application....
EDIT2:
I remove that part for checking argument and run my program I face with this problem:
what should I do?
Executing: C:\JDeveloper\mywork\SourceManagmentTools\Client\deploy\SMT.exe
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: oracle/jdeveloper/layout/VerticalFlowLayout
at Main.GUI.SmMainFrame.<init>(SmMainFrame.java:134)
at Main.GUI.SmRun.<init>(SmRun.java:25)
at Main.GUI.SmRun$1.run(SmRun.java:82)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: oracle.jdeveloper.layout.VerticalFlowLayout
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 17 more
Have you considered Launch4j?
Regarding your configuration problem, the Launch4J documetation says:
Additional JVM options at runtime
When you create a wrapper or launcher
all configuration details are compiled
into the executable and cannot be
changed without recreating it or
hacking with a resource editor.
Launch4j 2.1.2 introduces a new
feature that allows to pass additional
JVM options at runtime from an
.l4j.ini file. Now you can specify the
options in the configuration file, ini
file or in both, but you cannot
override them. The ini file's name
must correspond to the executable's
(myapp.exe : myapp.l4j.ini). The
arguments should be separated with
spaces or new lines, environment
variable expansion is supported, for
example:
# Launch4j runtime config
-Dswing.aatext=true
-Dsomevar="%SOMEVAR%"
-Xms16m
Other alternatives that you may consider are JSmooth,WinRun4J.
If your desktop application has a GUI, and you can distribute it from a site, look to Java Web Start.
JWS provides a 'one-click' installation option for the end user, automatic updates, desktop integration, splash screens and much more. It is part of the standard Java(1) distribution (since 1.4.2) & is supported by Oracle.
(1) JWS works with standard Jar files - no exe needed, which means it will work on *nix & Mac.
it so simple guys...
I solved my problem in this way...simplest way....
first of all check the version of java that installed in your client computer, you check by this command in CMD:
java -version
after you make sure about java version you need to make a bat file. [conflict in version maybe cause null except] after that you should know which external package u used in this project... for example I used 1 file for connecting to oracle database "ojdbc14" and the other for GUI, after that you can simply run your program or even pass parameter to them by just mention them at end of name of runable of your class:
java -client -classpath ojdbc14.jar;lipstikLF-1.1.jar;swing-layout.jar;smt.jar Main.GUI.SmRun rimrim
I guess those library we used in our project need also run, but I am not sure, I just suggest this work
java -client -classpath <name of you library>;<name of you library>;<name of your jar file> nameOfPackage.nameOfRunClass parameter[if any]
I will so appreciate if anybody add some useful info to this post

Categories