[jBPM] - jbpm4.4 failed to send email
by wiwengweng wen
wiwengweng wen [http://community.jboss.org/people/wiwengweng] created the discussion
"jbpm4.4 failed to send email"
To view the discussion, visit: http://community.jboss.org/message/634225#634225
--------------------------------------------------------------
when I config the jbpm4.4 to send email. I wonder if there is a tuitor that can help me out first, then I don't have to bother all you guys. I config the jbpm.mail.cfg.xml file and the default.cfg.xml as follows:
*******************************************************
mail.cfg.xml
mail.smtp.host=smtp.163.com
mail.smtp.port=25
mailto:mail.from=ylyy-1985@163.com mail.from=ylyy-1985(a)163.com
mail.smtp.auth=true
********************************************************
default.cfg.xml:::
<?xml version="1.0" encoding="UTF-8"?>
<jbpm-configuration>
<import resource="jbpm.default.scriptmanager.xml" />
<import resource="jbpm.mail.templates.xml" />
<process-engine-context>
<repository-service />
<repository-cache />
<execution-service />
<history-service />
<management-service />
<identity-service />
<task-service />
<object class="org.jbpm.pvm.internal.id.DatabaseDbidGenerator">
<field name="commandService"><ref object="newTxRequiredCommandService" /></field>
</object>
<object class="org.jbpm.pvm.internal.id.DatabaseIdComposer" init="eager" />
<object class="org.jbpm.pvm.internal.el.JbpmElFactoryImpl" />
<types resource="jbpm.variable.types.xml" />
<address-resolver />
</process-engine-context>
<transaction-context>
<repository-session />
<db-session />
<message-session />
<timer-session />
<history-sessions>
<object class="org.jbpm.pvm.internal.history.HistorySessionImpl" />
</history-sessions>
<mail-session>
<mail-server>
<session-properties resource= "jbpm.mail.properties" />
<authenticator class= "org.jbpm.test.wyl.MyAuthen" >
<field name= "userName" ><string value= "ylyy" /></field>
<field name= "passWord" ><string value= (my password of the mailbox )/></field>
</authenticator>
</mail-server>
</mail-session>
</transaction-context>
</jbpm-configuration>
******************************************************
then I meet this problem.in fact, I don't know what is the authentication, and how to do that . but just follow a example to do this.
### EXCEPTION ###########################################
18:13:50,093 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd@6cef4
org.jbpm.api.JbpmException: could not send email: javax.mail.internet.MimeMessage@11b86c7
at org.jbpm.pvm.internal.email.impl.MailSessionImpl.send(MailSessionImpl.java:60)
at org.jbpm.test.wyl.TestMail2.main(TestMail2.java:32)
Caused by: com.sun.mail.smtp.SMTPSendFailedException: 553 You are not authorized to send mail, authentication is required
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1515)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1054)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:634)
at org.jbpm.pvm.internal.email.impl.MailSessionImpl.send(MailSessionImpl.java:51)
... 16 more
### EXCEPTION ###########################################
18:13:50,093 FIN | [HibernateSessionResource] ----- rolling back hibernate tx 16586768 -----------------------------------------------------
Exception in thread "main" org.jbpm.api.JbpmException: could not send email: javax.mail.internet.MimeMessage@11b86c7
at org.jbpm.pvm.internal.email.impl.MailSessionImpl.send(MailSessionImpl.java:60)
Caused by: com.sun.mail.smtp.SMTPSendFailedException: 553 You are not authorized to send mail, authentication is required
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1515)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1054)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:634)
at org.jbpm.pvm.internal.email.impl.MailSessionImpl.send(MailSessionImpl.java:51)
... 16 more
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/634225#634225]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years
[jBPM] - Database reconnect failed for JBoss/JBPM
by Georg Waldschmidt
Georg Waldschmidt [http://community.jboss.org/people/waldsgbq] created the discussion
"Database reconnect failed for JBoss/JBPM"
To view the discussion, visit: http://community.jboss.org/message/635439#635439
--------------------------------------------------------------
We are using JBoss-5.1.0.GA, JBPM 4.4 and Oracle 11g.
When we try to test the database reconnect abilities (by disconnecting the network connection between JBoss and the Oracle server),
After reestablishing the network connection, JBPM doesn't reconnect properly. Starting a new business process instance ends in an exception:
2011-11-07 17:34:34,041 ERROR [pool-24-thread-2] (Log4jLog.java:42) failed to execute job: 10500
org.jbpm.api.JbpmException: invalid transaction state: STATUS_ROLLING_BACK
at org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:59)
at org.jbpm.pvm.internal.tx.JtaRetryInterceptor.executeWithoutRetry(JtaRetryInterceptor.java:56)
at org.jbpm.pvm.internal.tx.JtaRetryInterceptor.execute(JtaRetryInterceptor.java:48)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Has anyone any idea on how to ensure that JBPM's job executor proceeds processing new jobs (and ideally
jobs that got interrupted) after a database connection interrupt?
We would expect, that JBoss's managed connection pool takes care of connections affected by the interrupt.
Here the listing of datasource (jbpm-oracle-ds.xml)
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- ===================================================================== -->
<!-- $Id: jbpm-oracle-ds.xml 4458 2009-04-06 14:36:41Z mailto:heiko.braun@jboss.com heiko.braun(a)jboss.com $ -->
<!-- ===================================================================== -->
<!-- ATTENTION: DO NOT FORGET TO SET Pad=true IN transaction-service.xml -->
<!-- ===================================================================== -->
<datasources>
<xa-datasource>
<jndi-name>JbpmDS</jndi-name>
<track-connection-by-tx></track-connection-by-tx>
<check-valid-connection-sql>select count(*) from dual</check-valid-connection-sql>
<!-- uncomment to enable interleaving <interleaving/> -->
<isSameRM-override-value>false</isSameRM-override-value>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:oracle:thin:@127.0.0.1:1521:JBPMDB</xa-datasource-property>
<xa-datasource-property name="User">USER</xa-datasource-property>
<xa-datasource-property name="Password">PASSWORD</xa-datasource-property>
<!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
<!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
<!-- Checks the Oracle error codes and messages for fatal errors -->
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
<no-tx-separate-pools/>
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<metadata>
<type-mapping>Oracle9i</type-mapping>
</metadata>
</xa-datasource>
<mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter"
name="jboss.jca:service=OracleXAExceptionFormatter">
<depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
</mbean>
</datasources>
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/635439#635439]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years
[JBoss Web Services] - SPI Module Mismatch/Conflict with JBossWS Native 4.0.0BetaX on AS 7.0.2.Final
by Ken Bartholet
Ken Bartholet [http://community.jboss.org/people/kjbartholet] created the discussion
"SPI Module Mismatch/Conflict with JBossWS Native 4.0.0BetaX on AS 7.0.2.Final"
To view the discussion, visit: http://community.jboss.org/message/635380#635380
--------------------------------------------------------------
I'm testing an upgrade of JBoss Containers from 4.2.3 to 7.0.2. For various reasons, I'd like to continue using the Native JBossWS stack.
I've downloaded jbossws-native-4.0.0.Beta1 from the SVN repository tag folder. After building the binary distribution and installing into JBoss 7.0.2.final, the container startup throws as java.lang.NoSuchMethodError with the following stacktrace. There appears to be a conflict/mismatch with the jbossws-spi.jar module in 4.0.0.Beta1 (version 2.0.0.Beta1)
{noformat}
11:15:29,691 INFO [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-2) JBoss Web Services - Native Server 4.0.0.Beta1
11:15:29,113 ERROR [org.jboss.as.controller] (Controller Boot Thread) Operation ("add") failed - address: ([
("subsystem" => "webservices"),
("endpoint-config" => "Standard-Endpoint-Config")
]): java.lang.NoSuchMethodError: org.jboss.wsf.spi.management.ServerConfig.addEndpointConfig(Lorg/jboss/wsf/spi/metadata/config/EndpointConfig;)V
at org.jboss.as.webservices.dmr.EndpointConfigAdd.performRuntime(EndpointConfigAdd.java:109)
at org.jboss.as.controller.AbstractAddStepHandler$1.execute(AbstractAddStepHandler.java:50) [jboss-as-controller-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.as.controller.OperationContextImpl.executeStep(OperationContextImpl.java:353) [jboss-as-controller-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.as.controller.OperationContextImpl.doCompleteStep(OperationContextImpl.java:298) [jboss-as-controller-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.as.controller.OperationContextImpl.completeStep(OperationContextImpl.java:223) [jboss-as-controller-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.as.controller.AbstractAddStepHandler$1.execute(AbstractAddStepHandler.java:56) [jboss-as-controller-7.0.2.Final.jar:7.0.2.Final]
{noformat}
I then tried the same with both jbossws-native-4.0.0.Beta2 & Beta3 tags. In both cases, after installing the stack, the console fails to deploy with a NoClassDefFoundError. There appears to be yet another conflict/mismatch with the jbossws-spi.jar module. There exists a reference to the DeploymentType inner class, even though that class has been refactored to a standalone java class in the spi library/module referenced in these 2 stack versions.
{noformat}
11:39:21,400 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start service jboss.deployment.unit."jbossws-console.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."jbossws-console.war".INSTALL: Failed to process phase INSTALL of deployment "jbossws-console.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_24]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_24]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]
Caused by: java.lang.NoClassDefFoundError: org/jboss/wsf/spi/deployment/Deployment$DeploymentType
at org.jboss.as.webservices.util.WSAttachmentKeys.<clinit>(WSAttachmentKeys.java:42)
at org.jboss.as.webservices.deployers.WSTypeDeploymentProcessor.isJaxwsJseDeployment(WSTypeDeploymentProcessor.java:112)
at org.jboss.as.webservices.deployers.WSTypeDeploymentProcessor.deploy(WSTypeDeploymentProcessor.java:44)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
... 5 more
Caused by: java.lang.ClassNotFoundException: org.jboss.wsf.spi.deployment.Deployment$DeploymentType from [Module "org.jboss.as.webservices:main" from local module loader @192a848 (roots: C:\jboss-as-7.0.2.Final\modules)]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191) [jboss-modules.jar:1.0.2.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361) [jboss-modules.jar:1.0.2.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333) [jboss-modules.jar:1.0.2.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310) [jboss-modules.jar:1.0.2.GA]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103) [jboss-modules.jar:1.0.2.GA]
... 9 more
{noformat}
Am I missing a step, or is the native stack simply not ready for JBoss AS 7?
Any help would be appreciated.
Thanks.
-Ken
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/635380#635380]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years
[JBoss Tools] - Creating Project Examples
by Snjezana Peco
Snjezana Peco [http://community.jboss.org/people/snjeza] modified the document:
"Creating Project Examples"
To view the document, visit: http://community.jboss.org/docs/DOC-16578
--------------------------------------------------------------
Project examples are created using a project examples xml file added to a project examples site.
Defining project examples sites is described on http://community.jboss.org/docs/DOC-14955 Project Examples Sites.
The following is a definition of a project example within some site:
<?xml version="1.0" encoding="UTF-8"?>
<projects
<project>
...
</project>
</projects>
h4. Simple Project Example
A definition of a simple project example:
<project>
<category>Seam</category>
<name>registration</name>
<included-projects>registration, registration-ejb ...</included-projects>
<shortDescription>Seam Registration Example</shortDescription>
<description>This is a trivial example for the Seam tutorial. ...</description>
<size>31657984</size>
<url> http://...registration.zip http://...registration.zip</url>
</project>
Below is a description of the basic elements:
* *category* - the category to which the project example belongs
* *name* - the project example name - it is used internally and isn't shown to the user
* *included-projects* - the projects included in the project example. The Project Example engine will import only those projects included within this element.
* *shortDescription* - the short description (it is recommended to be a few words)
* *description* - the complete description of the project example (a few lines recommended)
* *size* - the archive size in bytes. This is an informative and optional element
* *url* - the URL which the zip archive is placed on; can be local or remote; optional
These are the minimal elements necessary to create a project example.
In this example, the url has to point to the zip archive containing one or more Eclipse projects.
The category, name, shortDescription, description, size and url are shown in the project example wizard.
http://community.jboss.org/servlet/JiveServlet/showImage/14212/ProjectExa... http://community.jboss.org/servlet/JiveServlet/downloadImage/14212/Projec...
h4. Fixes/Requirements
The developer can define requirements that need to be satisfied in order the project example to work correctly. The Project Example engine will warn the user if the requirements aren't satisfied (see the figure) and fix some possible issues when the project example is imported.
http://community.jboss.org/servlet/JiveServlet/showImage/102-14955-9-2270... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14955-9-...
http://community.jboss.org/servlet/JiveServlet/showImage/102-14955-9-2274... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14955-9-...
The following is an example of how to define fixes/requirements:
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.43, org.jboss.ide.eclipse.as.runtime.42</property>
<property name="eclipse-projects">registration,registration-ejb,registration-ear</property>
<property name="required-components">esb</property>
<property name="description">This project example requires the JBoss EAP 4.3 or JBoss AS 4.2.x</property>
<property name="downloadId">org.jboss.tools.runtime.core.as.423</property>
</fix>
<fix type="seam">
<property name="allowed-versions">2.0.0, 2.0.1, 2.0.2</property>
<property name="eclipse-projects">registration</property>
<property name="description">This project example requires Seam version 2.0</property>
<property name="downloadId">org.jboss.tools.runtime.core.seam.202</property>
</fix>
<fix type="plugin" hard="true">
<property name="id">org.testng.eclipse</property>
<property name="versions">[5.8.0</property>
<property name="description">The TestNG plugin is required if you want to run Seam tests. You can install it using the following update site: http://beust.com/eclipse http://beust.com/eclipse</property>
<property name="connectorIds">org.testng.eclipse</property>
</fix>
</fixes>
Currently, the project examples engine recognizes 3 types of requirements:
* *wtpruntime* - if there is a requirement of the type wtpruntime, a project example will require WTP runtime described with properties.*wtpruntime properties*
* *allowed-types* - a list of WTP runtime types required by the project example, comma separated. If the workspace contains a runtime from the list, the requirement is satisfied.
* *eclipse-projects* - a list of Eclipse projects to which the requirement is related. If the workspace contains a runtime of the corresponding type, the project example will automatically add that runtime to the projects.
For instance, if the developer creates a project example using a WTP/Seam runtime named *Runtime A* and the workspace contains a compatible runtime named *Runtime B*, the Project Examples engine will fix the runtime name in *Runtime B* for all the projects listed in the eclipse-projects property.
* *required-components* - a list of comma separated components that have to be contained in a WTP runtime. Possible values are *esb*, *portlet* and *bpel*.
* *description* - the text showing up in the UI if the requirement isn't satisfied
* *downloadId* - the id of the *org.jboss.tools.runtime.core.downloadruntimes* extension point. This extension point is defined in the org.jboss.tools.runtime.core plugin. The *downloadId* property is used in the JBoss Central editor to download/install the required WTP runtime.
* *seam* - a project example requires a Seam runtime
* *Seam properties*
* *allowed-versions* required Seam versions
* *eclipse-projects* - a list of Eclipse projects to which the requirement is related
The Seam runtime name will be fixed in the way similar to how it is done for the wtpruntime type.
* *description* - the text showing up in the UI if the requirement isn't satisfied
* *downloadId* - the id of the *org.jboss.tools.runtime.core.downloadruntimes* extension point. This extension point is defined in the org.jboss.tools.runtime.core plugin. The *downloadId* property is used in the JBoss Central editor to download/install the required Seam runtime.
**
* *plugin* - a project example requires a plugin
* *Plugin properties*
* *id* - plugin ID
* *versions* - required versions
* *description* - the text showing up in the UI if the requirement isn't satisfied
* *connectorIds -* a list of the ids of the *org.eclipse.mylyn.discovery.core.connectorDiscovery* extension point. The extension point is defined in the org.eclipse.equinox.p2.discovery.compatibility plugin. An example of the use of this extension point can be found in the org.jboss.tools.central.discovery plugin. The *connectorIds* property is used in the JBoss Central editor to install the required plugins.
h4. Cheatsheet/html welcome page
The developer can define an Eclipse cheatsheet or a html page that will be opened after importing a project example.
The following is an example:
<project>
...
<welcome type="cheatsheets" url="/booking/cheatsheets/booking.xml"/>
...
</project>
The type of the *welcome* page can be *cheatsheets* or *html*.
The *url* is the address of an Eclipse cheatsheet or html page that needs to be opened. It can be a standard url address or a location within the workspace.
Eclipse cheatsheet examples can be found on http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/... http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/....
The org.jboss.tools.project.examples.cheatsheet plugin includes several actions that can be used in a cheatsheet.
The Javadoc API contains the description of those actions.
h4. Maven Project examples
Such project examples require the m2e, m2eclipse-wtp and JBoss Maven Project Examples feature.
There are three types of Maven project examples:
h5. Pure maven project examples
Pure maven project examples are defined in the following way:
<project>
...
<importType>maven</importType>
<importTypeDescription>...</importTypeDescription>
...
</project>
The developer defines the *maven* importType element and creates a zip archive containing a pure maven project that doesn't have to include Eclipse settings. The project example engine will import the project and configure Eclipse settings.
If the user's environment doesn't satisfy the requirements (doesn't include m2eclipse, for instance), a text from the *importTypeDescription* element will be shown.**
See https://issues.jboss.org/browse/JBIDE-6214 JBIDE-6214 for more details.
h5. Maven project examples based on a Maven archetype
The following is an example:
<importType>mavenArchetype</importType>
<importTypeDescription>The project example requires ...</importTypeDescription>
<mavenArchetype>
<archetypeGroupId>org.jboss.weld.archetypes</archetypeGroupId>
<archetypeArtifactId>jboss-javaee6-webapp</archetypeArtifactId>
<archetypeVersion>1.0.1.Beta2</archetypeVersion>
<!-- <archetypeRepository> http://repository.jboss.org/nexus/content/groups/public/ http://repository.jboss.org/nexus/content/groups/public/</archetypeRepository> -->
<groupId>org.jboss.tools.examples</groupId>
<artifactId>jboss-javaee6-webapp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<javaPackage>org.jboss.tools.examples</javaPackage>
<properties>
<property name="name" value="Java EE 6 webapp project"/>
</properties>
</mavenArchetype>
The developer defines the *mavenArchetype* importType element.
A Maven archetype is defined within the *mavenArchetype* element.
The project examples engine will create an archetype and configure an Eclipse project.
For more details see https://issues.jboss.org/browse/JBIDE-7890 JBIDE-7890
This type of Maven project examples doesn't require creating any archive.
*Notice:*
Maven project examples aren't available in JBDS <= 4.0.
Pure Maven project examples are available in JBoss Tools 3.2.0.GA.
Project examples of the *mavenArchetype* type are available in JBoss Tools 3.3.0.M1.
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-16578]
Create a new document in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
13 years
[JBoss Tools] - Creating Project Examples
by Snjezana Peco
Snjezana Peco [http://community.jboss.org/people/snjeza] modified the document:
"Creating Project Examples"
To view the document, visit: http://community.jboss.org/docs/DOC-16578
--------------------------------------------------------------
Project examples are created using a project examples xml file added to a project examples site.
Defining project examples sites is described on http://community.jboss.org/docs/DOC-14955 Project Examples Sites.
The following is a definition of a project example within some site:
<?xml version="1.0" encoding="UTF-8"?>
<projects
<project>
...
</project>
</projects>
h4. Simple Project Example
A definition of a simple project example:
<project>
<category>Seam</category>
<name>registration</name>
<included-projects>registration, registration-ejb ...</included-projects>
<shortDescription>Seam Registration Example</shortDescription>
<description>This is a trivial example for the Seam tutorial. ...</description>
<size>31657984</size>
<url> http://...registration.zip http://...registration.zip</url>
</project>
Below is a description of the basic elements:
* *category* - the category to which the project example belongs
* *name* - the project example name - it is used internally and isn't shown to the user
* *included-projects* - the projects included in the project example. The Project Example engine will import only those projects included within this element.
* *shortDescription* - the short description (it is recommended to be a few words)
* *description* - the complete description of the project example (a few lines recommended)
* *size* - the archive size in bytes. This is an informative and optional element
* *url* - the URL which the zip archive is placed on; can be local or remote; optional
These are the minimal elements necessary to create a project example.
In this example, the url has to point to the zip archive containing one or more Eclipse projects.
The category, name, shortDescription, description, size and url are shown in the project example wizard.
http://community.jboss.org/servlet/JiveServlet/showImage/14212/ProjectExa... http://community.jboss.org/servlet/JiveServlet/downloadImage/14212/Projec...
h4. Fixes/Requirements
The developer can define requirements that need to be satisfied in order the project example to work correctly. The Project Example engine will warn the user if the requirements aren't satisfied (see the figure) and fix some possible issues when the project example is imported.
http://community.jboss.org/servlet/JiveServlet/showImage/102-14955-9-2270... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14955-9-...
http://community.jboss.org/servlet/JiveServlet/showImage/102-14955-9-2274... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14955-9-...
The following is an example of how to define fixes/requirements:
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.43, org.jboss.ide.eclipse.as.runtime.42</property>
<property name="eclipse-projects">registration,registration-ejb,registration-ear</property>
<property name="required-components">esb</property>
<property name="description">This project example requires the JBoss EAP 4.3 or JBoss AS 4.2.x</property>
</fix>
<fix type="seam">
<property name="allowed-versions">2.0.0, 2.0.1, 2.0.2</property>
<property name="eclipse-projects">registration</property>
<property name="description">This project example requires Seam version 2.0</property>
</fix>
<fix type="plugin" hard="true">
<property name="id">org.testng.eclipse</property>
<property name="versions">[5.8.0</property>
<property name="description">The TestNG plugin is required if you want to run Seam tests. You can install it using the following update site: http://beust.com/eclipse http://beust.com/eclipse</property>
</fix>
</fixes>
Currently, the project examples engine recognizes 3 types of requirements:
* *wtpruntime* - if there is a requirement of the type wtpruntime, a project example will require WTP runtime described with properties.*wtpruntime properties*
* *allowed-types* - a list of WTP runtime types required by the project example, comma separated. If the workspace contains a runtime from the list, the requirement is satisfied.
* *eclipse-projects* - a list of Eclipse projects to which the requirement is related. If the workspace contains a runtime of the corresponding type, the project example will automatically add that runtime to the projects.
For instance, if the developer creates a project example using a WTP/Seam runtime named *Runtime A* and the workspace contains a compatible runtime named *Runtime B*, the Project Examples engine will fix the runtime name in *Runtime B* for all the projects listed in the eclipse-projects property.
* *required-components* - a list of comma separated components that have to be contained in a WTP runtime. Possible values are *esb*, *portlet* and *bpel*.
* *description* - the text showing up in the UI if the requirement isn't satisfied
* *seam* - a project example requires a Seam runtime
*Seam properties*
** *allowed-versions* required Seam versions
** *eclipse-projects* - a list of Eclipse projects to which the requirement is related
The Seam runtime name will be fixed in the way similar to how it is done for the wtpruntime type.
** *description* - the text showing up in the UI if the requirement isn't satisfied
* *plugin* - a project example requires a plugin
*Plugin properties*
** *id* - plugin ID
** *versions* - required versions (the syntax is the same as in the Eclipse manifest file (*isn't implemented yet*)
** *description* - the text showing up in the UI if the requirement isn't satisfied
If the *fix* contains the *hard* argument, the project example won't be shown if the requirement isn't satisfied (*isn't implemented yet*)
h4. Cheatsheet/html welcome page
The developer can define an Eclipse cheatsheet or a html page that will be opened after importing a project example.
The following is an example:
<project>
...
<welcome type="cheatsheets" url="/booking/cheatsheets/booking.xml"/>
...
</project>
The type of the *welcome* page can be *cheatsheets* or *html*.
The *url* is the address of an Eclipse cheatsheet or html page that needs to be opened. It can be a standard url address or a location within the workspace.
Eclipse cheatsheet examples can be found on http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/... http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/....
The org.jboss.tools.project.examples.cheatsheet plugin includes several actions that can be used in a cheatsheet.
The Javadoc API contains the description of those actions.
h4. Maven Project examples
Such project examples require the m2e, m2eclipse-wtp and JBoss Maven Project Examples feature.
There are three types of Maven project examples:
h5. Pure maven project examples
Pure maven project examples are defined in the following way:
<project>
...
<importType>maven</importType>
<importTypeDescription>...</importTypeDescription>
...
</project>
The developer defines the *maven* importType element and creates a zip archive containing a pure maven project that doesn't have to include Eclipse settings. The project example engine will import the project and configure Eclipse settings.
If the user's environment doesn't satisfy the requirements (doesn't include m2eclipse, for instance), a text from the *importTypeDescription* element will be shown.**
See https://issues.jboss.org/browse/JBIDE-6214 JBIDE-6214 for more details.
h5. Maven project examples based on a Maven archetype
The following is an example:
<importType>mavenArchetype</importType>
<importTypeDescription>The project example requires ...</importTypeDescription>
<mavenArchetype>
<archetypeGroupId>org.jboss.weld.archetypes</archetypeGroupId>
<archetypeArtifactId>jboss-javaee6-webapp</archetypeArtifactId>
<archetypeVersion>1.0.1.Beta2</archetypeVersion>
<!-- <archetypeRepository> http://repository.jboss.org/nexus/content/groups/public/ http://repository.jboss.org/nexus/content/groups/public/</archetypeRepository> -->
<groupId>org.jboss.tools.examples</groupId>
<artifactId>jboss-javaee6-webapp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<javaPackage>org.jboss.tools.examples</javaPackage>
<properties>
<property name="name" value="Java EE 6 webapp project"/>
</properties>
</mavenArchetype>
The developer defines the *mavenArchetype* importType element.
A Maven archetype is defined within the *mavenArchetype* element.
The project examples engine will create an archetype and configure an Eclipse project.
For more details see https://issues.jboss.org/browse/JBIDE-7890 JBIDE-7890
This type of Maven project examples doesn't require creating any archive.
*Notice:*
Maven project examples aren't available in JBDS <= 4.0.
Pure Maven project examples are available in JBoss Tools 3.2.0.GA.
Project examples of the *mavenArchetype* type are available in JBoss Tools 3.3.0.M1.
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-16578]
Create a new document in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
13 years
[jBPM] - Duplicate tasks in the scheduler
by sharyak
sharyak [http://community.jboss.org/people/sharyak] created the discussion
"Duplicate tasks in the scheduler"
To view the discussion, visit: http://community.jboss.org/message/635369#635369
--------------------------------------------------------------
In our application we have a requirement to expire tasks that are not completed in 30 days after creation. Emails need to be send.
I used DeadlineHandler to implement it. However, I have following issues now:
1. TaskService can be created a first time. Since code in the TaskService running query every time that it is instanciated and queue allows for duplicates, I have multiple threads for the same task.
2. The second question. Out tasks have expiration ser to 30 days. There will be quite a lot of entries in the queue.
I am running in the clustered enviroment wihout distributed cache. If I create TaskService once then, I will different cache entries on different servers.
My question is : What will be your recommendation in this case? How did you guys envision it ?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/635369#635369]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years
[JBoss Tools] - Creating Project Examples
by Max Rydahl Andersen
Max Rydahl Andersen [http://community.jboss.org/people/maxandersen] modified the document:
"Creating Project Examples"
To view the document, visit: http://community.jboss.org/docs/DOC-16578
--------------------------------------------------------------
Project examples are created using a project examples xml file added to a project examples site.
Defining project examples sites is described on http://community.jboss.org/docs/DOC-14955 Project Examples Sites.
A project examples xml file is described in the attached project-examples_1_0.xsd schema.
The following is a definition of a project example within some site:
<?xml version="1.0" encoding="UTF-8"?>
<projects xmlns="urn:jboss:project-examples:1.0"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:jboss:project-examples:1.0
http://download.jboss.org/jbosstools/examples/project-examples_1_0.xsd http://download.jboss.org/jbosstools/examples/project-examples_1_0.xsd">
<project>
...
</project>
</projects>
h4. Simple Project Example
A definition of a simple project example:
<project>
<category>Seam</category>
<name>registration</name>
<included-projects>registration, registration-ejb ...</included-projects>
<shortDescription>Seam Registration Example</shortDescription>
<description>This is a trivial example for the Seam tutorial. ...</description>
<size>31657984</size>
<url> http://...registration.zip http://...registration.zip</url>
</project>
Below is a description of the basic elements:
* *category* - the category to which the project example belongs
* *name* - the project example name - it is used internally and isn't shown to the user
* *included-projects* - the projects included in the project example. The Project Example engine will import only those projects included within this element.
* *shortDescription* - the short description (it is recommended to be a few words)
* *description* - the complete description of the project example (a few lines recommended)
* *size* - the archive size in bytes. This is an informative and optional element
* *url* - the URL which the zip archive is placed on; can be local or remote; optional
These are the minimal elements necessary to create a project example.
In this example, the url has to point to the zip archive containing one or more Eclipse projects.
The category, name, shortDescription, description, size and url are shown in the project example wizard.
http://community.jboss.org/servlet/JiveServlet/showImage/14212/ProjectExa... http://community.jboss.org/servlet/JiveServlet/downloadImage/14212/Projec...
h4. Fixes/Requirements
The developer can define requirements that need to be satisfied in order the project example to work correctly. The Project Example engine will warn the user if the requirements aren't satisfied (see the figure) and fix some possible issues when the project example is imported.
http://community.jboss.org/servlet/JiveServlet/showImage/102-14955-9-2270... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14955-9-...
http://community.jboss.org/servlet/JiveServlet/showImage/102-14955-9-2274... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-14955-9-...
The following is an example of how to define fixes/requirements:
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.43, org.jboss.ide.eclipse.as.runtime.42</property>
<property name="eclipse-projects">registration,registration-ejb,registration-ear</property>
<property name="required-components">esb</property>
<property name="description">This project example requires the JBoss EAP 4.3 or JBoss AS 4.2.x</property>
</fix>
<fix type="seam">
<property name="allowed-versions">2.0.0, 2.0.1, 2.0.2</property>
<property name="eclipse-projects">registration</property>
<property name="description">This project example requires Seam version 2.0</property>
</fix>
<fix type="plugin" hard="true">
<property name="id">org.testng.eclipse</property>
<property name="versions">[5.8.0</property>
<property name="description">The TestNG plugin is required if you want to run Seam tests. You can install it using the following update site: http://beust.com/eclipse http://beust.com/eclipse</property>
</fix>
</fixes>
Currently, the project examples engine recognizes 3 types of requirements:
* *wtpruntime* - if there is a requirement of the type wtpruntime, a project example will require WTP runtime described with properties.*wtpruntime properties*
* *allowed-types* - a list of WTP runtime types required by the project example, comma separated. If the workspace contains a runtime from the list, the requirement is satisfied.
* *eclipse-projects* - a list of Eclipse projects to which the requirement is related. If the workspace contains a runtime of the corresponding type, the project example will automatically add that runtime to the projects.
For instance, if the developer creates a project example using a WTP/Seam runtime named *Runtime A* and the workspace contains a compatible runtime named *Runtime B*, the Project Examples engine will fix the runtime name in *Runtime B* for all the projects listed in the eclipse-projects property.
* *required-components* - a list of comma separated components that have to be contained in a WTP runtime. Possible values are *esb*, *portlet* and *bpel*.
* *description* - the text showing up in the UI if the requirement isn't satisfied
* *seam* - a project example requires a Seam runtime
*Seam properties*
** *allowed-versions* required Seam versions
** *eclipse-projects* - a list of Eclipse projects to which the requirement is related
The Seam runtime name will be fixed in the way similar to how it is done for the wtpruntime type.
** *description* - the text showing up in the UI if the requirement isn't satisfied
* *plugin* - a project example requires a plugin
*Plugin properties*
** *id* - plugin ID
** *versions* - required versions (the syntax is the same as in the Eclipse manifest file (*isn't implemented yet*)
** *description* - the text showing up in the UI if the requirement isn't satisfied
If the *fix* contains the *hard* argument, the project example won't be shown if the requirement isn't satisfied (*isn't implemented yet*)
h4. Cheatsheet/html welcome page
The developer can define an Eclipse cheatsheet or a html page that will be opened after importing a project example.
The following is an example:
<project>
...
<welcome type="cheatsheets" url="/booking/cheatsheets/booking.xml"/>
...
</project>
The type of the *welcome* page can be *cheatsheets* or *html*.
The *url* is the address of an Eclipse cheatsheet or html page that needs to be opened. It can be a standard url address or a location within the workspace.
Eclipse cheatsheet examples can be found on http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/... http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/....
The org.jboss.tools.project.examples.cheatsheet plugin includes several actions that can be used in a cheatsheet.
The Javadoc API contains the description of those actions.
h4. Maven Project examples
Such project examples require the m2eclipse-core, m2eclipse-wtp and JBoss Maven Project Examples feature.
There are three types of Maven project examples:
h5. Pure maven project examples
Pure maven project examples are defined in the following way:
<project>
...
<importType>maven</importType>
<importTypeDescription>...</importTypeDescription>
...
</project>
The developer defines the *maven* importType element and creates a zip archive containing a pure maven project that doesn't have to include Eclipse settings. The project example engine will import the project and configure Eclipse settings.
If the user's environment doesn't satisfy the requirements (doesn't include m2eclipse, for instance), a text from the *importTypeDescription* element will be shown.**
See https://issues.jboss.org/browse/JBIDE-6214 JBIDE-6214 for more details.
h5. Maven project examples based on a Maven archetype
The following is an example:
<importType>archetype</importType>
<importTypeDescription>The project example requires ...</importTypeDescription>
<archetype>
<archetypeGroupId>org.jboss.weld.archetypes</archetypeGroupId>
<archetypeArtifactId>jboss-javaee6-webapp</archetypeArtifactId>
<archetypeVersion>1.0.1.Beta2</archetypeVersion>
<!-- <archetypeRepository> http://repository.jboss.org/nexus/content/groups/public/ http://repository.jboss.org/nexus/content/groups/public/</archetypeRepository> -->
<groupId>org.jboss.tools.examples</groupId>
<artifactId>jboss-javaee6-webapp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<javaPackage>org.jboss.tools.examples</javaPackage>
<properties>
<property name="name" value="Java EE 6 webapp project"/>
</properties>
</archetype>
The developer defines the *archetype* importType element.
A Maven archetype is defined within the *archetype* element.
The project examples engine will create an archetype and configure an Eclipse project.
For more details see https://issues.jboss.org/browse/JBIDE-7890 JBIDE-7890
This type of Maven project examples doesn't require creating any archive.
h5. Project examples based on a Maven/Eclipse project placed in a Git/SVN Repository
For example:
<project>
...
<url>git://github.com/seam/examples.git</url>
...
<importType>maven</importType>
<importTypeDescription>...</importTypeDescription>
<git>
<branches>master</branches>
<initialBranch>master</initialBranch>
<remoteName>origin</remoteName>
<directoryPath>examples</directoryPath>
<homeDirectory>/</homeDirectory>
</git>
...
</project>
<project>
...
<url> http://anonsvn.jboss.org/repos/richfaces/branches/community/3.3.X/example... http://anonsvn.jboss.org/repos/richfaces/branches/community/3.3.X/example...</url>
...
<importType>maven</importType>
<importTypeDescription>...</importTypeDescription>
<svn/>
...
</project>
A Git/SVN repository is defined using the *url* and *git* or *svn* element.
The *importType* describes the type of a project in the repository and can be *maven* (a pure maven project) or *eclipse* (an Eclipse project). If it is omitted, *eclipse* is assumed.
The *git* element can consists of some additional elements (all optional)
* branches - a list of branches (comma separated) to be fetched (optional, the default branch is master)
* initialBranch - determines which local branch will be created and initially checked out (optional, master by default)
* remoteName - defines a name for the remote repository (optional, the default is "origin")
* directoryPath - a path to which you want to clone the Git directory (optional, the default is the last segment of the url without .git suffix)
* homeDirectory - a directory within the git repository where the example is placed (optional, the default is /)
The *svn* element doesn't require any additional element because it is completelly defined by the *url*.
See https://issues.jboss.org/browse/JBIDE-8452 JBIDE-8452 for more details.
This type of project examples doesn't require creating any archive.
The project examples based on Maven/Eclipse projects placed on a SVN Repository require subclipse feature.
*Notice:*
Maven project examples aren't available in JBDS.
Pure Maven project examples are available in JBoss Tools 3.2.0.GA.
Project examples of the *archetype* type will be available in JBoss Tools 3.3.0.M1.
Project examples that use a project from a Git/SVN repository aren't implemented yet.
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-16578]
Create a new document in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
13 years