Hitachi Vantara Pentaho Community Wiki
Child pages
  • 05. Build the application archives
Skip to end of metadata
Go to start of metadata







pentaho.war and pentaho.ear

The pentaho_j2ee_deployments-<version>.zip will build two different kinds of archives - .war file or .ear file. The .ear file has all of the files necessary for the Pentaho platform demo and samples to run successfully in the application server. The .war file only contains the Pentaho web application, under which case there is more work for you after you deploy the Pentaho .war file. The archives will be configured to run against hsqldb (hypersonic), mysql5, postgresql 8, and/or oracle10g. To do this, we must configure a number of files with the HOST and PORT of your database, including:

  • hibernate.cfg.xml
  • *-ds.xml files (for jboss) 

The build will make these replacements based upon values that it finds in the build.properties file. Specifically, the build will be looking for the following properties:

  • hsqldb.jdbc.port
  • mysql.jdbc.port
  • hsqldb.jdbc.host
  • mysql.jdbc.host
  • postgresql.jdbc.port
  • postgresql.jdbc.host
  • oracle.jdbc.port
  • oracle.jdbc.host

Without modification, these properties are set to their defaults:

  • hsqldb.jdbc.port=9001
  • mysql.jdbc.port=3306
  • hsqldb.jdbc.host=localhost
  • mysql.jdbc.host=localhost
  • postgresql.jdbc.port=5432
  • postgresql.jdbc.host=localhost
  • oracle.jdbc.port=1521
  • oracle.jdbc.host=localhost

Here's how to do it:

1. Download and unpack the pentaho_j2ee_deployments-<version>.zip file into a working directory. For our examples here, we will use D:\work.
2. Decide which archive you want to build:

  • .war file configured for Tomcat 5.X and hsqldb
  • .war file configured for Tomcat 5.X and mysql5
  • .war file configured for Tomcat 5.X and postgresql
  • .war file configured for Tomcat 5.X and oracle10g
  • .war file configured for JBoss 4.2.1 (with jboss portal installed) and hsqldb
  • .war file configured for JBoss 4.2.1 (with jboss portal installed) and mysql
  • .war file configured for JBoss 4.2.1 (with jboss portal installed) and postgresql
  • .war file configured for JBoss 4.2.1 (with jboss portal installed) and oracle10g
  • .war file configured for JBoss 4.2.1 (without jboss portal installed) and hsqldb
  • .war file configured for JBoss 4.2.1 (without jboss portal installed) and mysql
  • .war file configured for JBoss 4.2.1 (without jboss portal installed) and postgresql
  • .war file configured for JBoss 4.2.1 (without jboss portal installed) and oracle10g
  • .ear file configured for JBoss 4.2.1 and hsqldb (with jboss portal installed)
  • .ear file configured for JBoss 4.2.1 and mysql (with jboss portal installed)
  • .ear file configured for JBoss 4.2.1 and postgresql (with jboss portal installed)
  • .ear file configured for JBoss 4.2.1 and oracle10g (with jboss portal installed)
  • .ear file configured for JBoss 4.2.1 and hsqldb (without jboss portal installed)
  • .ear file configured for JBoss 4.2.1 and mysql (without jboss portal installed)
  • .ear file configured for JBoss 4.2.1 and postgresql (without jboss portal installed)
  • .ear file configured for JBoss 4.2.1 and oracle10g (without jboss portal installed)

3. Open a terminal window (*nix) or command prompt (Windows).
4. Change directory to the work directory where you unzipped the deployment bundle.
5. Execute the Ant command that is appropriate for the archive of your choice.

The command will be:

ant <ant_target>

where <ant_target> is one of the following:

  • war-pentaho-tomcat-hsqldb
  • war-pentaho-tomcat-mysql
  • war-pentaho-tomcat-postgresql
  • war-pentaho-tomcat-oracle10g
  • war-pentaho-jboss-hsqldb - for use with a jboss server that has jboss portal installed
  • war-pentaho-jboss-hsqldb-no-portal - for use with a jboss servet that does not have jboss portal installed
  • war-pentaho-jboss-mysql - for use with a jboss server that has jboss portal installed
  • war-pentaho-jboss-mysql-no-portal - for use with a jboss servet that does not have jboss portal installed
  • war-pentaho-jboss-postgresql - for use with a jboss server that has jboss portal installed
  • war-pentaho-jboss-postgresql-no-portal - for use with a jboss servet that does not have jboss portal installed
  • war-pentaho-jboss-oracle10g - for use with a jboss server that has jboss portal installed
  • war-pentaho-jboss-oracle10g-no-portal - for use with a jboss servet that does not have jboss portal installed
  • ear-pentaho-jboss-hsqldb - for use with a jboss server that has jboss portal installed
  • ear-pentaho-jboss-hsqldb-no-portal - for use with a jboss servet that does not have jboss portal installed
  • ear-pentaho-jboss-mysql - for use with a jboss server that has jboss portal installed
  • ear-pentaho-jboss-mysql-no-portal - for use with a jboss servet that does not have jboss portal installed
  • ear-pentaho-jboss-postgresql - for use with a jboss server that has jboss portal installed
  • ear-pentaho-jboss-postgresql-no-portal - for use with a jboss servet that does not have jboss portal installed
  • ear-pentaho-jboss-oracle10g - for use with a jboss server that has jboss portal installed
  • ear-pentaho-jboss-oracle10g-no-portal - for use with a jboss servet that does not have jboss portal installed


So, for example, if you wanted to build a .war file for Tomcat on Windows, the command would look similar to this:

D:\work> ant war-pentaho-tomcat-hsqldb

Wait for the build script to finish. The resulting .ear or .war file can be found under the /build/pentaho-wars/<appserver> subdirectory, which is created in your work directory.

pentaho-style.war and sw-style.war

If you are deploying the platform as a .war file, you may be missing some other key components - the pentaho-style.war, the steel-wheels-style.war, and the pentaho-portal-layout.war. For the sake of easy and maintainable style customization, we have moved the content styling for the platform into the separate styles web application.

No need to worry about this if you built and deployed an .ear file - the .ear package includes all extra web resources that the platform needs.

So all you need to do here is simply deploy the pentaho-style.war, the steel-wheels-style.war, and the pentaho-portal-layout.war. into the same application server along side the platform.

Execute the following command:

ant zip-pentaho-style-war

And when that's finished, execute the following command:

ant zip-pentaho-steel-wheels-style-war

And when that's finished, execute the following command:

ant zip-pentaho-portal-layout-war

You can find all of the wars/ears in the following path, /work/build/pentaho-wars

Now that you have built the appropriate archive for your application server, you can deploy the platform. Deployment procedures are going to be specific to the application server that you use, which we assume you are already familiar.

Remember

If you have any problems getting the platform deployed, post your dilemma in our discussion forum at http://forums.pentaho.org and chances are someone has found a solution or can help find one. Post your successes too, and how you managed it!


You can build everything at once and just use what you need. To do this just run:

ant build-all








  • No labels

13 Comments

  1. Anonymous

    I have downloaded the Pentaho GA 1.2.0.534 and attempted to build the pentaho_j2ee_deployments-1.5.3.660-0 as ear deployment package with a target of *"ear-pentaho-jboss-mysql-no-portal"* which has failed. The intersting thing is I was

    trying to build ear package but it is buiding war package. 

     pentaho_j2ee_deployments-1.5.3.660-0>ant ear-pentaho-jboss-mysql-no-portal
    Buildfile: build.xml

    init:
        [mkdir] Created dir:/tmp/pentaho_j2ee_deployments-1.5.3.660-0/build/pentaho-wars

    init-pentaho-jboss-ears:
        [mkdir] Created dir: /download/tmp/pentaho_j2ee_deployments-1.5.3.660-0/build/pentaho-ears

    zip-pentaho-style-war:
          [zip] Building zip: /download/tmp/pentaho_j2ee_deployments-1.5.3.660-0/build/pentaho-wars/pentaho-style.war

    zip-pentaho-steel-wheels-style-war:
          [zip] Building zip: /download/tmp/pentaho_j2ee_deployments-1.5.3.660-0/build/pentaho-wars/sw-style.war

    zip-pentaho-portal-layout-war:
          [zip] Building zip: /tmp/pentaho_j2ee_deployments-1.5.3.660-0/build/pentaho-wars/pentaho-portal-layout.war

    init-pentaho-jboss-wars:

    war-pentaho-jboss-mysql-for-ear:

    war-pentaho-jboss-for-ear:

    BUILD FAILED
    /tmp/pentaho_j2ee_deployments-1.5.3.660-0/build.xml:210: The following error occurred while executing this line:
    /tmp/pentaho_j2ee_deployments-1.5.3.660-0/build.xml:374: Warning: Could not find file /tmp/pentaho_j2ee_deployments-1.5.3.660-0/build/pentaho-wars/jboss/MANIFEST.MF to copy.

  2. Anonymous

    I suggest to use the target: build-all and select what you want since the target builds all with no problem.

  3. user-eed46

    Deployment procedures are going to be specific to the application server that you use, which we assume you are already familiar.

    If you are providing these instructions on the next page, say it.

  4. user-c4e92

    could generic instructions be added here on adding support for a new DB to the solution repository? e.g. oracle or sqlserver support?

  5. user-d22f7

    There are links at both the top and bottom of page content that say "Deploy the application archives -->". I thought that was pretty clear.

  6. user-d0c7e

    Hi

    i've got an error after deploying the jboss/hsqldb/noportal/pentaho.ear to jboss-421/server/deploy directory:

    17:47:06,549 INFO [EARDeployer] Init J2EE application: file :/D:/develop/jboss-421/server/default/deploy/pentaho.ear
    17:47:17,486 ERROR [MainDeployer] Could not initialise deployment: file :/D:/develop/jboss-421/server/default/deploy/pentaho.ear
    org.jboss.deployment.DeploymentException: Failed to find module file: lib/antlr.license.txt

    I had to remove the directory pentaho_j2ee_deployments\pentaho-third-party\licenses before building the ear.

  7. Anonymous

    Thanks for the comment Al,

    We have reposted the 1.6.0.GA j2ee deployments package as pentaho_j2ee_deployments-1.6.0.GA.863-a.zip. This removes the licenses directory and adds some class loading fixes to the archives.

    - Brian 

  8. user-33506

    hi

    i've got a warning after deploying jboss/no-portal/mysql5/pentaho.ear

    11:55:35,279 WARN [DeploymentInfo] Only the root deployment can set the loader repository, ignoring config=LoaderRepositoryConfig(repositoryName: com.pentaho:loader=pentaho.war, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser, repositoryConfig: java2ParentDelegation=false)

    followed by a bunch of other stuff

    11:55:35,919 INFO [BeanShellSubDeployer] javax.management.InstanceNotFoundException: jboss.scripts:url=file%3a/usr/local/pentaho/jboss/server/default/tmp/deploy/tmp11
    248pentaho.ear-contents/lib/bsh-1.3.0.jar-contents/bsh/commands/addClassPath.bsh,type=BeanShell is not registered.
    11:55:36,327 INFO [BeanShellSubDeployer] javax.management.InstanceNotFoundException: jboss.scripts:url=file%3a/usr/local/pentaho/jboss/server/default/tmp/deploy/tmp11
    248pentaho.ear-contents/lib/bsh-1.3.0.jar-contents/bsh/commands/bg.bsh,type=BeanShell is not registered.
    11:55:36,354 INFO [BeanShellSubDeployer] javax.management.InstanceNotFoundException: jboss.scripts:url=file%3a/usr/local/pentaho/jboss/server/default/tmp/deploy/tmp11
    248pentaho.ear-contents/lib/bsh-1.3.0.jar-contents/bsh/commands/bind.bsh,type=BeanShell is not registered.
    11:55:36,368 INFO [BeanShellSubDeployer] javax.management.InstanceNotFoundException: jboss.scripts:url=file%3a/usr/local/pentaho/jboss/server/default/tmp/deploy/tmp11
    248pentaho.ear-contents/lib/bsh-1.3.0.jar-contents/bsh/commands/browseClass.bsh,type=BeanShell is not registered.
    11:55:36,420 INFO [BeanShellSubDeployer] javax.management.InstanceNotFoundException: jboss.scripts:url=file%3a/usr/local/pentaho/jboss/server/default/tmp/deploy/tmp11
    248pentaho.ear-contents/lib/bsh-1.3.0.jar-contents/bsh/commands/cat.bsh,type=BeanShell is not registered.
    ...and so on

    and finally this is what i get

    15:29:49,796 FATAL [DriverManagerConnectionProvider] JDBC Driver class not found: com.mysql.jdbc.Driver
    java.lang.ClassNotFoundException: No ClassLoaders found for: com.mysql.jdbc.Driver

    any suggestions

  9. user-d22f7

    Mathhew,

    You need to add the mysql driver to your jboss installation.

    Add it to jboss/server/default/lib. 

  10. Anonymous

    war-pentaho-tomcat-oracle10g  doesnt seems to be a build option anymore.

  11. user-4ad98

    I ran ear-pentaho-jboss-hsqldb-no-portal and got the following error:

    C:\temp\pentaho\pentaho_j2ee_deployments>ant ear-pentaho-jboss-hsqldb-no-portal

    Buildfile: build.xml

    init:
        [mkdir] Created dir: C:\temp\pentaho\pentaho_j2ee_deployments\build\pentaho-
    wars

    init-pentaho-ears:
        [mkdir] Created dir: C:\temp\pentaho\pentaho_j2ee_deployments\build\pentaho-
    ears

    BUILD FAILED
    C:\temp\pentaho\pentaho_j2ee_deployments\build.xml:287: Warning: Could not find
    file C:\temp\pentaho\pentaho_j2ee_deployments\build\pentaho-res\ear\application.
    xml to copy.

    I took a look at this target and it depends on init, init-pentaho-ears, etc... the problem is that the build.res.dir/ear/application.xml does not exist because the init-pentaho-ears target has not copied one from the server.resource.dir.  I added these lines to init-pentaho-ears target in order to create a /build/pentaho-res/ear/application.xml file.

    <mkdir dir="${build.res.dir}" />
    <copy todir="${build.res.dir}" overwrite="true">
    &nbsp;&nbsp;&nbsp;&nbsp; <fileset dir="${server.resource.dir}/ear" />
    </copy>
    

    The build/ear/application.xml file eventually gets overwritten during the war-pentaho-jboss-hsqldb-for-ear-no-portal target which has the init-pentaho-wars as a dependency and copies the entire contents of the server.resource.dir.  I was worried about it overwriting something important but it looks like the build/pentaho-res/ear/application.xml is just staged here and the replacements are done under the /build/appserver/rdbms/application.xml. 
    Did this happen to anyone else because it looks like all the ear-pentaho targets depend on init-pentaho-ears?

  12. Anonymous

    Had the same issue with ear-pentaho-jboss-hsqldb-no-portal:

    BUILD FAILED
    C:\temp\pentaho\pentaho_j2ee_deployments\build.xml:287: Warning: Could not find
    file C:\temp\pentaho\pentaho_j2ee_deployments\build\pentaho-res\ear\application.
    xml to copy.

    Used the same solution except had to change the destination directory of the copy to include the ear directory:

    <mkdir dir="${build.res.dir}/ear" />
    <copy todir="${build.res.dir}/ear" overwrite="true">
        <fileset dir="${server.resource.dir}/ear" />
    </copy>
    


  13. user-2d378

    I followed all the steps which you given below
    01. Before you begin
    02. Download the J2EE Deployment Distribution
    03. Configure the Sample Data
    04. Configure the Solutions
    05. Build the application archives
    but when I am deploying the *.war or *.ear file on JBoss application Server I am getting the following error

    Failed to create Resource pentaho.ear - cause: java.lang.RuntimeException:org.jboss.deployers.spi.DeploymentException: Exception determining structure: AbstractVFSDeployment(pentaho.ear) -> org.jboss.deployers.spi.DeploymentException:Exception determining structure: AbstractVFSDeployment(pentaho.ear) -> java.lang.RuntimeException:Error determining structure: pentaho.ear -> java.lang.RuntimeException:lib/antlr.license.txt module listed in application.xml is not a recognized deployment, .ear: pentaho.ear

    Can you please anyone help me in this.. and If any one installed BreadboardBI with Pentaho Please give me some ideas on installation..

    Your help is highly appreciable.