UnsatisfiedLinkError in Sun Example

Hi!
I know that a lot of topics deal with this problem, but I did`nt find a way to solve my special problem.
I�m trying to run an example that I found somewhere in the www, but it fails. All the following files are in the same directory (I have set the variable LD_LIBRARY_PATH anyway), I use no packages and nothing special at all.
Here are my files:
JAVA-FILE:
public class StrLen {
     public static native int strlen(String s);
     static {
          System.loadLibrary("strlen");
     public static void main(String[] args) {
          System.out.println( strlen("R+V Wiesbaden") );
... compiled with "javac StrLen.java"
... header-File createt with "javah -jni -o strlen.h StrLen"
C-FILE:
#include <jni.h>
#include "strlen.h"
#include <stdio.h>
#include <string.h>
JNIEXPORT jint JNICALL Java_StrLen_strlen_( JNIEnv *env, jclass clazz, jstring s) {
printf("Moin Wiesbaden!\n");
return 1;
THE BATCH-FILE (for creating a dll):
bcc32 -c -IC:\Programme\Java\j2sdk1.4.0_03\include -IC:\Programme\Java\j2sdk1.4.0_03\include\win32 strlen.cpp
bcc32 -tWD strlen.obj
The problem that occurs (java StrLen) gives the following message:
"Exception in thread "main" java.lang.UnsatisfiedLinkError: strlen
at StrLen.strlen(Native Method)
at StrLen.main(StrLen.java:10)
Many thanks in advance!!!!!
Michael

Sorry, I forgott he header-File that�s used by strlen.cpp:
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class StrLen */
#ifndef IncludedStrLen
#define IncludedStrLen
#ifdef __cplusplus
extern "C" {
#endif
* Class: StrLen
* Method: strlen
* Signature: (Ljava/lang/String;)I
JNIEXPORT jint JNICALL Java_StrLen_strlen
(JNIEnv *, jclass, jstring);
#ifdef __cplusplus
#endif
#endif

Similar Messages

  • Java.lang.UnsatisfiedLinkError: com.sun.media.vfw.VFWCapture.cacheFieldIDs()Z

    So i am trying to get started with the java media framework (JMF). Ive installed the jmf 2.1.1e for windows and i am using eclipse IDE.
    I have tried to add the jar files to the projects build path and dll files to the library path, but i get this error when trying to execute the project:
    java.lang.UnsatisfiedLinkError: com.sun.media.vfw.VFWCapture.cacheFieldIDs()Z
    Here is full log details:
    CaptureDeviceInfo: vfw:Microsoft WDM Image Capture (Win32):0 : vfw://0
    YUV Video Format: Size = java.awt.Dimension[width=640,height=480] MaxDataLength = 614400 DataType = class [B yuvType = 32 StrideY = 1280 StrideUV = 1280 OffsetY = 0 OffsetU = 1 OffsetV = 3
    YUV Video Format: Size = java.awt.Dimension[width=160,height=120] MaxDataLength = 38400 DataType = class [B yuvType = 32 StrideY = 320 StrideUV = 320 OffsetY = 0 OffsetU = 1 OffsetV = 3
    YUV Video Format: Size = java.awt.Dimension[width=320,height=240] MaxDataLength = 153600 DataType = class [B yuvType = 32 StrideY = 640 StrideUV = 640 OffsetY = 0 OffsetU = 1 OffsetV = 3
    Exception in thread "VFW Request Thread" java.lang.UnsatisfiedLinkError: com.sun.media.vfw.VFWCapture.cacheFieldIDs()Z
        at com.sun.media.vfw.VFWCapture.cacheFieldIDs(Native Method)
        at com.sun.media.vfw.VFWCapture.<clinit>(VFWCapture.java:27)
        at com.sun.media.protocol.vfw.VFWSourceStream.doConnect(VFWSourceStream.java:249)
        at com.sun.media.protocol.vfw.VFWSourceStream.run(VFWSourceStream.java:771)
        at java.lang.Thread.run(Thread.java:619)
    Can anyone help me ?
    消息编辑者为:68202d7a-8cea-4b67-88ff-d01edd8c7c1a

    Probably the libLinuxSerialParallel.so was not found.
    I copied this file to $JAVA_HOME/lib/i386 and it worked.

  • Images to Video (Sun Example doesn't work for me)

    Hi every one :)
    I'm trying to convert some jpg images into movie file. I saw the [Sun's example|http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/JpegImagesToMovie.html] , but when I try to execute I have a DataSink error:
    Cannot create the DataSink: javax.media.NoDataSinkException: Cannot find a DataSink for: com.sun.media.multiplexer.BasicMux$BasicMuxDataSource@c1f10e
    Failed to create a DataSink for the given output MediaLocator: foo.mov ¿There's another way to do it?
    P.S: Sorry for my english ;)

    darkskimmer wrote:
    The output MediaLocator, I create it with
    MediaLocator out = new MediaLocator("foo.mov");The error is creating out DataSink. No errors when creating the input stream of images...Which is why I told you specificlly...
    I believe the problem may be with how you're constructing your output MediaLocator... Check out their "main" method and see how they're converting their filenames into MediaLocators, and make sure you do that too. I can tell you, that's not how they do their output mediaLocators. They construct theirs with a "file://" prefix and a fully-rooted pathname. Check the code.
         if ((oml = createMediaLocator(outputURL)) == null) {
             System.err.println("Cannot build media locator from: " + outputURL);
             System.exit(0);
         }

  • Run server - sun example

    hi
    on the example available on this page, i try to run the server...
    http://java.sun.com/docs/books/tutorial/rmi/running.html
    java -Djava.rmi.server.codebase=http://127.0.0.1/~collinm/classes/ -Djava.rmi.server.hostname=127.0.0.1 -Djava.security.policy=java.policy engine.ComputeEnginei get some message:
    omputeEngine exception: access denied (java.net.SocketPermission host resolve)
    java.security.AccessControlException: access denied (java.net.SocketPermission host resolve)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
    at java.security.AccessController.checkPermission(AccessController.java:427)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    at java.lang.SecurityManager.checkConnect(SecurityManager.java:1031)
    at java.net.InetAddress.getAllByName0(InetAddress.java:1117)
    at java.net.InetAddress.getAllByName0(InetAddress.java:1098)
    at java.net.InetAddress.getAllByName(InetAddress.java:1061)
    at java.net.InetAddress.getByName(InetAddress.java:958)
    at java.net.InetSocketAddress.<init>(InetSocketAddress.java:124)
    at java.net.Socket.<init>(Socket.java:178)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Naming.java:160)
    at engine.ComputeEngine.main(ComputeEngine.java:25)
    any idea?

    i forgot to said... i don't use now the command line...
    i run the build.xml
    after i do: java ServerApp or i use java ide... to run it... and i get
    ServerImpl err: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
    java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
            at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
            at java.security.AccessController.checkPermission(AccessController.java:427)
            at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
            at java.lang.SecurityManager.checkConnect(SecurityManager.java:1034)
            at java.net.Socket.connect(Socket.java:501)
            at java.net.Socket.connect(Socket.java:457)
            at java.net.Socket.<init>(Socket.java:365)
            at java.net.Socket.<init>(Socket.java:178)
            at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
            at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
            at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569)
            at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
            at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
            at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
            at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
            at java.rmi.Naming.rebind(Naming.java:160)
            at ServerApp.main(Unknown Source)

  • Add codec to rtp transmitter :( (using sun example)

    Hi!
    I'm trying to add a simple codec to this example given by SUN: http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/AVTransmit.html
    It's the RTP Transmitter.
    The problem is that I kinda donno how, and where...
    Can ya help with a little clue?
    Thanks in advance.
    Chris

    After i do a restart.
    it is now showing.
    don't exactly know why and what's wrong b4?

  • Java.sun example won't compile

    hello..
    I've just succefully installed the JDK and am trying a few things ou to ensure it works, which as yet it doesn't.
    I'm using VIDE for the time being for my IDE
    and try to compile this.... which has been taken straight out of the tutorial pages
    //v 1.3
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class SwingApplication {
    private static String labelPrefix = "Number of button clicks: ";
    private int numClicks = 0;
    public Component createComponents() {
    final JLabel label = new JLabel(labelPrefix + "0 ");
    JButton button = new JButton("I'm a Swing button!");
    button.setMnemonic(KeyEvent.VK_I);
    button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    numClicks++;
    label.setText(labelPrefix + numClicks);
    label.setLabelFor(button);
    * An easy way to put space between a top-level container
    * and its contents is to put the contents in a JPanel
    * that has an "empty" border.
    JPanel pane = new JPanel();
    pane.setBorder(BorderFactory.createEmptyBorder(
    30, //top
    30, //left
    10, //bottom
    30) //right
    pane.setLayout(new GridLayout(0, 1));
    pane.add(button);
    pane.add(label);
    return pane;
    public static void main(String[] args) {
    try {
    UIManager.setLookAndFeel(
    UIManager.getCrossPlatformLookAndFeelClassName());
    } catch (Exception e) {}
    //Create the top-level container and add contents to it.
    JFrame frame = new JFrame("SwingApplication");
    SwingApplication app = new SwingApplication();
    Component contents = app.createComponents();
    frame.getContentPane().add(contents, BorderLayout.CENTER);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);
    the following errors occur, there are four and they all reffer to a swing component.
    Type JLabel not found in the declaration of the local variable 'label'.
    final JLabel label = new JLabel(labelPrefix + "0 ");
    and there's a hat under the very first 'J'. Ditto for JFrame JButton and JPanel
    Really confussed on this one everything seems to be in place the CLASSPATH is pointing to the lib directory where Javax et all are...
    Cheers
    A

    well...
    I'm using linix rehat 8 and my 'path' variable is set up the same as the installation instructions on a post close to this one... it is..
    "PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/X11R6/bin:/usr/local/vnc:/var/www:/home/software:/usr/java/j2sdk1.4.1_01/bin:/var/home/adam/bin"
    I'm new to unix and so am still a little confused.. This is the path to the executables and not the library files such as javax.swing, correct?? I have also ditched the IDE and running from the command promt. I am trying again this morning and am geting an extra error apparently.....
    " Can't find default package `javax.swing'. Check the CLASSPATH environment variable and the access to the archives"
    could someone explain what CLASSPATH is please as I thought it was only applicable to Windows. The javax package has been unpacked.
    Cheers
    Adam

  • Sun image examples won't work

    I hope this is the right forum to post the question, I couldn't find a more proper forum for it.
    I have been trying to get some of the Sun examples working on my newly installed computer. They work as far as to compile and run, but the pictures involved will not show. The path is correct and the pictures are correct. It only uses javax.swing and java.awt which are working perfectly otherwise.
    So, everything seems to work, except for the pictures not showing. Did I miss a part of the installation (since it is Sun code, there couldn't be a problem with it and the compilation is flawless as is running it).
    I have also tried an old applet I made with pictures - it works perfectly.
    I use SDK 1.4.1.
    I have tried solving this for about 48 hrs now...

    found the solution (and I'm really not convinced by the quality Sun issues to the public)
    There are several errors:
    1. on linux the folder WEB-INF must(!) be named in capitals
    2. the line <!DOCTYPE ... is missing in web.xml
    3. the parameter value starting with d:\logs ... should be changed to /var/log ... on linux systems
    4. if you build webpad with ant in a system based on j2se 1.4 you should change the parameter in webpad.jnlp accordingly
    Given all these problems to bring up a first example what does the Sun promise "one click application" stands for?
    Rolf

  • Error loading SolarisSerial: java.lang.UnsatisfiedLinkError:

    Hello All, i am having problems installin the java comm api in Eclipse. I added the comm.jar file from the comm api folder in the build path. and i added the javax.comm.properties file in:
    C:\Program Files\Java\jre1.6.0_01\lib
    but when i compile it and run, i get the following error:
    Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path
    Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z
         at com.sun.comm.SunrayInfo.isSessionActive(Native Method)
         at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155)
         at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100)
         at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:138)
         at ListOpenPorts.<init>(ListOpenPorts.java:17)
         at ListOpenPorts.main(ListOpenPorts.java:49)
    where did i go wrong? :/

    jschell wrote:
    Is it becuz i m using DELL laptop?Running solaris and not windows? The exception would certainly seem to suggest that you are running solaris.
    Thanx alot jschell :D Tht Solaris and Windows prob clicked! I revised all the installation procedure again, and installed Generic windows comm.jar file [for back end]and then the RxTxcomm.jar [for front end] and then in the configure build path [m Using Eclipse for my code] , i expanded the RxTxcomm.jar node, and added the path in the Native Library to:
    C:\Users\Urooj\Desktop\rxtx-2.2pre2-bins\win32\rxtxSerial.dll
    and instead of
    import javax.comm.CommPort;
    import javax.comm.CommPortIdentifier;
    import javax.comm.PortInUseException:D
    i replaced this with:
    import java.util.Enumeration;
    import gnu.io.CommPortIdentifier;
    import gnu.io.CommPort;
    import gnu.io.PortInUseException;Edited by: java-ized on Jan 5, 2010 3:49 PM

  • Ava.lang.UnsatisfiedLinkError:JMFSecurityManager:

    run a jmf based application realized on j2se using CDC. I'm using
    WebSphere Studio Service Device Developer of IBM. The application is
    compiled without errors after that I adapted all the classes to CDC personal
    profile specification.
    The application is client server. The basic function is that the server
    captures data from a webcam and sends it to a client that connects to it.
    Other features deal with the recovering of rtp pkt and more...
    On j2se it works well.Running it with WebSphere Studio Service Device
    Developer of IBM using personal profile libraries the client connects to the
    server but can't show the images sent by the server. There are these 2
    exceptions:
    1)
    java.lang.UnsatisfiedLinkError:JMFSecurityManager:
    java.lang.UnsatisfiedLinkError: jmfjawt (Unable to resolve DLL references -
    a prerequisite DLL may be missing)
    at com.sun.media.JMFSecurityManager.loadLibrary(JMFSecurityManager.java:206)
    at om.sun.media.DrawingSurfaceJAWT.<clinit>(DrawingSurfaceJAWT.java:23)
    2)Exception in thread "Loop thread:
    com.sun.media.renderer.video.DDRenderer@2ce32ce3"
    java.lang.UnsatisfiedLinkError:
    com/sun/media/DrawingSurfaceJAWT.getWindowHandle(Ljava/awt/Component;)I
    at com.sun.media.util.WindowUtil.getWindowHandle(Native Method)
    at com.sun.media.util.WindowUtil.getWindowHandle(WindowUtil.java:63)
    Could not create blitter
    Please tell me if someone can help me an suggest where find and correct this
    problem.
    Thanks in advance

    aoa how r u i am fine. i am doing development on pocket pc using cdc. i got same security exception while accesing Jsp page by using rmi in the midlet suite. set the security manager and client policy file in the midlet sratup method. i hope u will succeed.

  • JavaCard 2.2.2 on Linux and UnsatisfiedLinkError

    Hi All,
    I am trying to use the Linux version of JavaCard 2.2.2 and getting the following error when attempting to power up the card.
    java.lang.UnsatisfiedLinkError: com.sun.javacard.jpcsclite.PCSCLite.getNativeLibVersion()Ljava/lang/String;
    It looks to me that the libjpcsclite.so is incorrect for the version of the JavaCard (or vice-versa).
    It could be that I am doing something fundamentally wrong, but I can see the card (using pcsc_scan) and that retrieves the ATR correctly.
    Anyone experienced this?
    Cheers,
    Johan
    Edited by: johanlindquist on Jan 9, 2008 5:03 AM
    That should of course be version 2.2.2

    First of all, thank you for your rapid responses.
    I do not expect response from the author of the post. However, it was the only post over the internet with the same problem and i prefer not to make duplicates.:)
    I am interested in all freely available Java (and native library that the former use) libraries for communication with smartcards (for both Java1.6 and Java1.5). I found out as one of the possibilities for Java 1.5 -- use JCDK v 2.2.2 that was the first (and I think the only) JCDK version that included facilities to communicate not only with JCRE simulators but with a real card as well. On windows it did work perfectly. However, on Linux it did not. As I was able to find this was due to the reason, that the libjpcsclite.so library did not have the expected export methods symbols (while the one in the Solaris distributions does). It seems to be some kind of bug from Sun while building the distribution of JCDK for Linux. However, there are no jpcsclite sources (a subset of JPCSC that sun is using within JCDK) to recompile the native library. I think there is also no sense to report a bug, as PC/SC support is declared as optional within documentation and may not work on a ll platforms.
    Best regards,
    eve-z

  • MediaPlayer (java.lang.UnsatisfiedLinkError)

    Hi,
    I'm using a MediaPlayer for create a Video Player like as Youtube.
    I'm using Netbeans 6.8 and JavaFx 1.2.
    The video is: http://sun.edgeboss.net/download/sun/media/1460825906/1460825906_11810873001_09c01923-00.flv
    Sometimes when I refresh the browser or enter a few times on url, the "Video Player" throws the exception on the console and Screen gets a gray background:
    Caused by: java.lang.UnsatisfiedLinkError: com.sun.media.jmcimpl.plugins.directshow.DShowEngine.ndsInit()Z
         at com.sun.media.jmcimpl.plugins.directshow.DShowEngine.ndsInit(Native Method)
         at com.sun.media.jmcimpl.plugins.directshow.DShowEngine.nInit(Unknown Source)
         at com.sun.media.jmcimpl.plugins.directshow.DShowProvider$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.media.jmcimpl.plugins.directshow.DShowProvider.init(Unknown Source)
         at com.sun.media.jmcimpl.plugins.directshow.DShowProvider.canPlay(Unknown Source)
         at com.sun.media.jmcimpl.plugins.directshow.DShowProvider.canDecode(Unknown Source)
         at com.sun.media.jmcimpl.PeerManager.getMediaPeer(Unknown Source)
         at com.sun.media.jmc.Media.<init>(Unknown Source)
         at javafx.scene.media.Media.set$source(Unknown Source)
         at player2.Player$_SBECL.onChange(Player.fx:24)
         at com.sun.javafx.runtime.location.ObjectVariable.notifyListeners(Unknown Source)
         at com.sun.javafx.runtime.location.ObjectVariable.replaceValue(Unknown Source)
         at com.sun.javafx.runtime.location.ObjectVariable.set(Unknown Source)
         at player2.Player.set$video(Player.fx:23)
         at player2.Player.javafx$run$(Player.fx:92)
         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)Ps. The error occurs sometimes.
    The error is occurring to even on the MediaBox itself of Javafx [http://javafx.com/samples/MediaBox/index.html]
    To reproduce the error in the browser, refresh the browser a few times.
    Can anyone help me solve this problem?
    Sorry my poor english.
    Edited by: mgmunhoz on Apr 13, 2010 9:17 AM

    I've a similar problem and I think that this is a bug because this ocurrs SOMETIMES!
    You can try it in the link posted by Marcio, open in your browser and then refresh the browser few times.
    Thanks for your reply MarcinManga, but as you can see isn't a url problem, the error ocurrs with all urls i've tried. I'm always using http:// or mms:// protocols and the error is always the same.
    I've tryied this in: Google Chrome / Firefox 3.6 / IE 8 in Vista and Windows Seven and the error is always the same.
    Can anyone help us or report this as a bug?
    Thanks
    Edited by: volnei on 13/Abr/2010 17:15

  • Problem in communicating with ports

    dear friend,
    i have written code for listing ports.
    code is listed below
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Enumeration;
    import java.util.Formatter;
    import org.smslib.helper.CommPortIdentifier;
    import org.smslib.helper.SerialPort;
    import javax.comm.*;
    public class CommTest
         private static final String NODEVICE_FOUND = " no device found";
         private final static Formatter _formatter = new Formatter(System.out);
         static CommPortIdentifier portId;
         static Enumeration<CommPortIdentifier> portList;
         static int bauds[] = { 9600, 14400, 19200, 28800, 33600, 38400, 56000, 57600, 115200 };
         * Wrapper around {@link CommPortIdentifier#getPortIdentifiers()} to be
         * avoid unchecked warnings.
         @SuppressWarnings("unchecked")
         private static Enumeration<CommPortIdentifier> getCleanPortIdentifiers()
              return CommPortIdentifier.getPortIdentifiers();
         public static void main(String[] args)
              System.out.println("\nSearching for devices...");
              portList = getCleanPortIdentifiers();
              while (portList.hasMoreElements())
                   portId = portList.nextElement();
                   if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL)
                        _formatter.format("%nFound port: %-5s%n", portId.getName());
                        for (int i = 0; i < bauds.length; i++)
                             SerialPort serialPort = null;
                             _formatter.format("       Trying at %6d...", bauds);
                             try
                                  InputStream inStream;
                                  OutputStream outStream;
                                  int c;
                                  String response;
                                  serialPort = portId.open("SMSLibCommTester", 1971);
                                  serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN);
                                  serialPort.setSerialPortParams(bauds[i], SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
                                  inStream = serialPort.getInputStream();
                                  outStream = serialPort.getOutputStream();
                                  serialPort.enableReceiveTimeout(1000);
                                  c = inStream.read();
                                  while (c != -1)
                                       c = inStream.read();
                                  outStream.write('A');
                                  outStream.write('T');
                                  outStream.write('\r');
                                  Thread.sleep(1000);
                                  response = "";
                                  c = inStream.read();
                                  while (c != -1)
                                       response += (char) c;
                                       c = inStream.read();
                                  if (response.indexOf("OK") >= 0)
                                       try
                                            System.out.print(" Getting Info...");
                                            outStream.write('A');
                                            outStream.write('T');
                                            outStream.write('+');
                                            outStream.write('C');
                                            outStream.write('G');
                                            outStream.write('M');
                                            outStream.write('M');
                                            outStream.write('\r');
                                            response = "";
                                            c = inStream.read();
                                            while (c != -1)
                                                 response += (char) c;
                                                 c = inStream.read();
                                            System.out.println(" Found: " + response.replaceAll("\\s+OK\\s+", "").replaceAll("\n", "").replaceAll("\r", ""));
                                       catch (Exception e)
                                            System.out.println(_NO_DEVICE_FOUND);
                                  else
                                       System.out.println(_NO_DEVICE_FOUND);
                             catch (Exception e)
                                  System.out.print(_NO_DEVICE_FOUND);
                                  Throwable cause = e;
                                  while (cause.getCause() != null)
                                       cause = cause.getCause();
                                  System.out.println(" (" + cause.getMessage() + ")");
                             finally
                                  if (serialPort != null)
                                       serialPort.close();
              System.out.println("\nTest complete.");
    the error i am getting is
    Caught java.lang.ClassNotFoundException: com.sun.comm.Win32Driver while loading driver com.sun.comm.Win32Driver
    Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path
    Test complete.
    Caught java.lang.UnsatisfiedLinkError: com.sun.comm.SolarisDriver.readRegistrySerial(Ljava/util/Vector;Ljava/lang/String;)I while loading driver com.sun.comm.SolarisDriver
    *1*) i don't know what is this?
    i have downloaded java comm 20-win32.zip and done the necessary things as told in the manual.
    actually i am trying to send sms in between pc and mobile using smslib.
    but i am facing lot of errors.
    code is this to send msg from pc to mobile
    SendMessage.java - Sample application.
    // This application shows you the basic procedure for sending messages.
    // You will find how to send synchronous and asynchronous messages.
    // For asynchronous dispatch, the example application sets a callback
    // notification, to see what's happened with messages.
    package examples.modem;
    import org.smslib.IOutboundMessageNotification;
    import org.smslib.Library;
    import org.smslib.OutboundMessage;
    import org.smslib.Service;
    import org.smslib.modem.SerialModemGateway;
    public class SendMessage
         public void doIt() throws Exception
              Service srv;
              OutboundMessage msg;
              OutboundNotification outboundNotification = new OutboundNotification();
              System.out.println("Example: Send message from a serial gsm modem.");
              System.out.println(Library.getLibraryDescription());
              System.out.println("Version: " + Library.getLibraryVersion());
              srv = new Service();
              SerialModemGateway gateway = new SerialModemGateway("modem.com1", "COM1", 57600, "Nokia", "6310i");
              gateway.setInbound(true);
              gateway.setOutbound(true);
              gateway.setSimPin("0000");
              srv.setOutboundNotification(outboundNotification);
              srv.addGateway(gateway);
              srv.startService();
              System.out.println();
              System.out.println("Modem Information:");
              System.out.println(" Manufacturer: " + gateway.getManufacturer());
              System.out.println(" Model: " + gateway.getModel());
              System.out.println(" Serial No: " + gateway.getSerialNo());
              System.out.println(" SIM IMSI: " + gateway.getImsi());
              System.out.println(" Signal Level: " + gateway.getSignalLevel() + "%");
              System.out.println(" Battery Level: " + gateway.getBatteryLevel() + "%");
              System.out.println();
              // Send a message synchronously.
              msg = new OutboundMessage("+306948494037", "Hello from SMSLib!");
              srv.sendMessage(msg);
              System.out.println(msg);
              // Or, send out a WAP SI message.
              //OutboundWapSIMessage wapMsg = new OutboundWapSIMessage("+306948494037", new URL("https://mail.google.com/"), "Visit GMail now!");
              //srv.sendMessage(wapMsg);
              //System.out.println(wapMsg);
              // You can also queue some asynchronous messages to see how the callbacks
              // are called...
              //msg = new OutboundMessage("+309999999999", "Wrong number!");
              //msg.setPriority(OutboundMessage.Priorities.LOW);
              //srv.queueMessage(msg, gateway.getGatewayId());
              //msg = new OutboundMessage("+308888888888", "Wrong number!");
              //msg.setPriority(OutboundMessage.Priorities.HIGH);
              //srv.queueMessage(msg, gateway.getGatewayId());
              System.out.println("Now Sleeping - Hit <enter> to terminate.");
              System.in.read();
              srv.stopService();
         public class OutboundNotification implements IOutboundMessageNotification
              public void process(String gatewayId, OutboundMessage msg)
                   System.out.println("Outbound handler called from Gateway: " + gatewayId);
                   System.out.println(msg);
         public static void main(String args[])
              SendMessage app = new SendMessage();
              try
                   app.doIt();
              catch (Exception e)
                   e.printStackTrace();
    error i am getting is
    Caught java.lang.ClassNotFoundException: com.sun.comm.Win32Driver while loading driver com.sun.comm.Win32Driver
    org.smslib.GatewayException: Comm library exception: java.lang.reflect.InvocationTargetException
    at org.smslib.modem.SerialModemDriver.connectPort(SerialModemDriver.java:93)
    at org.smslib.modem.AModemDriver.connect(AModemDriver.java:110)
    at org.smslib.modem.ModemGateway.startGateway(ModemGateway.java:126)
    at org.smslib.Service$1Starter.run(Service.java:222)
    *2*) i cannot understand what is this.i have done as per the installation page in SMSLib. can you please help me
    ****** one more important thing is that i have not connected any cable to the ports.
    thanks in regards
    Edited by: arunachu on Nov 5, 2008 3:58 AM

    Hi friends..i need solution for this .
    i use org.smslib.*; for messge sending .
    i done it in same code in windows machine . but i had some prob in linux machine
    it showing this kind of error . in run time ..
    =========================================
    Native lib Version = RXTX-2.1-7
    Java lib Version = RXTX-2.1-7
    check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file.
    please see: How can I use Lock Files with rxtx? in INSTALL
    check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file.
    please see: How can I use Lock Files with rxtx? in INSTALL
    check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file.
    please see: How can I use Lock Files with rxtx? in INSTALL
    check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file.
    please see: How can I use Lock Files with rxtx? in INSTALL
    check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file.
    please see: How can I use Lock Files with rxtx? in INSTALL
    org.smslib.GatewayException: Comm library exception: java.lang.RuntimeException: gnu.io.NoSuchPortException
    at org.smslib.modem.SerialModemDriver.connectPort(SerialModemDriver.java:92)
    at org.smslib.modem.AModemDriver.connect(AModemDriver.java:110)
    at org.smslib.modem.ModemGateway.startGateway(ModemGateway.java:126)
    at org.smslib.Service$1Starter.run(Service.java:222)
    Thanks to Advance ..
    Merry X-mas

  • Exception in thread "JMF thread???

    I try to write a very simple project which just play a local media in an Applet, although this example can be found in a lot of places, I met an Exception which kind of strange, Can anyone met this before? My Code is very simple.
    import java.applet.Applet;
    import java.awt.BorderLayout;
    import java.awt.*;
    import java.io.*;
    import java.net.MalformedURLException;
    import java.net.URL;
    import javax.media.*;
    import javax.swing.*;
    public class test1 extends Applet{
         URL url;
         Player player=null;
         public void init(){
              setLayout( new BorderLayout() );
              try {
                   URL mediaURL = new URL(getDocumentBase(), "A Perfect Indian.mp3");
                   System.out.println(mediaURL);
                   player = Manager.createRealizedPlayer(mediaURL);
              }catch(Exception e){
                   System.out.println("problems here 1");
                   e.printStackTrace();
    Exception in thread "JMF thread: com.sun.media.amovie.AMController@7c6768[ com.sun.media.amovie.AMController@7c6768 ] ( realizeThread)" java.lang.UnsatisfiedLinkError: com.sun.media.amovie.ActiveMovie.openFile(Ljava/lang/String;)Z
         at com.sun.media.amovie.ActiveMovie.openFile(Native Method)
         at com.sun.media.amovie.ActiveMovie.<init>(ActiveMovie.java:47)
         at com.sun.media.amovie.AMController.createActiveMovie(AMController.java:293)
         at com.sun.media.amovie.AMController.doRealize(AMController.java:416)
         at com.sun.media.RealizeWorkThread.process(BasicController.java:1400)
         at com.sun.media.StateTransitionWorkThread.run(BasicController.java:1339)

    An unsatisfied link error occurs when the JVM cannot find a class in a library that it was expecting to be able to find.
    In this instance, it sounds like you (1) didn't include JMF.jar in your applet's classpath, and/or (2) didn't include the MP3 plugin to your applet's classpath...

  • Looking for sound solution for J2ME.

    Hello everyone,
    I am wondering how to play sound (for example, .wav, .mp3, etc.) on J2ME platform, especially Foundation profile. Can anyone provide any resources?
    Thanks in advance,
    George

    Thanks fakhar,
    Foundation profile is based on CDC and MIDP isbased
    on CLDC, so they have different underlying
    frameworks. This is why I am wondering whetherMMAPI
    can be used on Foundation profile. I want to know
    your ideas on it.That's right .. the following .ppt says "[...]
    Targets the CLDC as its lowest common denominator so
    it can also be used on CDC-based profiles as well."
    - http://www-staff.it.uts.edu.au/~ventsov/lec13.ppt
    It seems MMAPI can be used as an optional package
    with CDC/FP based-devices.
    But point is that even if it is possible, are there
    devices available in the market?Your reply is very helpful. I am meeting with a further issue when running the following simple sample of MMAI,
    public static void main(String[] args) {
         try {
              Player player = Manager.createPlayer"http://localhost/sample.wav");
              player.start();
         } catch (MediaException e) {
              e.printStackTrace();
         } catch (IOException e) {
              e.printStackTrace();
    }java.lang.UnsatisfiedLinkError will be thrown,
    Exception occurs in thread �main� java.lang.UnsatisfiedLinkError: com/sun/mmedia/WaveOut.nOpen(IIIII)I
         at com.sun.mmedia.WaveOut.open(Unknown Source)
         at com.sun.mmedia.WavPlayer.doPrefetch(Unknown Source)
         at com.sun.mmedia.BasicPlayer.prefetch(Unknown Source)
         at com.sun.mmedia.BasicPlayer.start(Unknown Source)I am wondering how to solve this issue?
    Thanks in advance,
    George

  • MediaPlayer exception in Windows7 64 bit

    I've recently purchased a 64bit Windows7 notebook and can't seem to get a basic MediaPlayer example working in Netbeans 6.9.1 using javaFx 1.3.1
    Here's my code copied from the online example...
    import javafx.scene.Scene;
    import javafx.stage.Stage;
    import javafx.scene.media.Media;
    import javafx.scene.media.MediaPlayer;
    import javafx.scene.media.MediaView;
    Stage {
    title: "MyApp"
    scene: Scene {
    width: 200
    height: 200
    content: [
    MediaView {
    preserveRatio: true
    mediaPlayer: MediaPlayer {
    autoPlay: true
    media: Media {
    source:
    "file://c:/uploads/bunny.flv"; //http://sun.edgeboss.net/download/sun/media/1460825906/1460825906_2956241001_big-buck-bunny-640x360.flv"
    It fails with the following stack trace:
    java.lang.UnsatisfiedLinkError: com.sun.media.jmcimpl.plugins.directshow.DShowEngine.ndsInit(I)Z
    at com.sun.media.jmcimpl.plugins.directshow.DShowEngine.ndsInit(Native Method)
    at com.sun.media.jmcimpl.plugins.directshow.DShowEngine.nInit(DShowEngine.java:245)
    at com.sun.media.jmcimpl.plugins.directshow.DShowProvider$1.run(DShowProvider.java:204)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.media.jmcimpl.plugins.directshow.DShowProvider.init(DShowProvider.java:180)
    at com.sun.media.jmcimpl.plugins.directshow.DShowProvider.canPlay(DShowProvider.java:245)
    at com.sun.media.jmcimpl.plugins.directshow.DShowProvider.canDecode(DShowProvider.java:299)
    at com.sun.media.jmcimpl.PeerManager.getMediaPeer(PeerManager.java:201)
    at com.sun.media.jmc.Media.<init>(Media.java:66)
    at javafx.scene.media.Media.onReplace$source(Media.fx:90)
    at javafx.scene.media.Media.set$source(Media.fx)
    at sandbox.MediaTest.javafx$run$(MediaTest.fx:30)
    at sandbox.MediaTest.javafx$run$(MediaTest.fx:30)
    I've tried running it with local and remote media files - same result.
    I've tried using 64 bit jdk1.6.0_23 and 32 bit jdk1.6.0_23 installations - same result.
    This code runs fine on a 32 bit Vista notebook with jdk1.6.0_23 but the 64 bit notebook is new so its possible I don't have everything necessary installed; I just don't happen to know whats missing.. Any suggestions?

    That occurred to me yes and I've been googling things like 'DirectShow installation' but can't find a decent link to something that will do an installation.. I've installed 64 bit codecs but no joy in getting the simple example to run. If anyone has a link to a simple direct show installation would be appreciated, thx.

Maybe you are looking for

  • Help ! Crystal Reports 2008 for Visual Studio Hangs

    I am using CR 2008 in VS 2008. When I try to set a data source in a crystal reports viewer the first time it hangs. This only occurs on the very first viewer that gets set. Once the first one works, I never have a problem again. This has been a probl

  • Won't run with 2 CPUs

    I just replaced my 6501 motherboard with one that MSI sent me. When I install both processors the computer most times hangs at startup screen. Lights 2 and 3 are red which indicates it stops at the Bios sign-on. It hangs where it says AMD MP 2800 Pro

  • Workflow step - send email - address of sender

    Hi, We are using workflow to register travels and leave requests and we are sending emails to the employees about eg. that their document has been rejected/approved. Emails are sent by user WFBATCH. Is it possible to change this user to some other on

  • Hyperion Enterprise 6.5.1.1 Error when configuring HEWeb

    I have a newly installed version of Hyperion Enterprise 6.5.1.1 on a Windows 2008 R2 server. When I launch HEWeb via internet explorer, I am getting the following error: Server Error in '/HEWeb' Application Object variable or With block variable not

  • Global problem with immediate="true"

    JSF specifies that immediate="true" in UICommands should skip the Validation and Update Model phases. The RI uses the Update Model phase to reset the local values of the input components after updating the model. That means that in the case of immedi