Bug 778599 (SOA-1072)

Summary: jBPM examples - example.base.build.xml was removed - corresponding pom.xml file was not added - how do users build/run the examples?
Product: [JBoss] JBoss Enterprise SOA Platform 4 Reporter: Len DiMaggio <ldimaggi>
Component: JBPM - within SOAAssignee: Keith Babo <kbabo>
Status: CLOSED DEFERRED QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 4.3 GA, 4.2 CP03CC: alex.guizar, dlesage
Target Milestone: ---   
Target Release: FUTURE   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/SOA-1072
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-09-13 21:15:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
example.base.build.xml
none
pom.xml
none
soa-1072.patch none

Description Len DiMaggio 2008-12-11 15:22:28 UTC
Date of First Response: 2009-12-01 19:21:32
project_key: SOA

There's a missing end of comment tag in the file on line #29 - see attached file.

Comment 1 Len DiMaggio 2008-12-11 15:25:27 UTC
Attachment: Added: example.base.build.xml


Comment 2 Len DiMaggio 2008-12-11 15:25:47 UTC
Link: Added: This issue is related to SOA-864


Comment 3 Alejandro Guizar 2009-12-02 00:21:32 UTC
Examples are no longer built with Ant, the build file in question was removed during the migration to Maven.

Comment 4 Alejandro Guizar 2009-12-02 00:22:02 UTC
Link: Added: This issue is related to SOA-1166


Comment 5 David Le Sage 2010-02-26 03:38:48 UTC
Please review this draft text for the Resolved Issues section of the Release Notes.

https://jira.jboss.org/jira/browse/SOA-1072

    The example.base.build.xml used by jBPM examples has now been removed. It has
    previously caused some problems but is now no longer needed as examples are now being built
    with Maven rather than Ant.


Comment 6 Martin Vecera 2010-03-23 14:39:56 UTC
This release note must be fixed - there is no pom.xml that Maven could use. It seems that the examples are now prepared to be used with RHDS but this is just my guess.

Comment 7 David Le Sage 2010-03-23 23:06:31 UTC
Hello Len,

Because Release Note is erroneous (see comment above) and you reported this issue, can you please provide me with more information so that I can rewrite it?


Thanks,


David

Comment 8 Len DiMaggio 2010-03-24 15:14:34 UTC
In SOA-P 4.3 CP03, ER1 - there is neither a build.xml or pom.xml file to build/run the examples. 

Comment 10 Alejandro Guizar 2010-03-25 16:46:02 UTC
The examples shipped in the distribution are meant to be loaded into Eclipse/RHDS rather than built from the command line. In the source tree the examples are packaged and tested with maven, but the pom file is not intended for distribution to end users. I misunderstood the original issue report.

To answer the question "how do users build/run the samples?" users need Eclipse with the jBPM jPDL Tools installed. 

1. Choose New -> Other -> jBPM 3 Project. Next.
2. Set the project name of your choice.
3. Uncheck Use default location.
4. Browse, then select jbpm/examples/raise (or any other example). Next.
5. If prompted to locate a jBPM runtime, Browse, then select the jbpm directory. Set name to jBPM 3.2.9 (or the actual version). Next.
6. Uncheck Generate simple process definition. Finish.

Now, this used to work, but with the latest plugin version I always get this error: "Resource 'raise/src/main/java' already exists". So, right now, there is no way to build and run the examples :-(

I'm going to tell Koen about this problem, but apart from that, are build scripts needed for end users to build the examples from the command line?


Comment 11 Len DiMaggio 2010-03-25 17:49:31 UTC
With JBDS, I can build the "raise" example, but it fails to run with the following exception - we need the classpath, etc. settings that would have been in the build.xml files:

java.lang.NoClassDefFoundError: javax/transaction/Synchronization
	at org.hibernate.impl.SessionImpl.<init>(SessionImpl.java:213)
	at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:473)
	at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:497)
	at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:505)
	at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:110)
	at org.jbpm.JbpmContext.getSession(JbpmContext.java:532)
	at org.jbpm.db.AbstractDbTestCase.initializeMembers(AbstractDbTestCase.java:290)
	at org.jbpm.db.AbstractDbTestCase.beginSessionTransaction(AbstractDbTestCase.java:114)
	at org.jbpm.db.AbstractDbTestCase.setUp(AbstractDbTestCase.java:60)
	at org.jbpm.examples.raise.RaiseRequestTest.setUp(RaiseRequestTest.java:19)
	at junit.framework.TestCase.runBare(TestCase.java:125)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassNotFoundException: javax.transaction.Synchronization
	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
	... 23 more



Comment 14 Len DiMaggio 2010-03-26 01:18:59 UTC
pom.xml file from CP01

Comment 15 Len DiMaggio 2010-03-26 01:18:59 UTC
Attachment: Added: pom.xml


Comment 16 Alejandro Guizar 2010-03-30 07:31:27 UTC
Provided POM files to package and test the examples shipped with the distribution.

Comment 17 Koen Aers 2010-04-01 18:07:15 UTC
I don't know how Alejandro's scenario has ever worked unless the Eclipse people have changed some of the API in the meantime. I have fixed the GPD and now the scenario to create projects from the jBPM examples *should* work. Nevertheless it feels awkward to do it in such a way and it would be good if there is an import wizard to create all the examples in one go. I'll create a JIRA in JBIDE for this.

Comment 18 Koen Aers 2010-04-01 18:12:03 UTC
The patch is committed against trunk of the GPD. I'll commit it to other relevant branches if needed.

Comment 19 Koen Aers 2010-04-01 18:12:03 UTC
Attachment: Added: soa-1072.patch


Comment 20 Koen Aers 2010-04-01 18:15:20 UTC
Link: Added: This issue related JBIDE-6138


Comment 21 Len DiMaggio 2010-05-10 20:01:14 UTC
The pom.xml file has been added - but it fails to build the examples in the CR2 build.


[ldimaggi@ldimaggi examples]$ mvn install
[INFO] Scanning for projects...
Downloading: https://repository.jboss.org/nexus/content/groups/public//org/jbpm/jbpm3/jbpm/3.2.9/jbpm-3.2.9.pom
Downloading: http://repo1.maven.org/maven2/org/jbpm/jbpm3/jbpm/3.2.9/jbpm-3.2.9.pom
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: org.jbpm.jbpm3:jbpm-examples-dist:pom:null

Reason: Cannot find parent: org.jbpm.jbpm3:jbpm for project: org.jbpm.jbpm3:jbpm-examples-dist:pom:null for project org.jbpm.jbpm3:jbpm-examples-dist:pom:null


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent: org.jbpm.jbpm3:jbpm for project: org.jbpm.jbpm3:jbpm-examples-dist:pom:null for project org.jbpm.jbpm3:jbpm-examples-dist:pom:null
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:292)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:301)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find parent: org.jbpm.jbpm3:jbpm for project: org.jbpm.jbpm3:jbpm-examples-dist:pom:null for project org.jbpm.jbpm3:jbpm-examples-dist:pom:null
        at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1369)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:820)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:505)
        at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:197)
        at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:583)
        at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:461)
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:365)
        ... 11 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'org.jbpm.jbpm3:jbpm' not found in repository: Unable to download the artifact from any repository

  org.jbpm.jbpm3:jbpm:pom:3.2.9

from the specified remote repositories:
  jboss-public-repository-group (https://repository.jboss.org/nexus/content/groups/public/),
  central (http://repo1.maven.org/maven2)

 for project org.jbpm.jbpm3:jbpm
        at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:602)
        at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1365)
        ... 17 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository

  org.jbpm.jbpm3:jbpm:pom:3.2.9

from the specified remote repositories:
  jboss-public-repository-group (https://repository.jboss.org/nexus/content/groups/public/),
  central (http://repo1.maven.org/maven2)


        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:212)
        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:74)
        at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:555)
        ... 18 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
        at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:332)
        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:200)
        ... 20 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4 seconds
[INFO] Finished at: Mon May 10 15:57:14 EDT 2010
[INFO] Final Memory: 2M/41M
[INFO] ------------------------------------------------------------------------



Comment 22 Alejandro Guizar 2010-05-10 21:29:48 UTC
We have a chicken-egg problem here. Artifact org.jbpm.jbpm3:jbpm:pom:3.2.9 is not in any repository because this is the upcoming jBPM version. I can't deploy version 3.2.9 because, to my knowledge, it has not been accepted yet. We have two choices here:

1. Tag and deploy a candidate release, e.g. 3.2.9.CR1. This was done for 3.2.7 and 3.2.8
2. Employ the snapshot repository

Alternatively, run the jbpm-examples-dist build in a machine where you have installed the jbpm 3.2.9 artifacts.