Problem use c for API

Hi
i use berkeley db .my operating system is unix freebsd and c for api.
i use gcc compiler for compile program.
my program is like this
#include <db.h>
#include <stdio.h>
int main()
DB *dbp ;
u_int32_t flags;
int ret;
ret =db_create(&dbp, NULL,0);
//if (ret != 0) {
flags = DB_CREATE;
ret = dbp->open(dbp,NULL,"test.db", NULL,DB_BTREE,0,0);
if (ret != 0) {
printf("error occured");
but when i compile this program diplay this error:
undefined reference to `db_create'
please help me.
if i need to use other compiler or install other software for run c program please say me

You didn't list the gcc command you used to compile/link.
This error - "undefined reference to 'db_create'" - means that you
are not linking against the Berkeley DB library when you attempt
to load the program. It also could mean you are linking against the wrong version
of a library.
Here is an example of command syntax that works for me on SUSE.
gcc -Wall -I/usr/local/BerkeleyDB.4.4/include inmem2.c -L/usr/local/BerkeleyDB.4.4/lib -ldb-4.4 -o inmem2.o
env LD_LIBRARY_PATH=/usr/local/BerkeleyDB.4.4/lib ./inmem2.o
Of course, you should substitute in the name of your own program
and the desired output name.
Since these procedures are not completely standardized, please
check your compiler and loader documentation for specific information
as to how to reference a library on your system during the link
phase. You may need to set a value for LD_LIBRARY_PATH or a
similar environment variable.
Ron Cohen

Similar Messages

  • Problem using Java Mail API with WLS 7.0

    Hi All,
    I am trying to use the Java Mail API provided by WLS 7.0. I have made the
    settings metioned in the WLS 7.0 docs. However when I try to run the program I
    am getting the following error:
    javax.naming.NoInitialContextException: Need to specify class name in environment
    or system property, or as an applet parameter, or in an application resource file:
    java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    46)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.jav
    a:283)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    The code that I have written is as follows
    import java.util.*;
    import javax.activation.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.naming.*;
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    public class MailTo {
         public static void main(String args[])
              try
                   //Context ic = getInitialContext();
                   InitialContext ic = new InitialContext();
    /* My jndi name is "testSession" */
                   Session session = (Session) ic.lookup("testSession"); /* THE PROBLEM IS SHOWN
    IN THIS LINE */
                   Properties props = new Properties();
                   props.put("mail.transport.protocol", "smtp");
                   props.put("mail.smtp.host", "XX.XX.XX.XX");
    /* For security reasons I have written the ip add in this format */
                   props.put("mail.from", "[email protected]"); /* for security reasons i have
    changed the mail address */
                   Session session2 = session.getInstance(props);
                   Message msg = new MimeMessage(session2);
                   msg.setFrom();
                   msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse("[email protected]",
    false));
                   msg.setSubject("Test Message");
                   msg.setSentDate(new Date());
                   MimeBodyPart mbp = new MimeBodyPart();
                   mbp.setText("This is a mail sent to you using JAVA Mail API and Weblogic Server");
                   Multipart mp = new MimeMultipart();
                   mp.addBodyPart(mbp);
                   msg.setContent(mp);
                   Transport.send(msg);
              catch(Exception e)
                   e.printStackTrace();
         }//end of main
    public static Context getInitialContext()
         throws NamingException
              Properties p = new Properties();
              p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
              p.put(Context.PROVIDER_URL, "t3://localhost:7501/testWebApp");
                   p.put(Context.SECURITY_PRINCIPAL, "weblogic");
                   p.put(Context.SECURITY_CREDENTIALS, "weblogic");
              return new InitialContext(p);
    }//end of class
    Can anyone please tell me what is the problem. I thought that we cannot directly
    do
    InitialContext ic = new InitialContext();
    So I had written a method getInitialContext() as shown in the above piece of code,
    but that too did not work.
    Eagerly awaiting a response.
    Jimmy Shah

    You can use InitialContext ic = new InitialContext() only if you are using a startup class, servlet or a JSP i.e
    server side code.
    If you are using a java client you need to use Context ic = getInitialContext();
    Try this code
    import java.util.*;
    import javax.activation.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.naming.*;
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    public class MailTo {
    public static void main(String args[])
    try {
    Properties h = new Properties();
    h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    h.put(Context.PROVIDER_URL, "t3://localhost:7001");
    Context ic = new InitialContext(h);
    Session session = (Session) ic.lookup("testSession");
    Properties props = new Properties();
    props.put("mail.transport.protocol", "smtp");
    props.put("mail.smtp.host", "XX.XX.XX.XX");
    props.put("mail.from", "[email protected]");
    Session session2 = session.getInstance(props);
    Message msg = new MimeMessage(session2);
    msg.setFrom();
    msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse("[email protected]",false));
    msg.setSubject("Test Message");
    msg.setSentDate(new Date());
    MimeBodyPart mbp = new MimeBodyPart();
    mbp.setText("This is a mail sent to you using JAVA Mail API and Weblogic Server");
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp);
    msg.setContent(mp);
    Transport.send(msg);
    catch(Exception e)
    e.printStackTrace();
    }//end of main
    }//end of class
    We have shipped a javamail example in the samples\server\src\examples\javamail folder.
    Jimmy Shah wrote:
    Hi All,
    I am trying to use the Java Mail API provided by WLS 7.0. I have made the
    settings metioned in the WLS 7.0 docs. However when I try to run the program I
    am getting the following error:
    javax.naming.NoInitialContextException: Need to specify class name in environment
    or system property, or as an applet parameter, or in an application resource file:
    java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    46)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.jav
    a:283)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    The code that I have written is as follows
    import java.util.*;
    import javax.activation.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.naming.*;
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    public class MailTo {
    public static void main(String args[])
    try
    //Context ic = getInitialContext();
    InitialContext ic = new InitialContext();
    /* My jndi name is "testSession" */
    Session session = (Session) ic.lookup("testSession"); /* THE PROBLEM IS SHOWN
    IN THIS LINE */
    Properties props = new Properties();
    props.put("mail.transport.protocol", "smtp");
    props.put("mail.smtp.host", "XX.XX.XX.XX");
    /* For security reasons I have written the ip add in this format */
    props.put("mail.from", "[email protected]"); /* for security reasons i have
    changed the mail address */
    Session session2 = session.getInstance(props);
    Message msg = new MimeMessage(session2);
    msg.setFrom();
    msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse("[email protected]",
    false));
    msg.setSubject("Test Message");
    msg.setSentDate(new Date());
    MimeBodyPart mbp = new MimeBodyPart();
    mbp.setText("This is a mail sent to you using JAVA Mail API and Weblogic Server");
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp);
    msg.setContent(mp);
    Transport.send(msg);
    catch(Exception e)
    e.printStackTrace();
    }//end of main
    public static Context getInitialContext()
    throws NamingException
    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    p.put(Context.PROVIDER_URL, "t3://localhost:7501/testWebApp");
    p.put(Context.SECURITY_PRINCIPAL, "weblogic");
    p.put(Context.SECURITY_CREDENTIALS, "weblogic");
    return new InitialContext(p);
    }//end of class
    Can anyone please tell me what is the problem. I thought that we cannot directly
    do
    InitialContext ic = new InitialContext();
    So I had written a method getInitialContext() as shown in the above piece of code,
    but that too did not work.
    Eagerly awaiting a response.
    Jimmy Shah--
    Rajesh Mirchandani
    Developer Relations Engineer
    BEA Support

  • Problem using Javax.Mail API

    Hi Experts,
    I am using Javax.mail API to send an email through java application. But i am facing an issue when i am deploying the java application in SAP WAS.
    I have assigned values in SMTP Host ,Port, and InternetAddress and deployed to WAS. But when i deploy this java class again in WAS with changing the values for SMTP Host ,Port and InternetAddress and putting in Properties object ,its always picking the values set at first time.
    Can anyone tell me whats wrong with following code .
    Properties prpt = new Properties();
    if (host == null)
    host=token[0];
    prpt.put("mail.smtp.host",host);
    prpt.put("mail.smtp.sendpartial", "true");
    if (port == null)
    port=token[1];
    prpt.put("mail.smtp.port", port);
    Session session1=Session.getDefaultInstance(prpt, null);
    MimeMessage message=new MimeMessage(session1);
    message.setFrom(new InternetAddress(emailId"));
    Thanks in advance.

    Hi
    I hope follow similar answered thread  will help you.
    1. [Javamail Client Service   |Javamail Client Service;
    2.[Sending Email   |Sending Email;
    Best Regard
    Satish Kumar

  • Problems using the Java API inside a Web Service

    Hi,
    after I've built a standalone Java RMI client, using the API, I wanted to use the same code in a Web Service I've built and deployed in tomcat (jwsdp-1.3). But i ran into a few problems..
    - although I have the exact same code in both programs, the one in the web service simply blocks when I initiate the Locator class (see above...);
    - all the .jar's that I use in the client are deployed in the WEB-IF/lib of the web service directory on tomcat;
    - no exceptions are thrown in tomcat, so i don't know what's going on;
    Is there any specific configuration for the API to run on tomcat?
    Could it be that the .jar's needed by the Locator class may have some kind of conflict with the ones in tomcat?
    Thanks...
    Note: The code on the client is totaly stable and fully operational.
    The web service uses java.rmi.Remote (extends Remote).
    Here's part of the code:
    Properties env = new Properties();
    env.setProperty("orabpel.platform", "oc4j_10g");
    env.setProperty("java.naming.factory.initial","com.evermind.server.rmi.RMIInitialContextFactory");
    env.setProperty("java.naming.provider.url","ormi://dellpc05/orabpel");
    env.setProperty("java.naming.security.principal","admin");
    env.setProperty("java.naming.security.credentials","welcome");
    Locator locator = new Locator("default", "bpel", env);
    IDeliveryService deliveryService = (IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
    (...)

    I've put a
    try{Locator...}
    }catch(Throwable t) {
    System.out.println(t.getMessage());
    t.printStackTrace();
    around the Locator..
    I still don't know why it's throwing this...
    Here's what it gets:
    before Locator
    javax/jms/JMSException
    java.lang.NoClassDefFoundError: javax/jms/JMSException
         at com.evermind.server.ThreadState.getCurrentState(ThreadState.java:206)
         at com.evermind.server.rmi.RMIConnection.checkServletCaller(RMIConnection.java:3448)
         at com.evermind.server.rmi.RMIConnection.<init>(RMIConnection.java:181)
         at com.evermind.server.rmi.RMIServer.addNode(RMIServer.java:856)
         at com.evermind.server.rmi.RMIServer.getConnection(RMIServer.java:953)
         at com.evermind.server.rmi.RMIInitialContextFactory.getInitialContext(RMIInitialContextFactory.java:309)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
         at javax.naming.InitialContext.init(InitialContext.java:219)
         at javax.naming.InitialContext.<init>(InitialContext.java:195)
         at com.collaxa.cube.util.CXBeanRegistry.lookupDomainManagerBean(CXBeanRegistry.java:205)
         at com.oracle.bpel.client.auth.DomainAuthFactory.authenticate(DomainAuthFactory.java:84)
         at com.oracle.bpel.client.Locator.<init>(Locator.java:120)
         at com.oracle.bpel.client.Locator.<init>(Locator.java:91)
         at dmc.tm.resultprovider.ResultProviderImpl$ResultProviderThread.taskTimeoutExceeded(ResultProviderImpl.java:231)
         at dmc.tm.resultprovider.ResultProviderImpl$ResultProviderThread.run(ResultProviderImpl.java:160)

  • JPA Problem using alias for columns in a query

    Hello, I am having some problems with a query that I am trying to use in my JEE project. This query doesnt return an entity but a group of values. I created a class representing the result and a query with the jpa constructor expression but it is not working.
    The problem is that in the query I added some alias to the results, and when I try to run the project it says that it cannot parse the query.
    My Query:
    Query query = em.createQuery("SELECT NEW vo.VOOperacionesAgrupadas (o.nemotecnico as nemotecnico, o.esCompra as esCompra, i.equivUltimo as equivUltimo, sum(o.saldo) as saldo, sum(o.utilidad) as utilidad, sum(o.tasaCompraVenta)/count(o.nemotecnico) as promedioTasaCompra, (i.equivUltimo-sum(o.tasaCompraVenta)/count(o.nemotecnico))*100 as puntosBasicos) FROM Operaciones o, Instrumentos i WHERE o.idUsuario = :idUsuario AND o.nemotecnico = i.nemotecnico AND o.estaCerrada = 'false' Group by o.nemotecnico, o.esCompra, i.equivUltimo"); When I use that the server returns :
    Exception Description: Syntax error parsing the query [SELECT NEW vo.VOOperacionesAgrupadas (o.nemotecnico as nemotecnico, o.esCompra as esCompra, i.equivUltimo as equivUltimo, sum(o.saldo) as saldo, sum(o.utilidad) as utilidad, sum(o.tasaCompraVenta)/count(o.nemotecnico) as promedioTasaCompra, (i.equivUltimo-sum(o.tasaCompraVenta)/count(o.nemotecnico))*100 as puntosBasicos) FROM Operaciones o, Instrumentos i WHERE o.idUsuario = :idUsuario AND o.nemotecnico = i.nemotecnico AND o.estaCerrada = 'false' Group by o.nemotecnico, o.esCompra, i.equivUltimo], line 1, column 53: syntax error at [as].
    Internal Exception: MismatchedTokenException(8!=82)
    GRAVE: java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
    Exception Description: Syntax error parsing the query [SELECT NEW vo.VOOperacionesAgrupadas (o.nemotecnico as nemotecnico, o.esCompra as esCompra, i.equivUltimo as equivUltimo, sum(o.saldo) as saldo, sum(o.utilidad) as utilidad, sum(o.tasaCompraVenta)/count(o.nemotecnico) as promedioTasaCompra, (i.equivUltimo-sum(o.tasaCompraVenta)/count(o.nemotecnico))*100 as puntosBasicos) FROM Operaciones o, Instrumentos i WHERE o.idUsuario = :idUsuario AND o.nemotecnico = i.nemotecnico AND o.estaCerrada = 'false' Group by o.nemotecnico, o.esCompra, i.equivUltimo], line 1, column 53: syntax error at [as].
    Internal Exception: MismatchedTokenException(8!=82)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: Exception [EclipseLink-8024] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.JPQLException
    Exception Description: Syntax error parsing the query [SELECT NEW vo.VOOperacionesAgrupadas (o.nemotecnico as nemotecnico, o.esCompra as esCompra, i.equivUltimo as equivUltimo, sum(o.saldo) as saldo, sum(o.utilidad) as utilidad, sum(o.tasaCompraVenta)/count(o.nemotecnico) as promedioTasaCompra, (i.equivUltimo-sum(o.tasaCompraVenta)/count(o.nemotecnico))*100 as puntosBasicos) FROM Operaciones o, Instrumentos i WHERE o.idUsuario = :idUsuario AND o.nemotecnico = i.nemotecnico AND o.estaCerrada = 'false' Group by o.nemotecnico, o.esCompra, i.equivUltimo], line 1, column 53: syntax error at [as].
    Internal Exception: MismatchedTokenException(8!=82)
    at org.eclipse.persistence.exceptions.JPQLException.syntaxErrorAt(JPQLException.java:362)
    at org.eclipse.persistence.internal.jpa.parsing.jpql.JPQLParser.handleRecognitionException(JPQLParser.java:304)
    at org.eclipse.persistence.internal.jpa.parsing.jpql.JPQLParser.addError(JPQLParser.java:245)
    at org.eclipse.persistence.internal.jpa.parsing.jpql.JPQLParser.reportError(JPQLParser.java:362)
    at org.eclipse.persistence.internal.libraries.antlr.runtime.BaseRecognizer.recoverFromMismatchedElement(Unknown Source)
    at org.eclipse.persistence.internal.libraries.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(Unknown Source)
    at org.eclipse.persistence.internal.libraries.antlr.runtime.BaseRecognizer.mismatch(Unknown Source)
    at org.eclipse.persistence.internal.libraries.antlr.runtime.BaseRecognizer.match(Unknown Source)
    at org.eclipse.persistence.internal.jpa.parsing.jpql.antlr.JPQLParser.constructorExpression(JPQLParser.java:2635)
    at org.eclipse.persistence.internal.jpa.parsing.jpql.antlr.JPQLParser.selectExpression(JPQLParser.java:2045)
    at org.eclipse.persistence.internal.jpa.parsing.jpql.antlr.JPQLParser.selectItem(JPQLParser.java:1351)
    at org.eclipse.persistence.internal.jpa.parsing.jpql.antlr.JPQLParser.selectClause(JPQLParser.java:1266)
    at org.eclipse.persistence.internal.jpa.parsing.jpql.antlr.JPQLParser.selectStatement(JPQLParser.java:352)
    at org.eclipse.persistence.internal.jpa.parsing.jpql.antlr.JPQLParser.document(JPQLParser.java:276)
    at org.eclipse.persist
    GRAVE: ence.internal.jpa.parsing.jpql.JPQLParser.parse(JPQLParser.java:133)
    at org.eclipse.persistence.internal.jpa.parsing.jpql.JPQLParser.buildParseTree(JPQLParser.java:94)
    at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:198)
    at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:173)
    at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:125)
    at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:109)
    at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1326)
    ... 59 more
    Caused by: MismatchedTokenException(8!=82)
    ... 74 more
    What can I do?? I have been stuck in this problem for 2 weeks :s I have tried almost everything..
    Thanks in advance for your help!

    SELECT tmp.contract_no, tmp.Actual, tmp.Actual - tmp.NbHours
    FROM ( SELECT t.contract_no, sum(l.hrs) AS Actual, (c.labour_hours * c.labour_progress_per) / 100 AS NbHours
    FROM TASK_DELEGATION t
    INNER JOIN COST_CODE c
    ON t.cost_code = c.cost_code AND t.contract_no = c.contract_no AND t.is_inactive=0
    INNER JOIN Labour.dbo.LABOURALLOT l
    ON l.contractNo = c.contract_no AND l.costcode = c.cost_code AND l.pm = 'N'
    GROUP BY t.contract_no, c.labour_hours, c.labour_progress_per
    ) tmp

  • [Solved] Problem using kdebindings for ruby

    As a weekend project I was going to look into using ruby as language for developing KDE plasma widgets.
    I have kdebindings-ruby 4.6.0-1 along with the required kdebindings-smoke 4.6.0-1.
    When trying:
    require "plasma_applet"
    I get the error:
    LoadError: libsmokebase.so.3: cannot open shared object file: No such file or directory - /usr/lib/ruby/site_ruby/1.9.1/x86_64-linux/plasma_applet.so
    However when checking the directory
    /usr/lib/ruby/site_ruby/1.9.1/x86_64-linux/
    32K plasma_applet.so
    shows up clear as day.
    So what gives? I haved tried to find an answer here on the forums and on google but perhaps my google foo is too weak.
    Thanks
    Edit: With some more google foo I found this: https://github.com/pcapriotti/kaya/issu … ed#issue/3
    Where this statement is made:
    Kdebindings-smoke does not provide anymore libsmokebase.so.3, either in chakra-Linux or Arch Linux, was available in kde 4.5.5 but no in 4.6.0
    Does this need to be submitted as a bug?
    Last edited by ilpianista (2011-02-25 13:22:49)

    Hi, i know this is solved but i have similar problem with kdebindings-qtruby 4.7.0-1
    i start irb. and when i type require "Qt"
    irb(main):003:0> require "Qt"
    LoadError: libsmokebase.so.3: cannot open shared object file: No such file or directory - /usr/lib/ruby/site_ruby/1.9.1/x86_64-linux/qtruby4.so
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from /usr/lib/ruby/site_ruby/1.9.1/Qt.rb:1:in `<top (required)>'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from (irb):3
    from /usr/bin/irb:12:in `<main>'
    same when i try require "qtruby4" or somethink like this.
    but file /usr/lib/ruby/site_ruby/1.9.1/x86_64-linux/qtruby4.so exist

  • Problem using QuickTime for iPhone

    Hi Everybody,
    I am a developer and i program an application for the iPhone. I want to know if it is possible to block the controller in the Quicktime player for iPhone ?
    I use the embed code with the "<param name='controller' value='false'>" but the controller is always here.
    I want to stream a video, where the user can't paused the video.
    Can you help me ?
    Thanks a lot

    I had this same problem and solved it when I realized that the software upgrade download was about 600MB, but I had less free space available on the iPhone.
    So I deleted some large music files to make space available, then started the upgrade again and it worked fine.
    One caveat: since I had "Automatically fill free space with songs" checked in iTunes, under the iPhone "Music" tab, simply deleting songs from the iPhone's playlist did not clear up the space.  Other songs got loaded to fill up the space.  I had to uncheck "Automatically fill free space with songs" as well as delete songs in order to free up the space.
    Hope this helps.

  • Help...problems using java comm API

    Hi all
    im using Fedora Core and in order to list all the available serial ports for my computer i'm using the classic program TestEnumeration, but when running from jbuilder 2005 not from shell i received the following errors:
    Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path
    Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver
    Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path
    Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver
    warning: no ports found - make sure javax.comm.properties file is found
    i have followed all the instruction to install comm API but i received the same error i need help plz if someone can
    thx

    import java.io.*;
    import java.util.*;
    import javax.comm.*;
    import java.lang.*;
    import java.Buff.*;
    public class SimpleRead implements Runnable, SerialPortEventListener
         static CommPortIdentifier portId;
         static Enumeration portList;
         InputStream inputStream;
         SerialPort serialPort;
         Thread readThread;
         public static void main(String[] args)
         {//System.out.println("hello");
              portList = CommPortIdentifier.getPortIdentifiers();
              while (portList.hasMoreElements())
                   portId = (CommPortIdentifier) portList.nextElement();
                   if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL)
              if (portId.getName().equals("COM1"))
                   // if (portId.getName().equals("/dev/term/a")) {
              SimpleRead reader = new SimpleRead();
         public SimpleRead()
         try
              serialPort = (SerialPort) portId.open("SimpleReadApp", 2000);
         catch (PortInUseException e)
                                  System.out.println(e);
         try
         inputStream = serialPort.getInputStream();
         catch (IOException e)
                        System.out.println(e);
                   try
    serialPort.addEventListener(this);
                   catch (TooManyListenersException e)
                        System.out.println(e);
         serialPort.notifyOnDataAvailable(true);
         try
         serialPort.setSerialPortParams(9600,
    SerialPort.DATABITS_8,
    SerialPort.STOPBITS_1,
    SerialPort.PARITY_NONE);
              catch (UnsupportedCommOperationException e)
                        System.out.println(e);
    try {
    out = new OutputStreamWriter(serialPort.getOutputStream());
    out.write("ATQ0V1E0");
    out.flush();
    out.write("ATQ0V1E0");
    Out.close();
    //System.out.println("ATQ0V1E0");
    catch (IOException e) {}
    try {
    int line;
    int result ;
    InputStream = serialPort.getInputStream();
    int num= inputStream.available();
    InputStreamReader reader = new InputStreamReader(inputStream);
    System.out.println(reader.ready());
    while ((line = reader.read()) <= 0)
    result =reader.read();
    System.out.println("Success " + result);
    reader.close();
    catch (IOException e) {}
    readThread = new Thread(this);
    readThread.start();
    try {
    OutputStream = SerialPort.getOutputStream();
    catch (IOException e) {}
              System.out.println("ATQ0V1E0");
    public void run()
         try
    Thread.sleep(500);
    catch (InterruptedException e)
                   System.out.println(e);
    public void serialEvent(SerialPortEvent event)
    switch(event.getEventType())
    case SerialPortEvent.BI:
    case SerialPortEvent.OE:
    case SerialPortEvent.FE:
    case SerialPortEvent.PE:
    case SerialPortEvent.CD:
    case SerialPortEvent.CTS:
    case SerialPortEvent.DSR:
    case SerialPortEvent.RI:
    case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
    break;
    case SerialPortEvent.DATA_AVAILABLE:
    byte[] readBuffer = new byte[20];
    try
    while (inputStream.available() > 0)
    int numBytes = inputStream.read(readBuffer);
    System.out.print(new String(readBuffer));
    catch (IOException e)
                        System.out.println(e);
    break;
    hi friends am getting these errors
    C:\programs>javac SimpleRead.java
    SimpleRead.java:115: illegal start of expression
    public void run()
    ^
    SimpleRead.java:159: ';' expected
    ^
    2 errors
    please help me....
    its very urgent....this is the first program of mine.... am so tensed..
    i should finish this soon... please help me...
    this is my mail ID
    [email protected]

  • Same problem using tomcat for petcode app

    I'm getting frustrated. I don't think i want to use this petsotre application. i need to find something else. I got tired of using the javaserver application so i used the war in tomcat and got this problem when it tried to deploy it.
    Caused by: java.lang.IllegalArgumentException: Duplicate context initialization parameter com.sun.faces.verifyObjects
    at org.apache.catalina.core.StandardContext.addParameter(StandardContext.java:2210)
    ... 46 more
    Sep 9, 2007 8:20:23 AM org.apache.catalina.startup.ContextConfig applicationWebConfig
    SEVERE: Parse error in application web.xml file at jndi:/localhost/petstore/WEB-INF/web.xml
    java.lang.IllegalArgumentException: Duplicate context initialization parameter com.sun.faces.verifyObjects
    at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2725)
    at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2751)
    at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1060)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1772)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2923)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
    at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:351)
    at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1034)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:260)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4119)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:809)
    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:698)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
    at org.apache.catalina.core.StandardService.start(StandardService.java:450)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)

    Hi,
    the petstore needs some of the services of a Java EE 5 application server to run. It uses some technologies that are part of Java EE 5like annotations, Java Persistence Objeects, JSF 1.2 etc.
    This FAQ lists some of the things needed.
    https://blueprints.dev.java.net/petstore/faq.html#tomcat
    You would have to do some work yourself to get it to run on tomcat as there are not full instructions on how to do this.
    hth,
    Sean

  • Problems using Role for Security to business area

    I have a role set up with several users in it. User A and user B are both in this business area. When I grant access to a business area using this role, they are unable to see the business area in the user edition. If I specify User A to the business area they can see the business area. This does not seem to happen all of the time. Any solutions for this ?
    Has anyone else come across it ?
    Thanks
    Dennis

    You could try this- Tools -> Priviliges -> (Show Privilege for the ROLE not the USER), then see if "Desktop & Plus Privilege" is checked
    I was just creating/removing EUL's in my test instance and the same thing happened to me.

  • Problem using DataSource for JDBC applications

    import javax.sql.*;
    import java.sql.*;
    import java.io.*;
    import java.text.*;
    import javax.naming.*;
    public class CreateMovieTables {
         //static String driver="COM.cloudscape.core.JDBCDriver";
         //static String url="jdbc:cloudscape:";
         String leadActor,title,leadActress,type,dateOfRelease;
         Connection connection;
         Statement statement;
         DataSource dataSource;
         public void initialize() throws SQLException,NamingException{
              //Class.forName(driver);
              Context initialContext = new InitialContext();
              //connection = DriverManager.getConnection(url + "Movies;create=true");
              dataSource = (DataSource) initialContext.lookup("jdbc/Cloudscape");
              connection = dataSource.getConnection();
    the code goes on
    when i start the j2ee sdk server, the cloudscape server the message i get when i run the program is...
    No local string for datasource.wrongclient
    java.sql.SQLException:
    at com.sun.enterprise.resource.JdbcDataSource.getConnection(JdbcDataSource.java:40)
    at CreateMovieTables.initialize(CreateMovieTables.java:23)
    at CreateMovieTables.main(CreateMovieTables.java:86)
    can anyone please suggest as to where i may be going wrong
    thanx
    -NDK

    I don't agree that a User or System DSN is needed - that's a Windows idiom.
    I haven't used the J2EE SDK to set up a data source, but I know that when I do it in Tomcat I've got to put a <resource-ref> tag in the web.xml that identifies the JNDI lookup string, and then the JDBC driver/URL/username/password details under a <Resource> tag in the context.xml to tell the data source how to create the JDBC connection.
    My <resource-ref> name is "jdbc/APIPrototype". My JNDI lookup string looks like "java:comp/env/jdbc/DataSourceName".
    You've got to do more than just put the JNDI lookup string in the Context lookup. Your error message sounds like the server is saying you've haven't done that set-up work.
    Just a guess - perhaps it's something else, but I couldn't tell from your note. - MOD

  • Problem using regex for url

    Heres the problem im trying to match
    <b>Heres my text</b>
    and using this pattern
    Pattern rnpattern = Pattern.compile(".+rel-.+html.+id=.+>(.+)</a>.+");
    and I'm having to matches returned at all. Its actually pulling a full text file and running the pattern on a CharBuffer, but I dont think thats the issue. I have 2 other patterns being run the same way in the same file and theres no problem with them. I know the pattern is not optimized at all, Ive gone through about 15 different iterations of trying different combinations to try and get a match, and this is the last one I tried. the numbers in the url such as this one being 3533 change so that cant be static. And the text such as "Heres my text" changes and thats what I want to capture. If anyone could lend any assistance I would appreciate it.
    Chris N.

    http://www.foad.org/~abigail/Perl/url2.html

  • Having problems using facetime for ipods. When i sign in and click next it goes back to the sign in screen ? what do i need to do

    Having problems with facetime on the ipod. When i sign id and click next it goes back to the sign in screen. Any ideas ??

    Have ou tried here:
    iOS: Troubleshooting FaceTime
    Also try resetting the iPod. Nothing will be lost.
    Reset iPod touch:  Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.

  • Problem using BAPI for Final Invoice Tick

    Hi,
    I am using the BAPI BAPI_PO_CHANGE to set the Final invoice flag in a PO line item. But the call throws up various kinds of errors.
    Are there any mandatory parameters that I may have missed out for the updation of this particular field.
    Thanks in advance,
    Ashish

    Hi,
    As per my knowledge the following parameters are required.
    PURCHASEORDER
    POHEADER
    POHEADERX
    RETURN
    POITEM
    POITEMX
    There is very good function module documentation available for the BAPI.
    Open the function module in SE37 and click documentation.
    YOu will see example also.
    Thanks
    Ramakrishna

  • Problem using ActiveX for excel app to determine row/col no.s

    hello,
    I would like to develop an app, which would find out the total no. of rows and columns from a given excel sheet and read out the data in the same. I have made use of few vi's I found on forum, but having trouble runing them,
    can anyone please suggest me what could I be doing wrong? I have never used activex before...
    Now on LabVIEW 10.0 on Win7
    Solved!
    Go to Solution.
    Attachments:
    excel used range.vi ‏25 KB
    test.vi ‏19 KB
    read_excel_values.llb ‏382 KB

    Hi
    Yesterday I sent an email to a guy, explaining how to install it. Download the toolkit and the instructions I have attached and you should be fine.
    Regards,
    Even
    Certified LabVIEW Associate Developer
    Automated Test Developer
    Topro AS
    Norway
    Attachments:
    _Excel.zip ‏1393 KB
    Howto Install Excel Toolkit.pdf ‏1270 KB

Maybe you are looking for