java.lang.NullPointerException (SMS) - java

I created this program server and client to send sms via bluetooth and i got stuck with this problem my client works perfectly and this one to but when I'm running this file and press the but I get null point exception. I will appreciate your help.
LocalDevice.getLocalDevice().setDiscoverable(DiscoveryAgent.GIAC);
Error message
java.lang.NullPointerException
at SMS_SERVER.jButton2ActionPerformed(SMS_SERVER.java:267)
at SMS_SERVER.access$000(SMS_SERVER.java:27)
at SMS_SERVER$1.actionPerformed(SMS_SERVER.java:101)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6289)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6054)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4652)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4482)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4482)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:603)
at java.awt.EventQueue$1.run(EventQueue.java:601)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:617)
at java.awt.EventQueue$2.run(EventQueue.java:615)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Follow Anothem's suggestion. If you're using jsr82, that's only the API. It is expected that developers do their own implementations.
Alternatively, you could download the Bluecove implementation binaries.

If the line above is the one you encounter the exception on, check if LocalDevice.getLocalDevice() actually returns what you expect. If it doesn't, that's your problem.

Try to put a new instance in your call of
public void actionPerformed(java.awt.event.ActionEvent evt) {
-> public void actionPerformed(new java.awt.event.ActionEvent evt) {
let me know
Bye

Related

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError

I am trying to read a .docx file into a JTextPane, but its giving some exception. I am using POI library. What should I do? Help me out, please. Here is my code:
file = new File(
"C:\\Users\\Siddique Ansari\\Documents\\CV Parser\\Siddique_Resume.docx");
FileInputStream fis=new FileInputStream(file.getAbsolutePath());
XWPFDocument document=new XWPFDocument(fis);// line no 549
extractor = new XWPFWordExtractor(document);
String fileData = extractor.getText();
Document doc = jTextPane1.getDocument();
System.out.println(fileData);
doc.insertString(doc.getLength(), fileData, null);
And this is the Exception:
Exception in thread "AWT-EventQueue-0"
java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlException
at cvparser.ExcelSheet.jButton3ActionPerformed(ExcelSheet.java:549)
at cvparser.ExcelSheet.access$400(ExcelSheet.java:39)
at cvparser.ExcelSheet$5.actionPerformed(ExcelSheet.java:219)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6263)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6028)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2475)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlException
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 28 more
In addition to the apache-poi JAR files, for example,
1869113 11-26-12 17:22 poi-3.9/poi-3.9-20121203.jar
936648 11-26-12 17:22 poi-3.9/poi-ooxml-3.9-20121203.jar
4802621 11-26-12 17:22 poi-3.9/poi-ooxml-schemas-3.9-20121203.jar
You'll also need the JAR files from ooxml-lib in your classpath:
313898 04-05-09 14:28 poi-3.9/ooxml-lib/dom4j-1.6.1.jar
26514 02-23-11 12:31 poi-3.9/ooxml-lib/stax-api-1.0.1.jar
2666695 04-05-09 14:29 poi-3.9/ooxml-lib/xmlbeans-2.3.0.jar

java.lang.ClassNotFoundException

I tried to broadcast an object using object serialization and UDP connection. I am using netbeans IDE and i use a Java Desktop Application for both sending and receivinends.Object is broadcasted when a button is clicked. And i get the following exception...
Oct 29, 2011 1:50:04 PM receive1.Receive1View jButton1ActionPerformed
SEVERE: null
java.lang.ClassNotFoundException: send.objecttransmit
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:604)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at receive1.Receive1View.jButton1ActionPerformed(Receive1View.java:245)
at receive1.Receive1View.access$800(Receive1View.java:29)
at receive1.Receive1View$4.actionPerformed(Receive1View.java:133)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6267)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6032)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
The code works well when i try to broadcast from class using java class library of netbeans IDE.
please help.
How are you handling lost packets? UDP is a lossy protocol and if a packet is lost you could get a corrupt "stream" if you just combine the packets you do get.
The problem is that the application that is attempting to deserialize the object does not have the class send.objecttransmit on its classpath when you run it standalone.
The code works well when i try to broadcast from class using java class library of netbeans IDE.
I'm not sure I understand what you are saying, but if your application is working in NetBeans, then that must be because the class is on the classpath when you run it that way.

java.lang.ClassCastException: org.hibernate.hql.ast.tree.SqlNode cannot be cast to org.hibernate.hql.ast.tree.FromReferenceNode

Im trying to update a record with a HQL query but I am getting a CastException.
If anyone could help me out I would really appreciate it.
I have checked the Internet for a while now but I cant find any information on this.
Please let me know if you have more information on this exception.
The full error message its returning:
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: org.hibernate.hql.ast.tree.SqlNode cannot be cast to org.hibernate.hql.ast.tree.FromReferenceNode
at org.hibernate.hql.ast.HqlSqlWalker.generateSyntheticDotNodeForNonQualifiedPropertyRef(HqlSqlWalker.java:495)
at org.hibernate.hql.ast.HqlSqlWalker.lookupNonQualifiedProperty(HqlSqlWalker.java:488)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.propertyRef(HqlSqlBaseWalker.java:1102)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.assignment(HqlSqlBaseWalker.java:1008)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.setClause(HqlSqlBaseWalker.java:729)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.updateStatement(HqlSqlBaseWalker.java:349)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:237)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at Database.HibernateConnection.updateFlight(HibernateConnection.java:161)
at Controller.Controller.ChangeFlight(Controller.java:527)
at View.CreateChangeFlightView.btnSaveActionPerformed(CreateChangeFlightView.java:738)
at View.CreateChangeFlightView.access$1000(CreateChangeFlightView.java:45)
at View.CreateChangeFlightView$6.actionPerformed(CreateChangeFlightView.java:299)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6263)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6028)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
query: deleted
The problem is caused by the fact that from is a reserved word in HQL. Since it's not possbile to escape a keyword in HQL, the only possbile solution is to rename that field.

Freetts: projects works inside the IDE (netbeans and eclipse) but the exported jar give errors

thank you for reading this.
i m using freetts to make my program speak some text...
While inside the IDE, when i run all the programs, they work fine.(mine and all freetts example programs).
Also the runnable programs (jar) that come with the bin download of freetts, run on terminal fine.... Freetts --> http://sourceforge.net/projects/freetts/files/
Well the exact same programs doesn't work when i export them from the IDE. Tried both netbeans and eclipse to export the programs but i m getting errors.
i m suspecting it has to do with the jar files i include in the projects (jsapi.jar, freetts.jar,freetts-jsapi10.jar). i mean that somehow it may be forbidden to use them this way but maybe i m talking nonsense.
Anyone know what's happening?
i m posting 3 different errors i m getting on terminal from 3 programs distributions that work fine on IDEs... sorry for the long post
1.
java -jar JSAPIClock.jar
checkPoint1
java.lang.NullPointerException
at jsapiclock.JSAPIClock.createSynthesizer(JSAPIClock.java:49)
at jsapiclock.JSAPIClock.main(JSAPIClock.java:86)
checkPoint2
checkPoint3
checkPoint4
The time is now, almost half past six, in the evening.
Exception in thread "Thread-1" java.lang.NullPointerException
at jsapiclock.JSAPIClock.speak(JSAPIClock.java:74)
at jsapiclock.Clock.speakTime(Clock.java:233)
at jsapiclock.Clock.access$000(Clock.java:41)
at jsapiclock.Clock$ClockThread.run(Clock.java:269)
2.notice that Speech.properties file is included in both directories below
java -jar HelloWorld.jar
All general Mode JSAPI Synthesizers and Voices:
Using voice: kevin16
No synthesizer created. This may be the result of any
number of problems. It's typically due to a missing
"speech.properties" file that should be at either of
these locations:
user.home : /home/yiannis
java.home/lib: /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib
Another cause of this problem might be corrupt or missing
voice jar files in the freetts lib directory. This problem
also sometimes arises when the freetts.jar file is corrupt
or missing. Sorry about that. Please check for these
various conditions and then try again.
3.This is weird actually
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:127)
at java.util.jar.JarFile.<init>(JarFile.java:135)
at java.util.jar.JarFile.<init>(JarFile.java:72)
at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:72)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:48)
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:55)
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:104)
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:71)
at java.net.JarURLConnection.getManifest(JarURLConnection.java:217)
at java.net.JarURLConnection.getMainAttributes(JarURLConnection.java:269)
at com.sun.speech.freetts.VoiceManager.getDependencyURLs(VoiceManager.java:251)
at com.sun.speech.freetts.VoiceManager.getDependencyURLs(VoiceManager.java:283)
at com.sun.speech.freetts.VoiceManager.getVoiceDirectories(VoiceManager.java:173)
at com.sun.speech.freetts.VoiceManager.getVoices(VoiceManager.java:110)
at com.sun.speech.freetts.jsapi.FreeTTSEngineCentral.createEngineList(FreeTTSEngineCentral.java:85)
at blah2.CustomSpeaker.createSynthesizer(CustomSpeaker.java:34)
at blah2.FullScreenBox.<init>(FullScreenBox.java:49)
at blah2.Blah2View.actionPerformed(Blah2View.java:323)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6288)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6053)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4651)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
at java.awt.EventQueue.access$000(EventQueue.java:84)
at java.awt.EventQueue$1.run(EventQueue.java:602)
at java.awt.EventQueue$1.run(EventQueue.java:600)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:616)
at java.awt.EventQueue$2.run(EventQueue.java:614)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
System property "mbrola.base" is undefined. Will not use MBROLA voices.
java.lang.NullPointerException
at blah2.CustomSpeaker.createSynthesizer(CustomSpeaker.java:36)
at blah2.FullScreenBox.<init>(FullScreenBox.java:49)
at blah2.Blah2View.actionPerformed(Blah2View.java:323)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6288)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6053)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4651)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
at java.awt.EventQueue.access$000(EventQueue.java:84)
at java.awt.EventQueue$1.run(EventQueue.java:602)
at java.awt.EventQueue$1.run(EventQueue.java:600)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:616)
at java.awt.EventQueue$2.run(EventQueue.java:614)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Exception in thread "Thread-1" java.lang.NullPointerException
at blah2.CustomSpeaker.speak(CustomSpeaker.java:61)
at blah2.Speaker$SpeakerThread.run(Speaker.java:42)

Why dll doesn't run if VS2010 doesn't exist?

l've written a dll on VS2010 and I will call it from JAVA by the help of JNA.But it doesn't run if VS 2010 doesn't exist on computer.It gives errors
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError:
Unable to load library 'C:\Users\hasan\Desktop\cv-2dll.dll': The
specified module could not be found. at
com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:166) at
com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:239) at
com.sun.jna.Library$Handler.(Library.java:140) at
com.sun.jna.Native.loadLibrary(Native.java:393) at
com.sun.jna.Native.loadLibrary(Native.java:378) at
hsv.HSVHistogram.main(HSVHistogram.java:24) at
hsv.HSVView.jButton1ActionPerformed(HSVView.java:231) at
hsv.HSVView.access$900(HSVView.java:25) at
hsv.HSVView$5.actionPerformed(HSVView.java:134) at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6288) at
javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at
java.awt.Component.processEvent(Component.java:6053) at
java.awt.Container.processEvent(Container.java:2041) at
java.awt.Component.dispatchEventImpl(Component.java:4651) at
java.awt.Container.dispatchEventImpl(Container.java:2099) at
java.awt.Component.dispatchEvent(Component.java:4481) at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085) at
java.awt.Window.dispatchEventImpl(Window.java:2478) at
java.awt.Component.dispatchEvent(Component.java:4481) at
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643) at
java.awt.EventQueue.access$000(EventQueue.java:84) at
java.awt.EventQueue$1.run(EventQueue.java:602) at
java.awt.EventQueue$1.run(EventQueue.java:600) at
java.security.AccessController.doPrivileged(Native Method) at
java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at
java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:616) at
java.awt.EventQueue$2.run(EventQueue.java:614) at
java.security.AccessController.doPrivileged(Native Method) at
java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:613) at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Your DLL probably needs the C/C++ runtime DLLs. The computer without Visual Studio 2010 installed probably doesn't have them.
Try compiling your DLL so that the C/C++ Runtime Library is statically linked into the DLL. Open the properties page for your DLL project in VS 2010, then select the Configuration Properties->C/C++->Code Generation subdialog and select Multi-threaded (/MT) or Multi-threaded Debug (/MTd). Once you recompile & relink the DLL it should run on systems without the VS 2010 runtime DLLs.

Categories

Resources