8 Replies Latest reply on Mar 5, 2009 8:45 AM by Piergiorgio Lucidi

    Create Portlet with Eclipse and now?

    Margot Media Newbie

      Hallo,

      I create a Portlet in a Dynamic Web Project with Eclipse. If i click on "run on server", eclipse start a server and deploy my portlet. But now i will that my created portelt work on an another jboss portal on an other jboss server. How can i great a .war or .sar or .ear to switch my portlet from one server to an another server?

        • 1. Re: Create Portlet with Eclipse and now?
          Piergiorgio Lucidi Novice

          You must create a build script using Apache Ant or Apache Maven, in this way you can run the build script from any IDE (Eclipse, NetBeans, etc...).

          Your script need to create a WAR or a EAR package.

          Hope this helps.

          • 2. Re: Create Portlet with Eclipse and now?
            Gaurav Maheshwari Newbie

            Hi Piergiorgiolucidi,

            I think you can help me out. !.......I am facing the issue while running my application with Jboss in netbeans Earlier I was running my application using Tomcat server in NetBeans. If I am deploying only then it is fine but when running with jboss an error and exception occurs:

            "15:23:45,343 ERROR [Tomcat5] Problem in init
            java.util.zip.ZipException: unexpected EOF"
            at java.util.zip.ZipInputStream.read(ZipInputStream.java:166)
            at java.util.jar.JarInputStream.read(JarInputStream.java:177)
            at org.jboss.util.file.JarUtils.unjar(JarUtils.java:300)
            at org.jboss.web.AbstractWebContainer.init(AbstractWebContainer.java:325)
            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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
            .
            .
            .
            .
            .Please help me out.

            Thanks in avdance..

            • 3. Re: Create Portlet with Eclipse and now?
              Piergiorgio Lucidi Novice

              Maybe your application must be deployed when server is shutdown, I think is a big application (many resources).

              So the deployer thread start before you have copied all the files, I think you can solve trying to deploy this application restarting JBoss.

              Have you tried in this way?

              • 4. Re: Create Portlet with Eclipse and now?
                Gaurav Maheshwari Newbie

                Thank for your reply...

                I have tried to restart the jboss server but no sucess....
                I am using Jboss 4.0.4 and Netbeans 5.5.

                It is deploying the application.war file from the directory: D:\program_files\jboss\server\default\deploy

                • 5. Re: Create Portlet with Eclipse and now?
                  Gaurav Maheshwari Newbie

                  Do I need to change the PORT for Jboss ? If yes, then which port number and how can I change it?

                  Please reply!

                  • 6. Re: Create Portlet with Eclipse and now?
                    Piergiorgio Lucidi Novice

                    Have you create a build script or you are using only NetBeans to deploy in JBoss?

                    • 7. Re: Create Portlet with Eclipse and now?
                      Margot Media Newbie

                       


                      You must create a build script using Apache Ant or Apache Maven, in this way you can run the build script from any IDE (Eclipse, NetBeans, etc...).

                      Your script need to create a WAR or a EAR package.


                      Thank you for your answer. How i create a build script? What ending has the script .sh or .xml? And what has this build script into, what code? Give it a standrad code for a build script?

                      If i create a new Dynamic Web Project eclipse create me a build folder, in this build folder i should move this script?

                      • 8. Re: Create Portlet with Eclipse and now?
                        Piergiorgio Lucidi Novice

                        If you choose to use Apache Maven (I suggest this ;) ) you must add in your root project directory pom.xml file (POM). POM is a descriptor about Maven lifecyle of your application.

                        You can see all info about how to install Maven and create a pom.xml here:
                        http://maven.apache.org/


                        If you choose to use Apache Ant you must add a build.xml file. Build.xml is a procedures file about all targets to do to create your package.

                        Here you can see how to install Ant and create your own build.xml file:
                        http://ant.apache.org/