Problems Starting JBoss 3.2.5 from Java API

View: New views
7 Messages — Rating Filter:   Alert me  

Problems Starting JBoss 3.2.5 from Java API

by Andrew Swan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

I’m trying to install and start JBoss 3.2.5 from Cargo 1.0 using the Java API. I’ve appended my code to the end of this message.

 

It installs OK, but when I call RunnableContainer#start, I get this error after 2 minutes (which I guess is the Cargo timeout):

 

Exception in thread "main" org.codehaus.cargo.container.ContainerException: Failed to start the JBoss 3.2.5 container.

      at org.codehaus.cargo.container.spi.AbstractLocalContainer.start(AbstractLocalContainer.java:168)

      at bis.JBossLauncher.main(JBossLauncher.java:29)

Caused by: org.codehaus.cargo.container.ContainerException: Deployable [http://localhost:8080/cargocpc/index.html] failed to finish deploying within the timeout period [120000]. The Deployable state is thus unknown.

      at org.codehaus.cargo.container.spi.deployer.DeployerWatchdog.watch(DeployerWatchdog.java:111)

      at org.codehaus.cargo.container.spi.AbstractLocalContainer.waitForCompletion(AbstractLocalContainer.java:220)

      at org.codehaus.cargo.container.spi.AbstractLocalContainer.start(AbstractLocalContainer.java:163)

      ... 1 more

org.codehaus.cargo.container.ContainerException: Deployable [http://localhost:8080/cargocpc/index.html] failed to finish deploying within the timeout period [120000]. The Deployable state is thus unknown.

      at org.codehaus.cargo.container.spi.deployer.DeployerWatchdog.watch(DeployerWatchdog.java:111)

      at org.codehaus.cargo.container.spi.AbstractLocalContainer.waitForCompletion(AbstractLocalContainer.java:220)

      at org.codehaus.cargo.container.spi.AbstractLocalContainer.start(AbstractLocalContainer.java:163)

      at bis.JBossLauncher.main(JBossLauncher.java:29)

 

I’ve tried searching this mailing list and the Cargo JIRA instance, and nothing seems relevant.

 

Thanks for any help,

 

Andrew

 

Here’s the code (requires jboss-3.2.5.zip to be in the same folder as the launcher class):

 

 

package bis;

 

import java.io.File;

import java.io.IOException;

import java.net.URL;

 

import org.codehaus.cargo.container.ContainerType;

import org.codehaus.cargo.container.InstalledLocalContainer;

import org.codehaus.cargo.container.configuration.ConfigurationType;

import org.codehaus.cargo.container.configuration.LocalConfiguration;

import org.codehaus.cargo.container.installer.Installer;

import org.codehaus.cargo.container.installer.ZipURLInstaller;

import org.codehaus.cargo.container.jboss.JBoss3xInstalledLocalContainer;

import org.codehaus.cargo.generic.DefaultContainerFactory;

import org.codehaus.cargo.generic.configuration.DefaultConfigurationFactory;

 

/**

 * Installs and starts JBoss 3.2.5

 */

public class JBossLauncher {

 

  /**

   * Main method

   */

  public static void main(final String[] args) {

    final File jbossHome = new File(installJBoss());

    final InstalledLocalContainer jboss = createContainer();

    jboss.setHome(jbossHome.getAbsolutePath());

    jboss.start();

  }

 

  /**

   * Installs JBoss 3.2.5 from the ZIP file

   *

   * @return the install path

   */

  private static String installJBoss() {

    // Unzip the JBoss distribution into Cargo's temp folder

    final Installer installer = getInstaller();

    installer.install();

    final String jbossHome = installer.getHome();

   

    // Create the "lib/endorsed" folder and put a dummy file into it to keep

    // Cargo happy (N.B. the JBoss 3.2.5 distro neither contains nor needs them)

    final File jbossLibDir = new File(jbossHome, "lib");

    final File libEndorsedDir = new File(jbossLibDir, "endorsed");

    if (!libEndorsedDir.exists()) {

      libEndorsedDir.mkdir();

    }

    // The "lib/endorsed" folder now exists

    final File dummyFile = new File(libEndorsedDir, "dummy.txt");

    if (!dummyFile.isFile()) {

      try {

        dummyFile.createNewFile();

      }

      catch (IOException e) {

        throw new RuntimeException(e);

      }

    }

    return jbossHome;

  }

 

  /**

   * Creates the Cargo installer for JBoss

   */

  private static Installer getInstaller() {

    final URL jbossURL = JBossLauncher.class.getResource("jboss-3.2.5.zip");

    if (jbossURL == null) {

      throw new IllegalStateException("Couldn't find JBoss ZIP file");

    }

    return new ZipURLInstaller(jbossURL);

  }

 

  /**

   * Creates the Cargo container for JBoss

   */

  private static InstalledLocalContainer createContainer() {

    final LocalConfiguration configuration = (LocalConfiguration)

        new DefaultConfigurationFactory().createConfiguration(

            JBoss3xInstalledLocalContainer.ID, ContainerType.INSTALLED,

            ConfigurationType.STANDALONE);

    final InstalledLocalContainer container =

        (InstalledLocalContainer) new DefaultContainerFactory().createContainer(

            JBoss3xInstalledLocalContainer.ID, ContainerType.INSTALLED,

            configuration);

    return container;

  }

}

 


Re: Problems Starting JBoss 3.2.5 from Java API

by Matt Wringe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 2009-08-25 at 15:35 +1000, Andrew Swan wrote:
> I’m trying to install and start JBoss 3.2.5 from Cargo 1.0 using the
> Java API. I’ve appended my code to the end of this message.
>
>  
>
> It installs OK, but when I call RunnableContainer#start, I get this
> error after 2 minutes (which I guess is the Cargo timeout):

the timeout failure occurs because cargo tried to deploy a specific war
to the server to check that the server is up and running (cargocpc.war
(cargo ping component)).

Is the server deploying that war? is there any errors in the server
logs?

>  
>
> Exception in thread "main"
> org.codehaus.cargo.container.ContainerException: Failed to start the
> JBoss 3.2.5 container.
>
>       at
> org.codehaus.cargo.container.spi.AbstractLocalContainer.start(AbstractLocalContainer.java:168)
>
>       at bis.JBossLauncher.main(JBossLauncher.java:29)
>
> Caused by: org.codehaus.cargo.container.ContainerException: Deployable
> [http://localhost:8080/cargocpc/index.html] failed to finish deploying
> within the timeout period [120000]. The Deployable state is thus
> unknown.
>
>       at
> org.codehaus.cargo.container.spi.deployer.DeployerWatchdog.watch(DeployerWatchdog.java:111)
>
>       at
> org.codehaus.cargo.container.spi.AbstractLocalContainer.waitForCompletion(AbstractLocalContainer.java:220)
>
>       at
> org.codehaus.cargo.container.spi.AbstractLocalContainer.start(AbstractLocalContainer.java:163)
>
>       ... 1 more
>
> org.codehaus.cargo.container.ContainerException: Deployable
> [http://localhost:8080/cargocpc/index.html] failed to finish deploying
> within the timeout period [120000]. The Deployable state is thus
> unknown.
>
>       at
> org.codehaus.cargo.container.spi.deployer.DeployerWatchdog.watch(DeployerWatchdog.java:111)
>
>       at
> org.codehaus.cargo.container.spi.AbstractLocalContainer.waitForCompletion(AbstractLocalContainer.java:220)
>
>       at
> org.codehaus.cargo.container.spi.AbstractLocalContainer.start(AbstractLocalContainer.java:163)
>
>       at bis.JBossLauncher.main(JBossLauncher.java:29)
>
>  
>
> I’ve tried searching this mailing list and the Cargo JIRA instance,
> and nothing seems relevant.
>
>  
>
> Thanks for any help,
>
>  
>
> Andrew
>
>  
>
> Here’s the code (requires jboss-3.2.5.zip to be in the same folder as
> the launcher class):
>
>  
>
>
>  
>
> package bis;
>
>  
>
> import java.io.File;
>
> importjava.io.IOException;
>
> import java.net.URL;
>
>  
>
> importorg.codehaus.cargo.container.ContainerType;
>
> importorg.codehaus.cargo.container.InstalledLocalContainer;
>
> importorg.codehaus.cargo.container.configuration.ConfigurationType;
>
> importorg.codehaus.cargo.container.configuration.LocalConfiguration;
>
> importorg.codehaus.cargo.container.installer.Installer;
>
> importorg.codehaus.cargo.container.installer.ZipURLInstaller;
>
> importorg.codehaus.cargo.container.jboss.JBoss3xInstalledLocalContainer;
>
> importorg.codehaus.cargo.generic.DefaultContainerFactory;
>
> importorg.codehaus.cargo.generic.configuration.DefaultConfigurationFactory;
>
>  
>
> /**
>
>  * Installs and starts JBoss 3.2.5
>
>  */
>
> public class JBossLauncher {
>
>  
>
>   /**
>
>    * Main method
>
>    */
>
>   public static void main(final String[] args) {
>
>     final File jbossHome = new File(installJBoss());
>
>     finalInstalledLocalContainer jboss = createContainer();
>
>     jboss.setHome(jbossHome.getAbsolutePath());
>
>     jboss.start();
>
>   }
>
>  
>
>   /**
>
>    * Installs JBoss 3.2.5 from the ZIP file
>
>    *
>
>    * @return the install path
>
>    */
>
>   private static String installJBoss() {
>
>     // Unzip the JBoss distribution into Cargo's temp folder
>
>     final Installer installer = getInstaller();
>
>     installer.install();
>
>     final String jbossHome = installer.getHome();
>
>    
>
>     // Create the "lib/endorsed" folder and put a dummy file into it
> to keep
>
>     // Cargo happy (N.B. the JBoss 3.2.5 distro neither contains nor
> needs them)
>
>     final File jbossLibDir = new File(jbossHome, "lib");
>
>     final File libEndorsedDir = new File(jbossLibDir, "endorsed");
>
>     if(!libEndorsedDir.exists()) {
>
>       libEndorsedDir.mkdir();
>
>     }
>
>     // The "lib/endorsed" folder now exists
>
>     final File dummyFile = newFile(libEndorsedDir, "dummy.txt");
>
>     if(!dummyFile.isFile()) {
>
>       try {
>
>         dummyFile.createNewFile();
>
>       }
>
>       catch (IOException e) {
>
>        throw newRuntimeException(e);
>
>       }
>
>     }
>
>     return jbossHome;
>
>   }
>
>  
>
>   /**
>
>    * Creates the Cargo installer for JBoss
>
>    */
>
>   private static Installer getInstaller() {
>
>     final URL jbossURL =
> JBossLauncher.class.getResource("jboss-3.2.5.zip");
>
>     if (jbossURL == null) {
>
>       throw newIllegalStateException("Couldn't find JBoss ZIP file");
>
>     }
>
>     return newZipURLInstaller(jbossURL);
>
>   }
>
>  
>
>   /**
>
>    * Creates the Cargo container for JBoss
>
>    */
>
>   private staticInstalledLocalContainer createContainer() {
>
>     finalLocalConfiguration configuration = (LocalConfiguration)
>
>        newDefaultConfigurationFactory().createConfiguration(
>
>             JBoss3xInstalledLocalContainer.ID,
> ContainerType.INSTALLED,
>
>             ConfigurationType.STANDALONE);
>
>     finalInstalledLocalContainer container =
>
>         (InstalledLocalContainer)
> newDefaultContainerFactory().createContainer(
>
>             JBoss3xInstalledLocalContainer.ID,
> ContainerType.INSTALLED,
>
>             configuration);
>
>     return container;
>
>   }
>
> }
>
>  
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Problems Starting JBoss 3.2.5 from Java API

by Andrew Swan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Matt,

Thanks for replying; please see my answers below.
Matt Wringe wrote:
the timeout failure occurs because cargo tried to deploy a specific war to the server to check that the server is up and running (cargocpc.war (cargo ping component)).

Is the server deploying that war?
There are no "cargo*.war" files anywhere in that JBoss installation, least of all in "server/default/deploy" where I'd expect them to be.

Matt Wringe wrote:
is there any errors in the server logs?
There are no *.log files anywhere in that JBoss installation. The "server/default/log" directory that should contain the server.log file hasn't even been created.

Any ideas? Can you replicate the problem using the code I provided (and a JBoss 3.2.5 ZIP file)?

Re: Problems Starting JBoss 3.2.5 from Java API

by Andrew Swan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've tested my code with JBoss 3.2.6 and 3.2.7, which both work fine. I've logged this bug about the problem with JBoss 3.2.5:

  http://jira.codehaus.org/browse/CARGO-728

If there's a solution, I'd be glad to hear it, as upgrading my app server from 3.2.5 to a later version would be a much bigger job than simply upgrading to a new version of Cargo.

Re: Problems Starting JBoss 3.2.5 from Java API

by Matt Wringe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

So the only error is the one about cargo not being able to deploy the
war? Whats in the server logs? Usually when it can't deploy that war,
something else is wrong with the server.

JBoss 3.2.5 is starting to get a little old, I am not sure how much
longer it will remain as an option with Cargo.

On Mon, 2009-08-31 at 23:30 -0700, Andrew Swan wrote:
> I've tested my code with JBoss 3.2.6 and 3.2.7, which both work fine. I've
> logged this bug about the problem with JBoss 3.2.5:
>
>   http://jira.codehaus.org/browse/CARGO-728
>
> If there's a solution, I'd be glad to hear it, as upgrading my app server
> from 3.2.5 to a later version would be a much bigger job than simply
> upgrading to a new version of Cargo.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Problems Starting JBoss 3.2.5 from Java API

by Andrew Swan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Matt Wringe wrote:
So the only error is the one about cargo not being able to deploy the
war?
Correct.

Matt Wringe wrote:
Whats in the server logs? Usually when it can't deploy that war,
something else is wrong with the server.
There are no log files (i.e. named *.log) anywhere in the jboss-3.2.5 folder structure that gets created. Also the "server/default/log" directory that's normally created when you start JBoss for the first time isn't there. It's as though Cargo installed JBoss OK, but never started the container.

Have you been able to replicate my problem? All you need is the code that I provided above and the JBoss 3.2.5 download (likewise available from the URL I provided above).

Re: Problems Starting JBoss 3.2.5 from Java API

by Andrew Swan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andrew Swan wrote:
the (JBoss) URL I provided above
I actually posted it in the JIRA issue, but here it is again for your convenience:

https://sourceforge.net/projects/jboss/files/JBoss/JBoss-3.2.5/jboss-3.2.5.zip/download