Unknown Source in Stacktrace Java Eclipse - java

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.

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 ?).

Problems with Repast Model Launch

After a fresh install of Repast Symphony 2.5.0 (Win 64bit) and JDK 9.0.1 on a Windows 10 system, when importing a JZombies_Demo example, the model cannot be launched with the default configuration.
The error says:
An internal error occurred during: "Launching JZombies_Demo Model".
org.codehaus.groovy.eclipse.core.builder.GroovyClasspathContainer.<init>(Lorg/eclipse/core/resources/IProject;)V
When I edit the default run configuration, in the Dependencies tab I see only the JRE System Library and nothing else. In the same tab, the Restore Default Entries is enabled - when I press it all the dependencies from Repast Symphony are added, and the previous error disappears. However, in this case when trying to launch another error is observed:
saf.core.runtime.Boot - null
java.lang.NullPointerException
at saf.core.runtime.Boot.init(Boot.java:79)
at saf.core.runtime.Boot.main(Boot.java:246)
at repast.simphony.runtime.RepastMain.main(RepastMain.java:43)
I also read about this problem on Repast Mailing List, and saw people talking about missing boot.properties file in the X\eclipse\plugins\repast.simphony.runtime_2.5.0 folder. However, the file is well in place there. So, I tried to link this to the previous error and saw that at (RepastMain.java:43) the pathInfo value was actually X\eclipse\plugins\repast.simphony.bin_and_src_2.5.0. Thus I tried to copy the boot.properties from the runtime directory to the bin_and_src - this removed the previous error, but brought a number of warnings related to UI initialization and an error:
repast.simphony.ui.RSUIPlugin - Fatal error starting Repast
java.lang.NoSuchMethodError: com.jgoodies.forms.layout.ColumnSpec.createGap(Lcom/jgoodies/forms/layout/ConstantSize;)Lcom/jgoodies/forms/layout/ColumnSpec;
at com.jgoodies.forms.layout.FormSpecs.<clinit>(FormSpecs.java:115)
at repast.simphony.ui.RunOptionsPanel.initComponents(RunOptionsPanel.java:114)
at repast.simphony.ui.RunOptionsPanel.<init>(RunOptionsPanel.java:39)
at repast.simphony.ui.RSGui.addRunOptionsView(RSGui.java:558)
at repast.simphony.ui.RSApplication.initGui(RSApplication.java:655)
at repast.simphony.ui.RSAppConfigurator.fillBars(RSAppConfigurator.java:52)
at saf.core.ui.GUICreatorDelegate.createDisplay(GUICreatorDelegate.java:160)
at saf.core.ui.GUICreator.createDisplay(GUICreator.java:12)
at repast.simphony.ui.RSUIPlugin$1.run(RSUIPlugin.java:102)
at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue.access$500(Unknown Source)
at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
After seeing all that, enough frustration, and tries to reinstall the Repast and JDK the situation remained unchanged. Also need to note, that the same behavior is observed for other examples, and newly created Repast projects.
Would be very glad to hear your opinions on what can cause such Repast behavior.
It looks like this is an issue with Java 9 compatibility. Can you try a fresh install using the latest Java 8? In the meantime we'll follow up on what changes in Repast Simphony will be needed for Java 9 compatibility.

NumberFormatException on eclipse start

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.

UnsatisifiedLinkError - Any idea on how to fix this?

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(JarRsrcLoader.java:58)
Caused by: com.melloware.jintellitype.JIntellitypeException: Could not load JIntellitype.dll from local file system or from inside JAR
at com.melloware.jintellitype.JIntellitype.<init>(JIntellitype.java:114)
at com.melloware.jintellitype.JIntellitype.getInstance(JIntellitype.java:174)
at CaptureScreen.registerHotkeys(CaptureScreen.java:163)
at CaptureScreen.<init>(CaptureScreen.java:100)
at CaptureScreen.main(CaptureScreen.java:199)
... 5 more
Caused by: java.lang.UnsatisfiedLinkError: C:\Users\B\AppData\Local\Temp: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at com.melloware.jintellitype.JIntellitype.<init>(JIntellitype.java:99)
... 9 more
I get this error when I run from the command line, however, it does not cause any issues with my program running on my machine, however, on other peoples machines the program will not run at all.
I have never come across this error before and fairly confused.. mostly that it runs fine on my machine, but not on others even though it throws this error on both.
This is a classpath error. Its likely that you have it set up right for compile time but not runtime. Make sure that either your jar is in the right location and/or that you've set your classpath to include the jar.
Go to the Jintellitype website, download the source, add it to your download folder and then move the .dll files into the folder with the Jitellitype classes after building the project

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