Weird Java runtime error - currency.data - java

I keep getting this error during runtime and I have no idea what is causing it. It believes there is a file missing?
Caused by: java.io.FileNotFoundException: C:\Program Files\Java\jdk1.7.0_07\lib\currency.data
What is currency.data and can anyone suggest why this is happening, my JDK isn't that old since we're in 7u17 now.
Exception in thread "AWT-EventQueue-0" java.lang.InternalError
at java.util.Currency$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.Currency.<clinit>(Unknown Source)
at java.text.DecimalFormatSymbols.initialize(Unknown Source)
at java.text.DecimalFormatSymbols.<init>(Unknown Source)
at java.text.DecimalFormatSymbols.getInstance(Unknown Source)
at java.text.NumberFormat.getInstance(Unknown Source)
at java.text.NumberFormat.getNumberInstance(Unknown Source)
at java.util.Scanner.useLocale(Unknown Source)
at java.util.Scanner.<init>(Unknown Source)
at java.util.Scanner.<init>(Unknown Source)
at ciphor.CiCompile$7.actionPerformed(CiCompile.java:458)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$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.io.FileNotFoundException: C:\Program Files\Java\jdk1.7.0_07\lib\currency.data (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
... 48 more
I'm running my program with the JDK environment, I checked my jre7 folder and currency.data is present there! Why is it only present in the jre folder?

I got a similar error and this is just to help other people who may fall into the same trap :)
Error :
java.lang.InternalError: java.io.FileNotFoundException: null/lib/currency.data (No such file or directory)
This is because I set the global properties which turns out to be a very un-clever thing to do.
System.setProperties(new Properties());
The System properties are populated with very important data including:
path.separator
user.dir
file.encoding
file.separator
java.io.tmpdir
So basically don't do the above unless you know what you are doing.
If you want to a a property, do this instead:
System.getProperties().put("SOME_KEY", "SOME_VALUE");
or
Map myCustomMapOfProps = ...
System.getProperties().putAll(myCustomMapOfProps);

This is my solution.
You can add this in your code:
System.setProperty("java.home", "C:\\Program Files\\Java\\jdk1.8.0_60\\jre");
You must substitute the path of yours jdk version.

I had the same problem. It was caused by a Java verison conflict ("JAVA_HOME" was set to 1.7 and the property "-Djava.home" was set to 1.6).
I was using mvn to build the project and in the environment variable MAVEN_OPTS the option "java-home" was set to the WRONG value:
MAVEN_OPTS = -Xmx512m -XX:MaxPermSize=256m "-Djava.home=C:\Program Files\Java\jdk1.6.0_35\jre"
Just CORRECT it to:
MAVEN_OPTS = -Xmx512m -XX:MaxPermSize=256m
also check your other environment variables:
MAVEN_OPTS
JAVA_HOME

I found that currency.data is found in either:
C:\Program Files\Java\jdk1.7.0_17\jre\lib
or
C:\Program Files\Java\jdk1.7.0_07\lib
For some reason, when I execute my program, Java doesn't know to look one directory deeper.

In the old skool days, Sun specified that the JAVA_HOME should point to JDK_HOME/jre if a JDK was installed instead just the JRE.
This differentiation has slowly eroded for the same reason that 'exalator' is becoming an acceptable pronunciation for 'escalator': ubiquity.
At any rate some older apps still assume JAVA_HOME is the root of the JRE

JDK 1.7.0_43 does not have currency.data under lib/, only within jre/lib. That forces me to change the build scripts to use JDK for compiling and then to use JRE for unit tests. Unless there is a better way.

I had the same problem for a webapp deployed in wildfly 10 after installing a new jre while the server was running. Restarting the server resolved the problem.

Related

How can I config RTXCommon.jar

I have a java program and I want to use RTXCommon.jar So if I try to use it, I have this error
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while
loading gnu.io.RXTXCommDriver
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no rxtxSe
rial in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:123)
at com.mcsolution.easyMgmt.panel.utility.panelProgramma.inizializzaLabel
Text(panelProgramma.java:877)
at com.mcsolution.easyMgmt.panel.utility.panelUtility.creaSwing(panelUti
lity.java:36)
at com.mcsolution.esp.TestaFrameSalagiochi$MenuLookDemo22$1.actionPerfor
med(TestaFrameSalagiochi.java:118)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown
Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
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)
Then I have right click on project, java build path, then I have find RTXCommon.jar, select Native Library Path, edit, then I have select the folder C:\SWInstall\dll
In this folder, I have copy rtxSerial.dll rtxParallel.dll. Then I have run the project and works. But if I try to generate jar file then run it, I have the same error.
How can I fixed it?
regards
One of the most important things to check that you didn't mention is to verify if you're using a 32bits or 64bits of the RTXCommon.jar, if you are using java 82 Bits you should use RTXCommon.jar 32bits.
Then you have to check if the RTXCommon.jar points to the right location of the native libraries, for that, under eclipse, right click on your project and choose properties then select java build path, in the dialog box click on the little arrow before RTXCommon.jar. Double click on Native library location and enter the path to your DLLs.
If you are willing to run your app on different machines remember to store your DLLs in a common folder (under program files for exemple for windows) that way you can prevent such bug from occurring to other users. Same thing for other operating systems.

Runnable .jar working on Ubuntu but not Windows

This is how pressing the submit button from the .jar run from cmd looks like on Windows:
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Users\Vlad>java -jar run.jar
java.lang.NullPointerException
at MemoryFileManager.<init>(MemoryFileManager.java:15)
at MemoryClassLoader.<init>(MemoryClassLoader.java:12)
at MemoryClassLoader.<init>(MemoryClassLoader.java:15)
at Main.run(Main.java:130)
at GUI$2.mouseClicked(GUI.java:185)
at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
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)
The MemoryClassLoader and MemoryFileManager classes that appear for the raised exception are from here: https://sites.google.com/site/malenkov/java/081217
Specific lines are:
Line 12 in MemoryClassLoader:
private final MemoryFileManager manager = new MemoryFileManager(this.compiler);
Line 15 in MemoryClassLoader:
this(Collections.singletonMap(classname, filecontent));
and Line 15 in MemoryFileManager:
super(compiler.getStandardFileManager(null, null, null));
Seeing that the program runs correctly from Eclipse and on Ubuntu I'm guessing it has something to do with paths to the javax.tools imports? At a certain point in the project I remember making eclipse move from using JRE to using JDK because of errors regarding to those same classes. What do I need to do to make it run on Windows? I'm sorry if it's a stupid question of if it's obvious :p
Thank you!
compiler is null in MemoryClassLoader.<init>(MemoryClassLoader.java:12).
ToolProvider.getSystemJavaCompiler() returns null if there isn't any compiler.
Seems like you indeed need to have JDK installed to run this (or at least the tools.jar on the classpath):
ToolProvider.getSystemJavaCompiler() returns null - usable with only JRE installed?

Error java.lang.NullPointerException on a executable

I have created a java application to connect to a MySQL database.
Once through the program install creator I created an .exe .
This executable runs, and the first form is login. When he tries to access the database to confirm the details of login gives this error.
java.lang.NullPointerException
Someone can help me solve this? The path is correct, because if run the .jar the application runs normally.
I apologize for the inconvenience.
Only have this to try explain better my question :S
I'm so sorry... I'm running a executable version from my java aplication.
java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(Unknown Source)
at sensores.forms.jTMainMenu.initComponents(jTMainMenu.java:786)
at sensores.forms.jTMainMenu.<init>(jTMainMenu.java:57)
at sensores.forms.jTLoginConsulta.jBLoginActionPerformed(jTLoginConsulta.java:351)
at sensores.forms.jTLoginConsulta.access$000(jTLoginConsulta.java:59)
at sensores.forms.jTLoginConsulta$1.actionPerformed(jTLoginConsulta.java:110)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$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)
You have an error in this class/line
jTMainMenu.java:786
Seems you tried to load a image in this point of your code, i don't know how you are generating a executable from your java code but this may be the source of the problem. Try to put this image outside of your executable/jar and use a relative path to load the image, like './my_image'.
You also have to take care if your user make a link to your executable, in this case a relative path can't resolve your problem. A simple way to solve this in java is get the source code location.
getClass().getProtectionDomain().getCodeSource().getLocation();
And use this location to find your image.
Please check the line number from the Stacktrace where you are getting the NullPointerException.
it is straight forward to find out the null pointer exception. Object is null or not initialize on which you are calling the method
try{
// add database connection statement here
}catch(Exception e){
e.printstacktrace();
}
// run the program from the command prompt.
// you can print the e.printstacktrace() on the popup as well to get the exception details
If you make a .jar, move that jar somewhere separate from the IDE (i.e. their classpaths), and start the jar, do you receive a NullPointerException?
This can be caused by resources, getResource, getResourceAsStreem, getBundle, as they are not case-sensitive in the Windows file system, but are case sensitive in a jar(and under Linux/MacOS).
(Also File cannot be used for jar resources.)
You might look in the jar with 7zip or so to inspect all paths.
I think it is not getting image icon in defined path
at javax.swing.ImageIcon.<init>(Unknown Source)
I have the following two guesses:
There is a problem with your path or classpath and loading the resource
The lines
at sensores.forms.jTMainMenu.initComponents(jTMainMenu.java:786)
at sensores.forms.jTMainMenu.(jTMainMenu.java:57)
indicate that something is initialized. Usually Swing/AWT uses multiple threads, so you might have a race condition here: The reference to the resource is handed to ImageIcon in your ìnitComponents method before another thread could set the value to something non-null. Try using proper synchronization/locking.

Error when connecting JProfiler to JBoss 4

I want to profile a Java EE application runs on JBoss 4. I use Ubuntu . Java 1.5. JProfiler 8.0.1. Server is Jboss 4. Once I set the host as localhost and try to profile,(New Session -> Attach -> Attach to profile JVM(Local or remote) ) JProfiler says, "Could not connect to localhost:8849. Please make sure that the remote address is correct ". But in the terminal, it shows the JBoss starting and I can access the web applications as well. I want to trace all creating java Ojbects and their sizes. How can I solve this issue ?
EDIT: The error log file of JProfiler shows.
sun.awt.X11.XException: Cannot write XdndAware property
at sun.awt.X11.XDnDDropTargetProtocol.registerDropTarget(Unknown Source)
at sun.awt.X11.XDropTargetRegistry.registerDropSite(Unknown Source)
at sun.awt.X11.XWindowPeer.addDropTarget(Unknown Source)
at sun.awt.X11.XComponentPeer.addDropTarget(Unknown Source)
at java.awt.dnd.DropTarget.addNotify(Unknown Source)
at java.awt.Component.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addImpl(Unknown Source)
at java.awt.Container.add(Unknown Source)
at com.ejt.framework.gui.aq.b(ejt:290)
at com.ejt.framework.wizard.o.b(ejt:43)
at com.ejt.framework.wizard.o.<init>(ejt:18)
at com.ejt.framework.wizard.g.b(ejt:125)
at com.jprofiler.frontend.d.a.p.actionPerformed(ejt:29)
at com.jprofiler.frontend.g.g.l(ejt:63)
at com.jprofiler.frontend.g.g.a(ejt:17)
at com.jprofiler.frontend.g.h.run(ejt:56)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.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)
Probably JBoss is not profiled, i.e. the profiling agent is not loaded.
You have to use the integration wizard to modify the JBoss start script.
Invoke
Session->Integration wizards->New Server Integration
select JBoss 4.x and follow the steps in the wizard.

Stemming with WordNet using JWNL - Unable to install dictionary

I am trying to stem a string using WordNet with the JWNL API. When I try to load the dictionary it gives me a FileNotFoundException.
This is the code initializing the dictionary:
public static void Initializer(){
try {
JWNL.initialize(new FileInputStream("file_properties.xml"));
dictionary = Dictionary.getInstance();
morphPro = dictionary.getMorphologicalProcessor();
}
catch(FileNotFoundException e){
e.printStackTrace();
} catch (JWNLException e) {
e.printStackTrace();
}
}
And this is what I get:
net.didion.jwnl.JWNLException: Unable to install net.didion.jwnl.dictionary.FileBackedDictionary
at net.didion.jwnl.util.factory.Element.install(Element.java:34)
at net.didion.jwnl.JWNL.initialize(JWNL.java:169)
at Algorithms.Stemmer.Initializer(Stemmer.java:54)
at Algorithms.Stemmer.WordStemmer(Stemmer.java:33)
at Algorithms.Stemmer.StringStemmer(Stemmer.java:26)
at GUI.ButtonListener.actionPerformed(ButtonListener.java:167)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(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.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.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: net.didion.jwnl.JWNLException: The properties file must specify a dictionary path
at net.didion.jwnl.util.factory.AbstractValueParam.create(AbstractValueParam.java:34)
at net.didion.jwnl.dictionary.FileBackedDictionary.install(FileBackedDictionary.java:111)
at net.didion.jwnl.util.factory.Element.install(Element.java:32)
I am pretty sure that it has something to do with the path, but I can not find out exactly what is wrong, since I changed the file properties.xml to use C:\WordNet\2.1\dict\ - so that should be okay?
I also got the same problem.
The error was:
gate.creole.ResourceInstantiationException: net.didion.jwnl.JWNLException: Unable to install net.didion.jwnl.dictionary.FileBackedDictionary
at gate.wordnet.JWNLWordNetImpl.init(JWNLWordNetImpl.java:62)
at gate.Factory.createResource(Factory.java:432)
at gate.Factory.createResource(Factory.java:139)
at WordNetApp.main(WordNetApp.java:45)
Caused by: net.didion.jwnl.JWNLException: Unable to install net.didion.jwnl.dictionary.FileBackedDictionary
at net.didion.jwnl.util.factory.Element.install(Element.java:34)
at net.didion.jwnl.JWNL.initialize(JWNL.java:169)
at gate.wordnet.JWNLWordNetImpl.init(JWNLWordNetImpl.java:57)
... 3 more
Caused by: net.didion.jwnl.JWNLException: The properties file must specify a dictionary path
at net.didion.jwnl.util.factory.AbstractValueParam.create(AbstractValueParam.java:34)
at net.didion.jwnl.dictionary.FileBackedDictionary.install(FileBackedDictionary.java:111)
at net.didion.jwnl.util.factory.Element.install(Element.java:32)
... 5 more
Caused by: net.didion.jwnl.JWNLException: Could not create a file manager of type class net.didion.jwnl.princeton.file.PrincetonRandomAccessDictionaryFile
at net.didion.jwnl.dictionary.file_manager.FileManagerImpl.create(FileManagerImpl.java:98)
at net.didion.jwnl.util.factory.AbstractValueParam.create(AbstractValueParam.java:32)
... 7 more
Caused by:
java.io.FileNotFoundException: C:\Program Files\WordNet\index.verb
(The system cannot find the file specified)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(Unknown Source)
at net.didion.jwnl.princeton.file.PrincetonRandomAccessDictionaryFile.openFile(PrincetonRandomAccessDictionaryFile.java:76)
at net.didion.jwnl.dictionary.file.AbstractDictionaryFile.open(AbstractDictionaryFile.java:58)
at net.didion.jwnl.dictionary.file.DictionaryCatalog.open(DictionaryCatalog.java:45)
at net.didion.jwnl.dictionary.file.DictionaryCatalogSet.open(DictionaryCatalogSet.java:34)
at net.didion.jwnl.dictionary.file_manager.FileManagerImpl.<init>(FileManagerImpl.java:71)
at net.didion.jwnl.dictionary.file_manager.FileManagerImpl.create(FileManagerImpl.java:96)
... 8 more
So I found the problem. In that properties.xml I given wrong path as:
<param name="dictionary_path" value="C:/Program Files/WordNet/"/>
So I changed its path to the directory contain verb file :
<param name="dictionary_path" value="C:/Program Files/WordNet/2.1/dict/"/>
So my problem solved.
Similarly you need to change the data.adj etc. to the form of adj.dat
(that is of course if you are not willing to change the version number in the file_properties.xml)
In file_properties.xml change the version number to the correct version.
Okay so I found out what was wrong. It was looking for the wrong files. I renamed the index.verb, index.adj etc. to verb.idx... This solved the problem and the program is now able to lookup the words in the dictionary.
jwnl doesn't work with wordnet 2.1 version. So try with wordnet 2.0
Then it works properly.

Categories