[JBoss jBPM] - Re: How to deploy a BPEL process using the APIs?
by alex.guizar@jboss.com
I made a mistake in my last post. ProcessDeployer and DeployProcessTask only submit the process file URL. In jBPM BPEL 1.1.GA this trivial deployment mechanism was replaced with a HTTP file upload. Please look at the DeploymentTask instead, which relies the Apache HttpClient library to perform the actual upload.
protected void writeRequest(PostMethod post) throws IOException {
| // process part
| String contentType = URLConnection.getFileNameMap().getContentTypeFor(processArchive.getName());
| FilePart processPart = new FilePart("processArchive", processArchive, contentType,
| FileUtil.DEFAULT_CHARSET.name());
|
| // multipart request
| post.setRequestEntity(new MultipartRequestEntity(new Part[] { processPart }, post.getParams()));
|
| log("deploying process: " + processArchive.getName());
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163861#4163861
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163861
17 years, 9 months
[JBoss jBPM] - Re: How to deploy a BPEL process using the APIs?
by alex.guizar@jboss.com
The hibernate configuration in jbpm-bpel-1.1.GA/config is set to acquire JDBC connections from a data source registered in the app server JNDI service.
<!-- DataSource properties (begin) -->
| <property name="hibernate.connection.datasource">java:/DefaultDS</property>
| <!-- DataSource properties (end) -->
If you want to deploy processes outside the app server, you need to configure hibernate to acquire connections from the driver manager, because data sources are not available outside the app server.
<!-- JDBC connection properties (begin) -->
| <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
| <property name="hibernate.connection.url">jdbc:hsqldb:mem:jbpm;sql.enforce_strict_size=true</property>
| <property name="hibernate.connection.username">sa</property>
| <property name="hibernate.connection.password"/>
| <property name="hibernate.hbm2ddl.auto">create</property>
| <!-- JDBC connection properties (end) -->
You can deploy processes outside the app server like this, but in my opinion it is easier to post your process archive to the deployment servlet through the ProcessDeployer class, like the DeployProcessTask does.
public void execute() throws BuildException {
| ProcessDeployer processDeployer = new ProcessDeployer();
|
| if (host != null)
| processDeployer.setHost(host);
| if (port != null)
| processDeployer.setPort(port.intValue());
| if (context != null)
| processDeployer.setContext(context);
|
| processDeployer.deployProcess(processfile);
|
| int problemCount = processDeployer.getProblemHandler().getProblemCount();
| if (problemCount > 0)
| throw new BuildException("Problems (" + problemCount + " item[s])");
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163856#4163856
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163856
17 years, 9 months
[JBoss jBPM] - Re: does this design make sense?
by dOoMi
"kukeltje" wrote : anonymous wrote : jBPM swallows the StaleObjectStateException causing the calling code not to notice that the operation failed. Afaik, that can be configured in jBPM 3.2.3. Please have a look in the docs
|
i'm afraid not. i've been on this thing several hours. the configuration allows you to influence the logging but not the handling of StaleObjectStateExceptions. you can see that clearly when having a look at the source of the Services class:
public void close() {
| 236: if (services != null) {
| 237: Map closeExceptions = new HashMap();
| 238: Throwable firstException = null;
| 239: Iterator iter = serviceNames.iterator();
| 240: while (iter.hasNext()) {
| 241: String serviceName = (String) iter.next();
| 242: Service service = (Service) services.get(serviceName);
| 243: if (service != null) {
| 244: try {
| 245: log.debug("closing service '" + serviceName
| 246: + "': " + service);
| 247: service.close();
| 248: } catch (JbpmPersistenceException e) {
| 249: // if this is a stale object exception, the jbpm configuration has control over the logging
| 250: if ("org.hibernate.StaleObjectStateException"
| 251: .equals(e.getCause().getClass()
| 252: .getName())) {
| 253: log.info("problem closing service '"
| 254: + serviceName
| 255: + "': optimistic locking failed");
| 256: StaleObjectLogConfigurer.staleObjectExceptionsLog
| 257: .error(
| 258: "problem closing service '"
| 259: + serviceName
| 260: + "': optimistic locking failed",
| 261: e);
| 262: } else {
| 263: log.error("problem closing service '"
| 264: + serviceName + "'", e);
| 265: }
| 266: } catch (Exception e) {
| 267: // NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
| 268: log.error("problem closing service '"
| 269: + serviceName + "'", e);
| 270: closeExceptions.put(serviceName, e);
| 271: if (firstException == null) {
| 272: firstException = e;
| 273: }
| 274: }
| 275: }
| 276: }
| 277: if (!closeExceptions.isEmpty()) {
| 278: throw new JbpmException("problem closing services "
| 279: + closeExceptions, firstException);
| 280: }
| 281: }
| 282: }
| 283:
| 284: public static void assignId(Object object) {
| 285: JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
| 286: if (jbpmContext != null) {
| 287: // give this process instance an id
| 288: Services services = jbpmContext.getServices();
| 289: if (services.hasService(Services.SERVICENAME_PERSISTENCE)) {
| 290: PersistenceService persistenceService = services
| 291: .getPersistenceService();
| 292: persistenceService.assignId(object);
| 293: }
| 294: }
| 295: }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163811#4163811
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163811
17 years, 9 months