Portability problem

Hi
Ive just compiled and jarred up my code on windows(2000) using jdk1.3.1 (runs fine)....
i then FTPed it to a linux machine where it complained when i went to run it....
i got a 'no such method' error....
both boxes are running the same version of the jdk
whats going on...
Thanks
Marty

i'll try to explain exactly what ive done new....
originally, id ftped the code over to the linux box on countless occasions without any trouble.....
then i wrote a public method that returns an int called getQsize() on a class....
i then call this method from another class....
I am developing on windows 2000 using JBuilder3.5
the code compiles fine, and when i jar it up and run it, it works spot on returning the correct value from the method....
but when i port this over to linux.... (the same way id done b4) when this method is called it gives me a
java.lang.NoSuchMethodError on the line that tries to call the new method.........
any ideas (please)

Similar Messages

  • Question '''OS Win2000''' using '''FireFox 5.01 - portable''' Problem: '''Plug-in for Windows-Mediaplayer doesn't work

    '''OS Win2000'''
    using '''FireFox 5.01 - portable'''
    Problem:
    '''Plug-in for Windows-Mediaplayer doesn't work '''
    cause: presumably - Win2000 only copes with WMP 9.0
    Your FF 5.01-portable works only for WMP 12 (??)
    I have no problems with WMP when I use my regular FF 3.6 on this old Win2000. - WMP - Plug-in of FF3.6 works perfectly on my Win2000
    '''question:'''
    What can I do to get WMP running on my Win2000 using FF5.01-portable ?''''''

    See the Portable Firefox support forum for help with that. <br />
    http://portableapps.com/forums/support/firefox_portable

  • Portability problem for XSL stylesheet

    Hi,
    I created a xsl stylesheet and a java program which just do the normal xml transformation. however, they works fine in my windows XP environment, but once i move them to my Red hat (linux) environment, they stop working... why this happening? from the exception error, the problem occurs when the stylesheet is loaded. some friends suggest that i should try to use different xslt processors, but how should i do this in the run time?
    (I am currently using Xerces2.6.2 to vaildate xml file and do the transformation)
    Thanks for any help

    You should look at the stacktrace from the exception and fix your problem based on what you see there.
    Or you could post it here so we don't have to guess...

  • Runtime.getRuntime().exec portability problem

    Hello everyone!
    I've got a problem with running external application (in my case it's pdfLaTeX). The code looks as follows:
    System.out.println(AppConfig.getExeFile() + " " + params); // AppConfig.getExeFile() is a static function that outputs a String object.
    Process p = Runtime.getRuntime().exec(AppConfig.getExeFile() + " " + params); // params is a String object as well.
    p.waitFor();
    // ...On Linux everything works great. System.out.println() outputs the following line:
    /opt/texlive/bin/pdflatex -halt-on-error   -output-directory /tmp   /tmp/tabular.texThe application executes successfully.
    However, I can't get my program to run on Windows. In this case, the generated command looks as follows:
    "C:\Program Files\LaTeX\MiKTeX 2.7\miktex\bin\pdflatex.exe" -halt-on-error   -output-directory C:\DOCUME~1\Roman\USTAWI~1\Temp   C:\DOCUME~1\Roman\USTAWI~1\Temp\tabular.texAfter displaying this line, my application freezes. The child process (pdflatex.exe) is frozen as well. Then I kill both processes.
    Here's the PdfLaTeX's log file after failure:
    {C:/Documents and Settings/All Users/Dane aplikacji/MiKTeX/2.7/pdftex/config/pd
    ftex.map}
    !pdfTeX error:  (file C:/Documents and Settings/All Users/Dane aplikacji/MiKTeX
    /2.7/pdftex/config/pdftex.map): fflush() failed
    ==> Fatal error occurred, no output PDF file produced!and here's how it should look like:
    {C:/Documents and Settings/All Users/Dane aplikacji/MiKTeX/2.7/pdftex/config/pd
    ftex.map}] (tabular.aux) )
    Here is how much of TeX's memory you used:
    202 strings out of 95340
    2116 string characters out of 1183965
    46926 words of memory out of 1500000
    3474 multiletter control sequences out of 110000
    3640 words of font info for 14 fonts, out of 1200000 for 2000
    14 hyphenation exceptions out of 8191
    23i,6n,17p,173b,100s stack positions out of 5000i,500n,10000p,200000b,5000s
    <C:/Program Files/LaTeX/MiKTeX 2.7/fonts/type1/bluesk
    y/cm/cmr10.pfb>
    Output written on tabular.pdf (1 page, 10003 bytes).
    PDF statistics:
    10 PDF objects out of 1000 (max. 8388607)
    0 named destinations out of 1000 (max. 131072)
    1 words of extra memory for PDF output out of 10000 (max. 10000000)I suspected that the problem was caused by presence of spaces in command (I've tried several other solutions such as putting parameters into String[] array, escaping, adding double-quotes, putting the command to the batch file), but when I run my the same command from the command line, everything works fine.
    I believe that I'm making some kind of a stupid mistake because it doesn't look like it's pdfLaTeX's fault.
    Thanks in advance for your hints. Solutions are welcome as well ;-)

    Hi,
    What is probably happening is that the process is being blocked because you are not reading the output.
    This is a common problem with exec.
    Read this article:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    HTH,
    Eugenio Alvarez

  • Commapi portability problem Linux/Windows

    I made a program that uses the serial port to send data, i included the Commapi library and it worked very well (after a long and annoying process of installation of the api).
    Now i want my program to work on windows too, so what should i do if i want my program to run on both OS?
    I added the Commapi library for windows to my program, and wrote some code lines to let my program know if he is running on xp or linux, and adjust the serial port name (tty1-> linux, COM1-> xp)
    What else should i do?
    Besides, i have a few questions, does it matter that both libraries have the same name (comm.jar) when you add them to the Netbean's library manager? do i have to include my program on the CLASSPATH when i use it for the first time on an OS?
    thanks in advance!!!

    1.) Always use / as delimiter and not \, even under
    windows.
    This is a matter of how a String handles \. It is an
    escape character.
    To use it as delimiter you must do the following
    String upImage = "C:\\Images\\books\\book11.jpg";however this is better
    String upImage = "C:/Images/books/book11.jpg";2.) Linux like all unix like systems does not know
    drive letters like c: or d: or so
    All files are relative to the root your directory
    tree (i.e. /)
    Hardcoding file and or directory names in your
    servlets makes them unportable so let it be ! Use
    parameters in your web.xml file or entries in a
    properties file instead.He wants to upload a file, however, so he should not even be attempting to read a file on the local system. He should be attempting to extract whatever file is being uploaded from the inputStream of the request object.

  • Offline Team/Number Portability

    My phone line and boardband was due to be connected on Friday 1st October, the order was placed on Tuesday 21st September and I was told the additional time required was because I was bringing the number over from Virgin Media.
    As I was told that they could be connected anytime before 20:00 for the Boardband and anytime before Midnight for the phone line so I waited until the early hours of Saturday to try the line only to find that, although I have a dialling tone, you cannot dial out and when you try and call the number, it comes up as unavailable.
    I called BT on Saturday and was told that there was a problem and that the offline team would contact me within 24/48 hours, this didn't happen.
    Since that time, I've called BT every day to be repeatedly told that it was a number portability problem and someone would call me back either within 20 minutes, 1 hour, 24 hours & 24/48 hours, I've not been called back with any resolution, only once to tell me that they needed more time and they would call me back.
    Going through the same process repeatedly with different people who seem to be totally devoid of any common sense and don't listen to you when you tell them at the start of the conversation that the problem is a number portabilty issue is becoming increasingly frustrating.
    As of this morning, I am back to waiting for the offline team to call me back within 24/48 hours but I'm not expecting a call to actually materialise.
    What I'm most confused about is that on every piece of paperwork I received prior to the installation date, it stated that the number wasn't guaranteed and if the problem is genuinely a 'number portability' issue, why not just give me a new number?
    Is it really too much to ask for someone to actually call and tell me when I'm going to be connected?
    If anyone can help or give me some suggestions as to who I can talk to get this resolved, I'd very much appreciate it.

    Bedders71 wrote:snip
    If anyone can help or give me some suggestions as to who I can talk to get this resolved, I'd very much appreciate it.
    Hi Bedders71 and welcome
    I'd be inclined to contact the forum mods to look in to what's going off.
    Send an email to [email protected] with your name, forum username, any BT account number(s) or order number(s), a contact phone number and a link to this thread. They can chase things up for you and hopefully resolve this for you.
    -+-No longer a forum member-+-

  • Impli?it import in JSP

    Hi,
              Could anybody clear the following question? Which way does jsp compiler make
              import of packages on weblogic 6.0? I looked through JSP examples and did
              not find any import declaration in some of them, but there were some classes
              that do not belong to the default import list:
              java.lang.*,
              javax.servlet.*,
              javax.servlet.jsp.* and javax.servlet.http.*,
              for example java.util.Enumeration, java.util.Date.
              Andrey
              

    Mettu Kumar <[email protected]> wrote:
              >>>Exactly. The fact that WebLogic JSP compiler imports java.util.* by default caused some
              > minor portability problems (on the other hand I believe that scriptlet tag should be
              > deprecated ;-)).
              > What portability problems did BEA importing java.util.* into generated java files caused
              > you?
              It is not a bug of anything like that - the problem was that JSP developers got used to the
              fact that java.util.* is always imported by the WebLogic JSP compiler and this created some
              very minor portability issues.
              > BTW who told you java.util.* package is imported for every jsp file unless you looked at
              > the generated java file? No one expects to you write your jsp files looking at generated
              > java code and making assumptions that are not part of JSP spec.
              > I do Agree with you completely regarding print bug.
              > Kumar.
              > Dimitri Rakitine wrote:
              >> Mettu Kumar <[email protected]> wrote:
              >> > Dimitri,
              >>
              >> > As mentioned by you as per spec they are only default packages imported. By
              >> > that spec doesn't mean jsp container can only import those packages. Every JSP
              >> > Container imports several other packages.
              >>
              >> > The only caution developers need to take is that they can assume only these
              >> > four packages are available to them.
              >>
              >> Exactly. The fact that WebLogic JSP compiler imports java.util.* by default caused
              >> some minor portability problems (on the other hand I believe that scriptlet tag
              >> should be deprecated ;-)).
              >>
              >> Minor things like this are definitely an issue when portability is important. Here is
              >> another minor example that I remember - WebLogic violates JspWriter contract
              >>
              >> ----------
              >> public abstract void print(java.lang.Object obj) throws java.io.IOException
              >> Print an object. The string produced by the String.valueOf(Object) method is translated
              >> into bytes according to the platform's default character encoding, and these bytes are
              >> written in exactly the manner of the Writer.write(int) method.
              >>
              >> public static String valueOf(Object obj)
              >> Returns the string representation of the Object argument.
              >> Parameters:
              >> obj - an Object.
              >> Returns:
              >> if the argument is null, then a string equal to "null"; otherwise, the value of
              >> obj.toString() is returned.
              >> ------------
              >>
              >> just a little: if the argument is null, in WebLogic the jsp page will display "" and
              >> "null" in all other containers.
              >>
              >> > Can you imagine how containers can provide JSP features without even import
              >> > java.io.* ?
              >>
              >> Yes - they generate java code automatically, so convinience is not important for
              >> them - they can always use fully qualified names.
              >>
              >> > Kumar.
              >>
              >> > Dimitri Rakitine wrote:
              >>
              >> >> WebLogic imports java.util.* by default - this is convinient, but
              >> >> will not work on other JSP engines (according to the spec the default imports
              >> >> are: java.lang.*, javax.servlet.*, javax.servlet.jsp.*, javax.servlet.http.*)
              >> >>
              >> >> Andrey Leskovoy <[email protected]> wrote:
              >> >> > Hi,
              >> >> > Could anybody clear the following question? Which way does jsp compiler make
              >> >> > import of packages on weblogic 6.0? I looked through JSP examples and did
              >> >> > not find any import declaration in some of them, but there were some classes
              >> >> > that do not belong to the default import list:
              >> >> > java.lang.*,
              >> >> > javax.servlet.*,
              >> >> > javax.servlet.jsp.* and javax.servlet.http.*,
              >> >>
              >> >> > for example java.util.Enumeration, java.util.Date.
              >> >>
              >> >> > Andrey
              >> >>
              >> >> --
              >> >> Dimitri
              >>
              >> --
              >> Dimitri
              Dimitri
              

  • Is it a bug in Sun's Tutorial example!!!!

    Hello everybody! I donno whether the following Tutorial example code is buggy or not but it won't run under j2sdk 1.4.2 and also under 1.5 as smoothly as Tutorial says(only the 1st line prints but not all). You can find the code:
    http://java.sun.com/docs/books/tutorial/essential/io/dataIO.html
    And the file name is:
    DataIODemo
    Does anyone know how to make it work?
    Thanks.
    --DM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    The author made a "bonehead" error - s/he hardcoded a newline character ('\n') when writing the invoice1.txt file. Since this is a UNIX/Linux character, it will not cause an error when run there - BUT - when run on an OS that doesn't use that convention - Windows, etc - it results in an incorrectly written file.
    This illustrates a code portability problem; don't hardcode!
    I leave as an exercise for the reader the correction of the format of the total dollar amount.
    A corrected copy is below. //********* preceeds changes. Compare with the original to see the differences.
    import java.io.*;
    public class DataIODemo
        public static void main(String[] args)
            throws IOException
            // write the data out
            DataOutputStream out  = new DataOutputStream(new
                FileOutputStream("invoice1.txt"));
            double[] prices       = {19.99, 9.99, 15.99, 3.99, 4.99};
            int[] units           = {12, 8, 13, 29, 50};
            String[] descs        = {"Java T-shirt",
                "Java Mug",
                "Duke Juggling Dolls",
                "Java Pin",
                "Java Key Chain"};
            char lineSep          = System.getProperty("line.separator").charAt(0);
            for (int i = 0; i < prices.length; i++)
                out.writeDouble(prices);
    out.writeChar('\t');
    out.writeInt(units[i]);
    out.writeChar('\t');
    out.writeChars(descs[i]);
    out.writeChar(lineSep);
    out.close();
    // read it in again
    DataInputStream in = new DataInputStream(new
    FileInputStream("invoice1.txt"));
    double price;
    int unit;
    StringBuffer desc;
    double total = 0.0;
    try
    while (true)
    price = in.readDouble();
    in.readChar();
    // throws out the tab
    unit = in.readInt();
    in.readChar();
    // throws out the tab
    char chr;
    desc = new StringBuffer(20);
    while ((chr = in.readChar()) != lineSep)
    desc.append(chr);
    System.out.println("You've ordered " +
    unit + " units of " +
    desc + " at $" + price);
    total = total + unit * price;
    } catch (EOFException e)
    System.out.println("For a TOTAL of: $" + total);
    in.close();

  • 32-bit C++ program call 64 bit oracle library

    Currently I had a 32-bit program written in C++, and it called some 64-bit Oracle libraries.
    Since occasionally, we found that there is some core dump error when the program executed for more than 3 hours, and our DBA highlight this finding to us.
    I would like to check if it is safe to call the 64-bit libraries in a 32-bit program.
    How can I recompile my exe to 64-bit
    Currently, the program is run on SunOS 5.8
    Thanks
    Regards,
    Eddie

    It is not possible for a 32-bit program to link to or dlopen a 64-bit library. So your 32-bit program is not calling 64-bit functions. If you somehow managed to make such a call (and I don't see how you could) the program would crash immediately.
    Maybe you mean you are opening a large file (bigger than 4GB) by means of LARGEFILE macros. The program itself is still limited to a 32-bit address space, but can read, write, and move around inside the large file.
    If your program crashes, try running dbx, pointing it to the program and the core file and see where it crashed. Or run the program under dbx.
    You can compile your program to run as a 64-bit program (automatically getting large-file support) by adding the option -xarch=v9 to every compile and link command line. All parts of the program, including all libraries you use, must also have been compiled with -xarch=v9. The compiler will automatically use the 64-bit versions of system libraries when you use -xarch=v9. If you link to 3rd-party libraries (such as Oracle), follow the vendor's instructions for 64-bit code.
    If the program was not written to be a 64-bit program, it might have hidden assumptions that prevent it from working as a 64-bit program. Typical problems are assuming that ints and longs, or ints and pointers, are the same size. For C code, you can use lint options to warn about 64-bit portability problems. For C++ code, you can use the option combination "-xarch=v9 -xport64" to get portability warnings. Refer to the C and C++ manuals for more information.
    The Solaris "file" command will tell you whether a program or library uses 32-bit or 64-bit code.
    For example:
    % file /usr/lib/libc.so.1
    /usr/lib/libc.so.1:     ELF 32-bit MSB dynamic lib SPARC Version 1, dynamically linked, not stripped
    % file /usr/lib/sparcv9/libc.so.1
    /usr/lib/sparcv9/libc.so.1:     ELF 64-bit MSB dynamic lib SPARCV9 Version 1, dynamically linked, not stripped

  • 15'' Macbook Pro Retina vs 27'' iMac for college?

    I'll be heading to college this fall, and I'm torn between getting a 15'' macbook pro (retina model) or a 27'' iMac. I've been a long time mac user and absolutely love Mac OS X, but I can't decide between having the portability of a macbook pro or the huge screen size and power of an iMac (I've been assured that the 27'' will fit in a dorm room, so that's not an issue). I'll be majoring in physics, so I'm not sure if I'll need a super-powerful computer, but it'd be nice to have one anyway.
    (A side-note to the portability problem: I was thinking of just using my current 2008 macbook as an 'in-class notebook' or just buying an ipad and a bluetooth keyboard.)
    Any suggestions would be very greatly appreciated!
    Thanks

    If you have a 2008 MBP, do use that for class and purchase the iMac.  You get a lot more performance for your money with an iMac than you will purchasing a retina.  For me, this falls in the 'no brainer' category.
    It simply comes down to how powerful you think you may need to make it.  Contact your school and get the details of what will be required and outfit the iMac accordingly.  Note that you may have to install Windows which is another plus for the iMac.
    Ciao.

  • Storing uploaded files

    I want to upload files from the client side in my application. I use IBM WebSphere Application Server 6.0. I want to know which would be the best location to store the uploaded files. If I want try use a location outside the server installation folder i get an error. I do not want to store files inside the WebSphere installation folder due to space constraints. Also I don't want to hard code the path as this also gives me portability problems. Please help me.
    Thanks in advance.

    See you have a lot of constraints.
    One you want to store the files locally in hard disk. What I mean is you are not interested to store it in Database.
    Secondly you dont wantr to hardcode the path.
    What I can recommend is a property File Key can hold the path to the File Directory location. This can be loaded static - ly, when the Application loads and then the files can be saved outside the Web Sphere Installation folder whereever you have space.
    This property file can be loosely coupled with the EAR / WAR file to facilitate modifications.
    Things to consider when you are storing files locally outside application server path:
    1. File of same name can be uploaded by different users. You need to take care of NOT overriding the files
    2. If you need to display the files on demand to the User again, you need to have a servlet to read the file back and paint the content.
    Thanks and regards,
    Pazhanikanthan. P

  • Urgent helpppp needed  - mesage driven beans

    hi there
    am a beginner at ejb...have just started yesterday....
    what i did was i read the basics of MDB and tried to run an example...but m stuck sumwhere n tried a lot but unsuccessful...
    i am using jboss to deploy...
    i am wrting a basic mdb where they have written a servlet to send message and MessageBean with the onMessage method.
    i have also written the jboss.xml, web.xml, ejb-jar.xml, jboss-web.xml descriptors.
    i am not understanding the flow on control hence maybe i am going wrong in the descriptors...
    When i run the application i get a error message of jms not bound.
    javax.naming.NameNotFoundException: jms not bound
    Servlet:
    public class MessageServlet extends GenericServlet {
    static protected final Logger log =
    Logger.getLogger(MessageServlet.class.getName());
         Queue _queue;
         ConnectionFactory _factory;
    public void init()
    throws ServletException
    super.init();
    // look up the objects.
    try {
         // "java:comp/env" :- To avoid collisions with names of other enterprise resources in the JNDI namespace, and to avoid portability problems, all names in a J2EE application should begin with the string java:comp/env.
         //Context env = (Context) new InitialContext().lookup("java:comp/env");
         Context context = (Context) new InitialContext();
         System.out.println("1");
         //_factory = (ConnectionFactory) context.lookup("java:comp/env/jms/queue-connection-factory");
         _factory = (ConnectionFactory) context.lookup("java:comp/env/QueueConnectionFactory");
         if (_factory == null)
    throw new ServletException("`java:comp/env/jms/queue-connection-factory' lookup failed");
         System.out.println("2");
         //_queue = (Queue) context.lookup("java:comp/env/jms/queue");
         _queue = (Queue) context.lookup("java:comp/env/queue");
         if (_queue == null)
    throw new ServletException("`java:comp/env/jms/queue' lookup failed");
         } catch (NamingException ex) {
    throw new ServletException(ex);
    public void service(ServletRequest request, ServletResponse response)
    throws ServletException, IOException
    int count = 5;
    try {
    Connection connection = _factory.createConnection();
    int ackMode = Session.AUTO_ACKNOWLEDGE;
    Session jmsSession = connection.createSession(false, ackMode);
    MessageProducer producer = jmsSession.createProducer(_queue);
    for (int i = 1; i <= count; i++) {
    String text = "hello, world: message #" + String.valueOf(i);
    sendMessage(jmsSession,producer,text);
    } catch (JMSException ex) {
    throw new ServletException(ex);
    PrintWriter out = response.getWriter();
    out.print("Sent " + String.valueOf(count) + " messages.");
    protected void sendMessage(Session jmsSession,
                   MessageProducer producer,
                   String text)
    throws JMSException
    // create the message
    Message message = jmsSession.createTextMessage(text);
    // send the message
    producer.send(message);
    log.info("Sent message: " + text);
    ejb-jar.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <description>assignment 3</description>
    <display-name>assignment 3</display-name>
    <enterprise-beans>
    <!-- Message Driven Beans -->
    <message-driven >
    <description>Bean to access messages</description>
    <display-name>MessageBean</display-name>
    <ejb-name>MessageBean</ejb-name>
    <ejb-class>src.MessageBean</ejb-class>
         <destination>jms/queue</destination>
    <transaction-type>Container</transaction-type>
    <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
    <message-driven-destination>
    <destination-type>javax.jms.Queue</destination-type>
    </message-driven-destination>
         <resource-ref>
              <res-ref-name>jms/queue-connection-factory</res-ref-name>
              <res-type>javax.jms.QueueConnectionFactory</res-type>
              <res-auth>Container</res-auth>
         </resource-ref>
    </message-driven>
    </enterprise-beans>
    <assembly-descriptor>
    </assembly-descriptor>
    </ejb-jar>
    jboss.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">
    <jboss>
    <enterprise-beans>
         <message-driven>
    <ejb-name>MessageBean</ejb-name>
    <destination-jndi-name>queue/ex</destination-jndi-name>
         <resource-ref>
              <res-ref-name>jms/queue-connection-factory</res-ref-name>
              <jndi-name>QueueConnectionFactory</jndi-name>
         </resource-ref>
    </message-driven>
    </enterprise-beans>
    <resource-managers>
    </resource-managers>
    </jboss>
    web.xml:
    <web-app >
    <log name="example" level="fine" path="WEB-INF/debug.log" timestamp="[%M:%S.%s] "
    format="${log.loggerName} ${log.message}"/>
    <!--
    - JMS
    -->
    <resource jndi-name="queue-connection-factory"
    type="javax.jms.ConnectionFactory"/>
    <resource jndi-name="queue/ex"
    type="javax.jms.Queue"/>
    <!--
    - EJB SERVER
    - see also message.ejb
    -->
    <ejb-server config-directory="WEB-INF">
    <jms-connection-factory>jms/queue-connection-factory</jms-connection-factory>
    </ejb-server>
    <!--
    - CLIENT
    -->
    <!-- a simple message sender servlet for demonstration purposes -->
    <servlet>
    <servlet-name>MDBServlet</servlet-name>
    <servlet-class>src.MessageServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <url-pattern>/mdb</url-pattern>
    <servlet-name>MDBServlet</servlet-name>
    </servlet-mapping>
    <welcome-file-list>
              <welcome-file>/MDBExample.html</welcome-file>
         </welcome-file-list>     
    </web-app>
    MessageBean.java
    package src;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.ejb.EJBException;
    import javax.ejb.MessageDrivenBean;
    import javax.ejb.MessageDrivenContext;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    import javax.jms.TextMessage;
    public class MessageBean implements MessageDrivenBean, MessageListener {
    static protected final Logger log =
    Logger.getLogger(MessageBean.class.getName());
    public void ejbCreate()
    throws EJBException
    log.fine("ejbCreate()");
    public void setMessageDrivenContext(MessageDrivenContext cxt)
    throws EJBException
    log.fine("setMessageDrivenContext()");
    public void onMessage(Message msg)
    // process the message
    String text = null;
    if (msg instanceof TextMessage) {
    try {
    text = ((TextMessage) msg).getText();
    } catch (Exception ex) {
    log.log(Level.WARNING,null,ex);
    else {
    text = msg.toString();
    log.fine("onMessage(): " + text);
    public void ejbRemove()
    throws EJBException
    log.fine("ejbRemove()");
    Please help me out n pardon if its a stupid mistake as m just a beginner trying to learn this on my own.
    thanx a lot
    Message was edited by:
    sonali-amonkar

    hi there
    am a beginner at ejb...have just started yesterday....
    what i did was i read the basics of MDB and tried to run an example...but m stuck sumwhere n tried a lot but unsuccessful...
    i am using jboss to deploy...
    i am wrting a basic mdb where they have written a servlet to send message and MessageBean with the onMessage method.
    i have also written the jboss.xml, web.xml, ejb-jar.xml, jboss-web.xml descriptors.
    i am not understanding the flow on control hence maybe i am going wrong in the descriptors...
    When i run the application i get a error message of jms not bound.
    javax.naming.NameNotFoundException: jms not bound
    Servlet:
    public class MessageServlet extends GenericServlet {
    static protected final Logger log =
    Logger.getLogger(MessageServlet.class.getName());
         Queue _queue;
         ConnectionFactory _factory;
    public void init()
    throws ServletException
    super.init();
    // look up the objects.
    try {
         // "java:comp/env" :- To avoid collisions with names of other enterprise resources in the JNDI namespace, and to avoid portability problems, all names in a J2EE application should begin with the string java:comp/env.
         //Context env = (Context) new InitialContext().lookup("java:comp/env");
         Context context = (Context) new InitialContext();
         System.out.println("1");
         //_factory = (ConnectionFactory) context.lookup("java:comp/env/jms/queue-connection-factory");
         _factory = (ConnectionFactory) context.lookup("java:comp/env/QueueConnectionFactory");
         if (_factory == null)
    throw new ServletException("`java:comp/env/jms/queue-connection-factory' lookup failed");
         System.out.println("2");
         //_queue = (Queue) context.lookup("java:comp/env/jms/queue");
         _queue = (Queue) context.lookup("java:comp/env/queue");
         if (_queue == null)
    throw new ServletException("`java:comp/env/jms/queue' lookup failed");
         } catch (NamingException ex) {
    throw new ServletException(ex);
    public void service(ServletRequest request, ServletResponse response)
    throws ServletException, IOException
    int count = 5;
    try {
    Connection connection = _factory.createConnection();
    int ackMode = Session.AUTO_ACKNOWLEDGE;
    Session jmsSession = connection.createSession(false, ackMode);
    MessageProducer producer = jmsSession.createProducer(_queue);
    for (int i = 1; i <= count; i++) {
    String text = "hello, world: message #" + String.valueOf(i);
    sendMessage(jmsSession,producer,text);
    } catch (JMSException ex) {
    throw new ServletException(ex);
    PrintWriter out = response.getWriter();
    out.print("Sent " + String.valueOf(count) + " messages.");
    protected void sendMessage(Session jmsSession,
                   MessageProducer producer,
                   String text)
    throws JMSException
    // create the message
    Message message = jmsSession.createTextMessage(text);
    // send the message
    producer.send(message);
    log.info("Sent message: " + text);
    ejb-jar.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <description>assignment 3</description>
    <display-name>assignment 3</display-name>
    <enterprise-beans>
    <!-- Message Driven Beans -->
    <message-driven >
    <description>Bean to access messages</description>
    <display-name>MessageBean</display-name>
    <ejb-name>MessageBean</ejb-name>
    <ejb-class>src.MessageBean</ejb-class>
         <destination>jms/queue</destination>
    <transaction-type>Container</transaction-type>
    <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
    <message-driven-destination>
    <destination-type>javax.jms.Queue</destination-type>
    </message-driven-destination>
         <resource-ref>
              <res-ref-name>jms/queue-connection-factory</res-ref-name>
              <res-type>javax.jms.QueueConnectionFactory</res-type>
              <res-auth>Container</res-auth>
         </resource-ref>
    </message-driven>
    </enterprise-beans>
    <assembly-descriptor>
    </assembly-descriptor>
    </ejb-jar>
    jboss.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">
    <jboss>
    <enterprise-beans>
         <message-driven>
    <ejb-name>MessageBean</ejb-name>
    <destination-jndi-name>queue/ex</destination-jndi-name>
         <resource-ref>
              <res-ref-name>jms/queue-connection-factory</res-ref-name>
              <jndi-name>QueueConnectionFactory</jndi-name>
         </resource-ref>
    </message-driven>
    </enterprise-beans>
    <resource-managers>
    </resource-managers>
    </jboss>
    web.xml:
    <web-app >
    <log name="example" level="fine" path="WEB-INF/debug.log" timestamp="[%M:%S.%s] "
    format="${log.loggerName} ${log.message}"/>
    <!--
    - JMS
    -->
    <resource jndi-name="queue-connection-factory"
    type="javax.jms.ConnectionFactory"/>
    <resource jndi-name="queue/ex"
    type="javax.jms.Queue"/>
    <!--
    - EJB SERVER
    - see also message.ejb
    -->
    <ejb-server config-directory="WEB-INF">
    <jms-connection-factory>jms/queue-connection-factory</jms-connection-factory>
    </ejb-server>
    <!--
    - CLIENT
    -->
    <!-- a simple message sender servlet for demonstration purposes -->
    <servlet>
    <servlet-name>MDBServlet</servlet-name>
    <servlet-class>src.MessageServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <url-pattern>/mdb</url-pattern>
    <servlet-name>MDBServlet</servlet-name>
    </servlet-mapping>
    <welcome-file-list>
              <welcome-file>/MDBExample.html</welcome-file>
         </welcome-file-list>     
    </web-app>
    MessageBean.java
    package src;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.ejb.EJBException;
    import javax.ejb.MessageDrivenBean;
    import javax.ejb.MessageDrivenContext;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    import javax.jms.TextMessage;
    public class MessageBean implements MessageDrivenBean, MessageListener {
    static protected final Logger log =
    Logger.getLogger(MessageBean.class.getName());
    public void ejbCreate()
    throws EJBException
    log.fine("ejbCreate()");
    public void setMessageDrivenContext(MessageDrivenContext cxt)
    throws EJBException
    log.fine("setMessageDrivenContext()");
    public void onMessage(Message msg)
    // process the message
    String text = null;
    if (msg instanceof TextMessage) {
    try {
    text = ((TextMessage) msg).getText();
    } catch (Exception ex) {
    log.log(Level.WARNING,null,ex);
    else {
    text = msg.toString();
    log.fine("onMessage(): " + text);
    public void ejbRemove()
    throws EJBException
    log.fine("ejbRemove()");
    Please help me out n pardon if its a stupid mistake as m just a beginner trying to learn this on my own.
    thanx a lot
    Message was edited by:
    sonali-amonkar

  • Trouble with standalone app

    I got the standalone app to work using this command:
    java -Dorg.omg.CORBA.ORBInitialHost=localhost -Dorg.omg.CORBA.ORBInitialPort=3700 -classpath .;./CartAppClient.jar;./j2ee.jar;./appserv-rt.jar; CartClient CartBean
    Which allows me to run the client and server on seperate machines. I tried to add security to some of the methods using the deploy tool and it works when I use this command:
    appclient -client CartAppClient.jar
    but when I try the first command I mentioned it only says:
    Caught an unexpected exception!
    I would like to know:
    1) if I need to configure something else such as the Sun Server or something in the depoloy tool.
    2) if I need to go in and change the source code for the application to make it work.
    3) some documentation references online which can help me make this work.
    I would really appreciate some help on this one. Thanks

    The reason is that a stand-alone java client is not a portable J2EE component, but a J2EE Application Client is. From a J2EE platform perspective, the use of Application Clients is recommended since in that case your code is running with a type of J2EE container, albeit on the client side. This allows the infrastructure to provide many of the same services that are available to other kinds of J2EE components , e.g. access to java:comp/env, security, etc.
    There is no mention of stand-alone java clients in the J2EE specs. Many J2EE implementations describe how to make such clients work, but there is no standardization to this since it's outside the scope of the specs. Some products have a way to make authentication work in stand-alone clients as well but that suffers from the same portability problem.

  • Has anyone here tried BSD?

    Hi there,
    We all know that Archlinux is BSD-like.However,has anyone here really experienced BSD,like FreeBSD,OpenBSD,NetBSD......What about that?:D

    I'm using FreeBSD on my desktop that I'm typing from right now, Arch is on the laptop.
    About a year ago, I started to get really frustrated with Linux distros -- thanks to Linux itself.  You upgrade the kernel and stuff breaks.  Kernel devs implement shiny new stuff instead of making sure that it at least works.  I thought that using some less bleeding-edge distro than Arch would make things better, but I can't stand Debian, Gentoo is broken, Ubuntu and Fedora are too overcomplicated for me.  So I switched to Windows.  I was happy for some time, but my fingers are too used to the shell, and stuff like Cygwin just doesn't cut it.  Then I found FreeBSD and been using it ever since.
    The system itself is very simple and clean.  Documentation is excellent so there's no smashing your head against the keyboard involved.  All you really get is a basic Unix system: you have a shell, an editor (vi, ed), a compiler and the base necessary tools.  You then build the rest yourself.
    Third-party software management is a bit different from Linux distros.  Linux distros are almost all about package management.  Some distros also provide shiny stuff and patches everywhere, but we're on Arch forums and we know well Arch doesn't do that: Arch merely packages stuff and makes sure the packages work well together.  Arch devs don't develop the kernel, they just package it.  They don't develop base system utilities, they just package them.  FreeBSD, on the other hand, is the kernel and the base tools.  It does provide rather simple tools for package management (pkg_add, pkg_delete), and you can optionally install the Ports Tree, which is just a system of makefiles that take care of fetching, configuring and building software for you.  Or you can install stuff yourself, though that's not recommended.  FreeBSD isn't about the software that you install or how you install it, it's about providing you with the base platform on which the software can run.
    That said, I find the Ports Tree very mature and easy to use.  You can install third party scripts that will help you with software management, like portupgrade or portmaster (the latter being my favourite).  But the system itself is very simple and thus easy to understand -- there's no magic involved.
    (Some posters before me have mentioned packages being outdated.  You probably were running a -RELEASE version, which is all fine and great, but it also means that the packages that are fetched by default are the packages that were available and built when -RELEASE was released.  You can define the environment variable PACKAGESITE to point pkg_add to newer packages.  It's all explained in the handbook -- especially the grey note may be of interest to you.)
    During my day-to-day desktop usage, I don't see any difference from my previous Arch desktop.  I have Xfce running, with Opera, Pidgin, Transmission, ePDFReader, and a bunch of terminals.  I don't like shiny stuff, I didn't have it on Arch, I don't have it here.  If you want, though, you can have it, there's no difference -- GUI software doesn't usually suffer any portability problems between Linux and FreeBSD.  If I sat you at my desktop, I think you wouldn't even tell this is not a Linux distro, until you typed "uname -a" into the terminal.
    HAL may be even more pain on FreeBSD than it is on Linux, but I hate HAL, I hated it when I was using Arch, I had it disabled back then, I have it disabled now.  I have seen people reporting they got it to work successfully on FreeBSD, though.  So if you like things like automounting, I believe you can have them.  But I'm not of the sort of people who like auto- stuff, myself.
    All in all, if you like barebones simplicity and like learning new things (it's different from Linux!), I don't see why you couldn't just give it a try.  You can install it into VirtualBox, if you don't feel like messing up your primary PC and get some feel for what the system is and is not about.

  • Applicatin development/deployent on Linux

    Is there any oracle tool (Developer/Designer) that can make
    forms and reports that can run on Linux?
    null

    I hope they will make it run in both X and Character mode.
    I think if it can work under X on Solaris, HPUX, AIX,
    Digtal/Compaq Unix it will be easy to do it under Linux.
    They just need to resolve to portability problems between
    different Unix (Linux) Systems. I think X11R6 is quite compatible
    with Solaris' libraries so there will not be any major problem.
    The biggest one will be with character-sets. Does anyone know if
    for example Linux support CL8MSWIN1251 as cyrillic characterset,
    or it only supports KOI8 and ISO8859P5 ?
    Regards,
    Misho
    Boris Biljman (guest) wrote:
    : Soon?
    : You mean in next year or two?
    : Is there any chance that this Developer will produce forrms and
    : reports for X window system, or it will be character based?
    : Michael Daskaloff (guest) wrote:
    : : Hi Boris,
    : : There will soon be Developer 6.0 for Linux.
    : : I don't know any details but It should be very good when it
    : comes
    : : out.
    : : Boris Biljman (guest) wrote:
    : : : Is there any oracle tool (Developer/Designer) that can make
    : : : forms and reports that can run on Linux?
    null

Maybe you are looking for

  • How to make the date format in ipod the same as in itunes?

    When I look at my podcasts in itunes, the dates come up as dd/mm/yyyy (which is correct), however, when I look at my podcasts on the ipod, the date comes up as mm/dd, which is very confusing. I cannot figure out how to make it so that the date format

  • Issue Running a Dashboard on iPad using Oracle BI Mobile App 11.1.1.5

    Hi All, I have an Oracle BI dashboard (11g) which I'm trying to access through an iPad. I have Oracle Business Intelligence Mobile App (version 11.1.1.5) installed on the iPad and the version of the Oracle BI EE Server is 11.1.1.6.0 Functionality of

  • WRT54GS Sends me to Germany

    Recently all 5 of my home my computers redirect MS maps.live.com to Germany (German language).  I'm in Ohio, and it always opened to the US before.  All my settings in MS are fine, and I've done all the steps they asked to check and they were fine. 

  • OLAPTIME

    Hi Gurus, I am doing performance and tuning of a production query in the production using RSRT tcode. The query contains 24 characterstics in rows and 2 key figures in columns. No user exit , no CKG, RKF. No complex calculations. This query is using

  • AL11 event to process chain

    HI masters lets suppose u get a file in al11 and on arrival of this a process chain has to be started using an event. how do u connect the file which keeps coming daily and the chain chain has to run run daily on arrival of the file automatically tha