6 Replies Latest reply on Jun 25, 2004 4:15 AM by sys user

    I need your help !

    sys user Master

      Someone can tell me how to upload a file and store it in the database with Nukes?
      It's very important for me !!
      Thanks a lot !

        • 1. Configuration of JMS on JBOSS
          sys user Master

          Hi,

          We are having the following error when we try to communicate to Jboss 4.0 via JNDI to create ConnectionFactory object . Here is my code. Can anybody help me out with this ?
          public SimpleSender() {

          try {

          QueueConnectionFactory myQConnFactory;
          Queue myQueue;
          Properties properties = new Properties();
          properties.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
          properties.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
          properties.put(Context.PROVIDER_URL,"jnp://localhost:1099");
          Context ctx = new InitialContext(properties);
          myQConnFactory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
          myQueue = (Queue) ctx.lookup("queue/testQueue");
          ctx.bind("SimpleSender",myQueue);
          QueueConnection con = myQConnFactory.createQueueConnection();
          QueueSession session = con.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
          TextMessage textMessage = session.createTextMessage();
          QueueSender sender = session.createSender(myQueue);
          con.start();
          for(int i=0;i<10;i++){
          textMessage.setText("Hello World " + i );
          sender.send(textMessage);
          }
          con.close();
          ctx.close();
          } catch(Exception ex) {
          ex.printStackTrace() ;
          }
          }

          The error that I am getting is as follows
          javax.naming.NameNotFoundException: ConnectionFactory not bound
          at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
          at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
          at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
          at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:529)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:508)
          at javax.naming.InitialContext.lookup(InitialContext.java:347)
          at SimpleSender.(SimpleSender.java:49)
          at SimpleSender.main(SimpleSender.java:24)




          Is there anything that I missing out.

          Jagdish

          • 2. Re: I need your help !
            Viet Master

            as a user or programatically in a module you would have developed ?

            • 3. Re: I need your help !
              sys user Master

              programatically in a module I would have developed

              • 4. Re: I need your help !
                Viet Master

                look at nukes/nukes/src/main/org/jboss/nukes/core/modules/html/plugins/FilePlugin.java

                • 5. Re: I need your help !
                  sys user Master

                  Already done.
                  But when I want to retrieve the parameter

                  UploadedFile image = page.getParameterAsFile("content");

                  image returns null and I don't understand why !!
                  If I retrieve my parameter as a string
                  String stringVal = page.getParameter("content");

                  image returns the right thing = "C:\Documents and Settings\sandra.c\Mes documents\Mes images\image.gif".

                  I despair... :-(
                  I hope you can help me.

                  • 6. Re: I need your help !
                    Viet Master

                    did your declare your form as such ?

                    <form action="index.html" method="post" enctype="multipart/form-data">
                    ...
                    <input type="hidden" name="MAX_FILE_SIZE" value="100000"/>
                    <input type="file" size="32" name="content" value=""/>
                    ...
                    </form>