[JBoss Portal] - CMS Content problem
by porcho
Hi there. I'm using JBoss Portal 2.6.4-GA on a Linux server, along with PostgreSQL 8.2.4; and I'm facing some weird problems regarding CMS content. I've uploaded an image, and a HTML that references it, and created a CMS content window that points to this HTML, using the Admin portal. Since I uploaded the image at default/images/image.jpg, I'm referencing it from the HTML using .
Depending on the browser I'm using, the image shows up, or an error appears in its place, saying that the resource I'm trying to reach could not be found. At IE 7, the image appears, while Firefox 2.0.0.12 gives me the error.
I've noticed that, when the error shows up, JBP cannot serve the HTML page I've uploaded , since the div in which the image is placed isn't at the page source.
Looking at server.log, I can see several errors like this:
| 2008-03-11 12:38:42,036 ERROR [STDERR] at org.jbpm.msg.command.CommandExecutorThread.executeCommand(CommandExecutorThread.java:139)
| 2008-03-11 12:38:42,036 ERROR [STDERR] at org.jbpm.msg.command.CommandExecutorThread.run(CommandExecutorThread.java:79)
| 2008-03-11 12:38:42,036 ERROR [org.jbpm.svc.Services] problem closing service 'persistence'
| org.jbpm.JbpmException: setRollbackOnly was invoked while configuration specifies user managed transactions
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:139)
| at org.jbpm.svc.Services.close(Services.java:211)
| at org.jbpm.JbpmContext.close(JbpmContext.java:139)
| at org.jbpm.msg.command.CommandExecutorThread.executeCommand(CommandExecutorThread.java:139)
| at org.jbpm.msg.command.CommandExecutorThread.run(CommandExecutorThread.java:79)
| 2008-03-11 12:38:42,036 ERROR [org.jbpm.msg.command.CommandExecutorThread] org.jbpm.JbpmException: problem closing services {persistence=org.jbpm.JbpmException: setRollbackOnly was invoked while configuration specifies user managed transactions}
Can that be the root of the problem? And, if it's so, how can I fix it? I've searched at JBoss Portal Reference, searched at the forum, googled...and I still can't find a solution.
Thanks in advance!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4135681#4135681
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4135681
18 years, 1 month
[JBoss jBPM] - Add token with external application
by jeanC
I have a process that automatically create nodes (node1). I want to add a new node1 with an external application. I try to call the execute method of the forkHandler but I can not get the executionContext.
I put all the code of the execute method in the external application, I can obtain the rootToken, but when I try this code the jpbCxt is always null
ExecutionContext executionContext = new ExecutionContext(rootToken);
JbpmContext jpbCxt = executionContext.getJbpmContext();
Is it possible to do this and how can I do this?
Thanks
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition
| xmlns="" name="dynamic fork">
| <start-state name="start">
| <transition name="" to="fork"></transition>
| </start-state>
| <end-state name="end"></end-state>
| <node name="fork">
|
| <action class="be.labocollard.server.kernel.handlers.ForkHandler"></action>
| <transition name="" to="node1"></transition>
| </node>
| <task-node name="task">
| <task name="taskFork">
| <assignment expression="user(abc)"></assignment>
| </task>
| <transition name="" to="join"></transition>
| </task-node>
| <join name="join">
| <transition name="" to="end"></transition>
| </join>
| <node name="node1">
| <transition name="" to="task"></transition>
| </node>
| </process-definition>
|
|
| public class ForkHandler implements ActionHandler {
| /**
| * Logger for this class
| */
| private static final Logger logger = Logger.getLogger(ForkHandler.class);
|
| /**
| *
| */
| private static final long serialVersionUID = 1L;
|
| /**
| * Create a new child token for each item in list.
| *
| * @param executionContext
| * @throws Exception
| */
| public void execute(final ExecutionContext executionContext) throws Exception {
| logger.debug("execute(ExecutionContext executionContext=" + executionContext + ") - start");
|
| List<? extends Object> forkList = null;
| forkList = initializeList(executionContext);
|
| final Token rootToken = executionContext.getToken();
| final Node node = executionContext.getNode();
|
| final List<Object[]> argSets = new LinkedList<Object[]>();
| //
| // First, create a new token and execution context for each item in
| // list.
| //
| for (int i = 0; i < node.getLeavingTransitions().size(); i++) {
| final Transition transition = (Transition) node.getLeavingTransitions().get(i);
| for (Object object : forkList) {
| final Token newToken = new Token(rootToken, Cola.PREFIX + node.getId() + "." + ((OpCodeTime) object).getId());
| newToken.setTerminationImplicit(true);
| JbpmContext jpbCxt = executionContext.getJbpmContext();
| Session session = jpbCxt.getSession();
| session.save(newToken);
| final ExecutionContext newExecutionContext = new ExecutionContext(newToken);
| newExecutionContext.setVariable(Cola.OPCODETIME, object);
| argSets.add(new Object[] { newExecutionContext, transition });
| }
| }
|
| //
| // Now, let each new token leave the node.
| //
| for (int i = 0; i < argSets.size(); i++) {
| final Object[] args = argSets.get(i);
| node.leave((ExecutionContext) args[0], (Transition) args[1]);
| }
|
| logger.debug("execute(ExecutionContext) - end");
| }
|
| // @SuppressWarnings("unchecked")
| protected List<? extends Object> initializeList(final ExecutionContext executionContext) {
| List<? extends Object> list = (List<? extends Object>) executionContext.getContextInstance().getVariable(Cola.FORKLIST);
| return list;
| }
|
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4135671#4135671
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4135671
18 years, 1 month
[Clustering/JBoss] - Re: Loadbalancing and clustering JBOSS using Apache Http ser
by yugantshah
Hello,
I am running the simple ejb3 clustering example.
Where in I have a jsp that calls the bean.This call is in a for loop with time lag in it.
The bean return the String message that is printed by the jsp on the console.
I am attaching the code for HelloWorldBean.java
| package com;
|
| import javax.annotation.PostConstruct;
| import javax.annotation.PreDestroy;
| import javax.ejb.Local;
| import javax.ejb.PostActivate;
| import javax.ejb.PrePassivate;
| import javax.ejb.Remote;
| import javax.ejb.Stateful;
| import javax.ejb.Stateless;
|
| import org.jboss.annotation.ejb.Clustered;
| import org.jboss.annotation.ejb.LocalBinding;
| import org.jboss.annotation.ejb.RemoteBinding;
|
|
| @Stateless
| @Remote(HelloWorldInterface.class)
| @RemoteBinding(jndiBinding="ejb/local/HelloWorldBean")
| @Clustered
| public class HelloWorldBean {
|
| public String getMessage(){
| for(int k=0;k<10;k++) {
| Object a = new Object();
| System.out.println("YUGANT Bean:"+k);
| try {
| Thread.sleep(500);
| } catch (InterruptedException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
| }
| return "Say Hello";
| }
| @PreDestroy
| public void preDestroy(){
| System.out.println("HelloWorldBean:preDestroy:");
| }
| @PostActivate
| public void postActivate(){
| System.out.println("HelloWorldBean:postActivate:");
| }
| @PrePassivate
| public void prePassivate(){
| System.out.println("HelloWorldBean:prePassivate:");
| }
| @PostConstruct
| public void postConstruct(){
| System.out.println("HelloWorldBean:PostConstruct:");
| }
| }
|
|
|
The code for Business interface class is
| package com;
|
| public interface HelloWorldInterface {
| public String getMessage();
| }
|
The jsp code is :
|
| <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
| pageEncoding="ISO-8859-1"%>
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
| <%@page import="java.util.Properties"%>
| <%@page import="javax.naming.Context"%>
| <%@page import="javax.naming.InitialContext"%>
| <%@page import="com.HelloWorldInterface"%>
| <html>
| <head>
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
| <title>Insert title here</title>
| </head>
| <body>
| <%
|
| Context ctx = new InitialContext();
| HelloWorldInterface fcs = (HelloWorldInterface)ctx.lookup("ejb/local/HelloWorldBean");
| int k = 0;
| while(k<10) {
| System.out.println(fcs.getMessage()+":"+k);
| Thread.sleep(500);
| k++;
| }
| %>
|
Thanks,
Yugant Shah.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4135658#4135658
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4135658
18 years, 1 month