Site Status
  

jBpm.org - java Business Process Mgmt     Stats RSS


Discussion Forums: Users

Admin | Search

There are excluded messages in this forum.

By: tryhard - tryhard
how to deploy websale sample to tomcat?  
2005-06-30 18:48
hi,all 
I recently tried to deploy websale app to tomcat5.5.9,the directory of websale looks like the following: 
------------------------------------------------------------ 
css 
........ 
images 
........ 
META-INF 
........ 
WEB-INF 
--+classes 
|--+org 
|--+jbpm 
|--+websale 
|---RemindActor.class 
|---ShipItem.class 
|---UpdateBooks.class 
|---messages.properties 
|---messages_fr.properties 
--+lib 
|--+ant 
|---ant-1.6.2-stripped.jar 
|--+bsh 
|---bsh-2.0b2.jar 
|--+clover 
|---clover.jar 
|--+hibernate 
|---antlr-2.7.5H3.jar 
|---asm.jar 
|---asm-attrs.jar 
|---c3p0-0.8.5.2.jar 
|---cglib-2.1.jar 
|---commons-collections-2.1.1.jar 
|---commons-logging-1.0.4.jar 
|---dom4j-1.6.jar 
|---ehcache-1.1.jar 
|---hibernate3.jar 
|---jaxen-1.1-beta-4.jar 
|---jdbc2_0-stdext.jar 
|---jta.jar 
|--+jboss 
|---jboss-system.jar 
|---jboss-jmx.jar 
|---jboss-common.jar 
|---jboss.jar 
|---javax.servlet.jsp.jar 
|---javax.servlet.jar 
|---hsqldb.jar 
|--+junit 
|---junit-3.8.1.jar 
|--+log4j 
|---log4j-1.2.8.jar 
|--+sar 
|---jbpm-3.0.jar 
|---jbpm.sar.cfg.jar 
|---jbpm-identity-3.0.jar 
|--+xerces 
|---xercesImpl.jar 
|---xml-apis.jar 
|---commons-beanutils-1.6.1.jar 
|---commons-digester-1.5.jar 
|---jbpm-webapp-3.0.jar 
|---jstl-1.1.0.jar 
|---myfaces-1.0.9.jar 
|---myfaces-impl-1.0.9.jar 
|---myfaces-jsf-api-1.0.9.jar 
|---standard-1.1.2.jar 
|---struts-1.2.7.jar 
|---websale.par 
---faces-config.xml 
---jbpm.tld 
---tiles-defs.xml 
---web.xml 
admin.jsp 
 
but when I startup tocat,it said: 
java.lang.NoClassDefFoundError: org/apache/commons/collections/ArrayStack 
at org.apache.commons.digester.Digester.<init>(Digester.java:185) 
at org.apache.myfaces.config.impl.digester.DigesterFacesConfigUnmarshallerImpl.<init>(DigesterFacesConfigUnmarshallerImpl.java:61)  
 
how to deploy it correctly? 
any help will be highly appreciated! 
regards,tryhard


    By: tryhard - tryhard
    RE: how to deploy websale sample to tomcat?  
    2005-06-30 18:56
    the following jsps are not appeared in above post, 
    they actually absent in the root directory,they are:  
    admin.jsp 
    footer.jsp 
    gpd.xml 
    header1.jsp 
    header2.jsp 
    home.jsp 
    index.jsp 
    layout.jsp 
    login.jsp 
    monitor.jsp 
    process_definitions.jsp 
    process_instances.jsp 
    processdefinition.xml 
    processimage.jpg 
    task.jsp

    By: Ronald van Kuijk - kukeltje
    RE: how to deploy websale sample to tomcat?  
    2005-07-01 00:39
    remove the directories under WEB-INF/lib and put the jars directly in the lib dir 
     
    Ronald

    By: tryhard - tryhard
    RE: how to deploy websale sample to tomcat?  
    2005-07-01 01:42
    thanks,Ronald 
    it proved be an effect way,the problem disappeared,but I still cannot run the websale app,do I need any extra deploy? 
    regards,tryhard.

      By: Koen Aers - koentsjeProject Admin
      RE: how to deploy websale sample to tomcat?  
      2005-07-01 02:09
      What database do you use? Is it running? 
       
      Regards, 
      Koen

        By: tryhard - tryhard
        RE: how to deploy websale sample to tomcat?  
        2005-07-01 02:34
        I'm using the default built-in database hypersonic,the websale app surely works while deploying on jboss using "ant create.jbpm.configuration" through build.deploy.xml,why I failed deploy to tomcat?perhaps someone could post a build.deploy.xml on tomcat.any help will be highly appreciated! 
        regards, 
        tryhard.

          By: Koen Aers - koentsjeProject Admin
          RE: how to deploy websale sample to tomcat?  
          2005-07-01 03:01
          When using the included JBoss the hypersonic database is started automatically when you start JBoss. When using Tomcat you will have to start the database yourself. 
           
          Regards, 
          Koen

            By: Ronald van Kuijk - kukeltje
            RE: how to deploy websale sample to tomcat?  
            2005-07-01 06:18
            besides that, the deployment uses some remote (jmx?) thing from jboss. I do not know if tihs is jrs xxx compliant, but if you just build the war file, you can copy/paste it to the tomcat deploy dir and it should work 
             
            Ronald

    By: tryhard - tryhard
    RE: how to deploy websale sample to tomcat?  
    2005-07-03 03:39
    the jbpm.war lack of too many file to run the websale app on tomcat,and i don't know how to start the database by myself,if there is a build.deploy.xml on tomcat will be perfect! anyone ever deploy the websale app using hypersonic on tomcat sucessfully? really need your help! 
    regards, 
    tryhard.

    By: Medo - mabdennebi
    RE: how to deploy websale sample to tomcat?  
    2005-07-04 07:15
    Are you sure that hypersonic is built in tomcat? i don't think that! So verify that you have à Dababase runing. 
     
    Regards

    By: jasontwm - jasontwm
    RE: how to deploy websale sample to tomcat?  
    2005-08-18 16:59
    Hi guys, 
    I managed to get the sample web app working on tomcat and mysql. However, mine might not be the best solution and i would appreciate if anyone could add on to what i have posted. First off, there is a known issue with using Hibernate being bound to jndi in tomcat. Refer to 'http://www.hibernate.org/114.html'. And we would have to workaround that which is under 'Creating jbpm.war to be deployed in tomcat' later in this posting. 
     
    What i have done to setup the project is 
    1. Download jbpm-3.0.zip from http://www.jboss.com/products/jbpm/downloads 
     
    2. Unzip jbpm-3.0.zip into a 'temp' driectory 
     
    3. Using eclipse, import 'temp\jbpm-3.0' as an existing project into workspace 
     
    Configuration to connect to MySQL (Assuming you have MySQL server setup and running) 
    1. Create 'mysql' directory under 'jbpm-3.0\lib' 
     
    2. Copy mysql jdbc driver (mysql-connector-java-3.1.7-bin.jar) into 'mysql' directory 
     
    3. Login into mysql server and create database <db-name> 
     
    4. Under 'jbpm-3.0\src\resources', create 'mysql' directory 
     
    5. Copy two configuration files (create.db.hibernate.properties, identity.db.xml) from 'hsqldb' directory into 'mysql' directory 
     
    6. Edit the file 'create.db.hibernate.properties' with the following values: 
    hibernate.dialect=org.hibernate.dialect.MySQLDialect 
    hibernate.connection.driver_class=com.mysql.jdbc.Driver 
    hibernate.connection.url=jdbc:mysql://localhost:3306/<db-name
    hibernate.connection.username=<username> 
    hibernate.connection.password=<password> 
    hibernate.show_sql=true 
    hibernate.query.substitutions=true 1, false 0 
    hibernate.c3p0.min_size=1 
    hibernate.c3p0.max_size=3 
     
    7. Leave the file 'identity.db.xml' as it is 
     
    8. In 'jbpm-3.0' directory, edit the build file 'build.deploy.xml' 
    In target name="create.db", delete db.start, db.stop if your database server is running by default. 
    Replace all instance of 'hsqldb' with 'mysql' 
     
    9. To populate the database with data, go to directory 'jbpm-3.0' in command prompt and type 
    ant create.db -buildfile build.deploy.xml 
     
    Creating jbpm.war to be deployed in tomcat 
    The default war file has missing libs as pointed out by one of the user which is true, below are the steps to ensure that all the libs are created with the war file to be deployed in tomcat. 
     
    1. In eclipse, edit the build file 'build.deploy.xml' 
    Go to target name="build.webapp" 
    Under the task <copy todir="build/jbpm.war.dir/WEB-INF/lib"> 
    Replace existing line 
    <fileset dir="build" includes="jbpm-webapp-${jbpm.version}.jar" /> 
    with 
    <fileset dir="build" includes="jbpm*.jar" /> 
    Insert new lines 
    <fileset dir="lib/hibernate" includes="*.jar" /> 
    <fileset dir="lib/bsh" includes="*.jar" /> 
     
    2.As Hibernate is unable to bind its SessionFactory to JNDI in tomcat, we will have to modify the way its been created currently. Instead of looking it up using jndi, we will create an instance using the Configuration class within JbpmSessionFactory implementation. 
     
    3. Open the source file JbpmSessionFactory.java, 
    In getInstance() method, delete the lines that does the jndi lookup 
    InitialContext initialContext = new InitialContext(); 
    Object o = initialContext.lookup(jndiName); 
    Replace the existing line 
    instance = (JbpmSessionFactory) PortableRemoteObject.narrow(o, JbpmSessionFactory.class); 
    with 
    instance = (JbpmSessionFactory) PortableRemoteObject.narrow(new JbpmSessionFactory(createConfiguration()), JbpmSessionFactory.class); 
     
    4.In createConfiguration(String configResource) method, 
    Comment the block of code 
    String hibernatePropertiesResource = JbpmConfiguration.getString("jbpm.hibernate.properties"); 
    if (hibernatePropertiesResource!=null) { 
    Properties hibernateProperties = new Properties(); 
    try { 
    hibernateProperties.load( ClassLoaderUtil.getStream(hibernatePropertiesResource) ); 
    } catch (IOException e) { 
    e.printStackTrace(); 
    throw new RuntimeException("couldn't load the hibernate properties from resource '"hibernatePropertiesResource"'", e); 

    log.debug("overriding hibernate properties with "+ hibernateProperties); 
    configuration.setProperties(hibernateProperties); 

    and insert 
    configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQLDialect"); 
    configuration.setProperty("hibernate.connection.driver_class", "com.mysql.jdbc.Driver"); 
    configuration.setProperty("hibernate.connection.url", "jdbc:mysql://localhost:3306/<db-name>";); 
    configuration.setProperty("hibernate.connection.username", "<username>"); 
    configuration.setProperty("hibernate.connection.password", "<password>"); 
    configuration.setProperty("hibernate.connection.pool_size", "15"); 
     
    5. Go to directory 'jbpm-3.0' in command prompt and type 
    ant build 
    ant build.webapp -buildfile build.deploy.xml 
     
    6. Copy the generated jbpm.war from 'jbpm-3.0\build' into 'tomcat.home\webapps' 
     
    7. Start up tomcat 
     
    8. Fire up a web browser and point to 'http://localhost:8080/jbpm
     
    Hope this posting helps. I know the db connection details has been hard coded instead of reading from a properties file, but i just want to get it working at the first instance, i believed we can easily change the code to look up jndi datasource from tomcat. 
     
    Cheers 
    Jason. 


    By: Rob Gordon - suffolksoft
    RE: how to deploy websale sample to tomcat?  
    2005-09-22 09:52
     
    Thanks, Jason, for this nice post. I would not have 
    gotten anywhere with the jbpm-non-starter kit witout 
    it. 
     
    I have a bit to add that avoids the need to modify the 
    source, which, of course, is ugly because  
    you are then left with your own branch. 
     
    There are two config properties you can change that 
    affect the equivalent of steps 3 and 4. Both 
    are contained in the file: 
     
    src/resources/jbpm.sar/jbpm.properties  
     
    To affect step 3 comment out: 
     
    #jbpm.session.factory.jndi.name=java:/jbpm/JbpmSessionFactory 
     
    (It is line 8 in my file) 
     
    To affect step 4 comment out: 
     
    #jbpm.hibernate.properties=jbpm.hibernate.properties 
     
    (It is the last line). 
     
    The net of these changes is to  
    a) ignore JNDI and 
    b) use values jdbc connection properties from 
    src/config.files/hibernate.cfg.xml 
     
    The other thing I would add is that  
    jbpm.sar gets dropped into tomcat/webapps, too. 
    That is, along with jpbm.war. 
     
    Finally (and I don't understand this), I had to 
    have a copy of jbpm-webapp-3.0.1.jar in 
    tomcat/common/lib.  
     
    I should also add that I did rely on much the 
    non-starter-kits ant files to create/start db. 
    I only used the sql-generation capability of 
    the jbpm-db directory. I then manually exec'd 
    sql from within mysql interpreter. That way, 
    I didn't need to muck with those ant files.  
    I suppose if/when I move to my own production 
    build environment, I will rework them. 
     
    Good luck. And, thanks 
     
    Rob 
     
     
     
     


 

Post A Message To This Thread:

You could post if you were [logged in]


  

Find a Tech Job