[Installation, Configuration & DEPLOYMENT] - can a single application be undeployed?
by kdolan
if i have a jboss instance running multiple applications (e.g., ears),
* can i undeploy (i.e., shutdown) one application only without removing it from the deploy directory?
* if so, how - from an admin console? programmatically?
* finally, what is the earliest version of jboss this works in?
the basic scenario i need to support is:
1. jboss service starts w/ multiple applications (all running)
2. application A shuts application B down
3. application A performs some kind of an update (which cannot occur if application B is running)
4. application A re-starts application B
i cannot shut the entire jboss service down because application A must still continue to run.
i do not have control over both applications so it's not possible to build in some kind of communication that allows both to run but application B to appear "stopped" to users for the time of the update.
finally, i do not have control over the jboss version the applications are running in. i do not believe the applications will be running in the latest version but i don't know what version it is.
thanks! i greatly appreciate the feedback.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246998#4246998
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246998
16 years, 9 months
[JBoss jBPM] - Using Context and Command
by asrickard
I've been trying to work out how to use context functions and the Command system, and need some suggestions/assistance.
I have a conversation-scoped Seam component "workflowProcessManager" in which I have a list of running processes which is refreshed when the user clicks a commandLink. In the same component I have a function to suspend a ProcessInstance.
|
| @Name("workflowProcessManager")
| @Scope(ScopeType.CONVERSATION)
| public class WorkflowProcessManager {
|
| private JbpmContext context;
| private CommandServiceImpl csi;
| private Boolean showActiveOnly = true;
|
| @DataModel private List<ProcessDefinition> processDefinitions = new Vector<ProcessDefinition>(0);
| @DataModelSelection("processDefinitions") @Out(required=false) private ProcessDefinition currentProcessDefinition;
|
| @DataModel private List<ProcessInstance> runningProcesses = new Vector<ProcessInstance>(0);
| @DataModelSelection("runningProcesses") @Out(required=false) private ProcessInstance currentRunningProcess;
|
| public void init() {
| context = JbpmConfiguration.getInstance().createJbpmContext();
| populateProcessDefinitionList();
| csi = new CommandServiceImpl(context.getJbpmConfiguration());
| }
|
| public void showProcessesForProcessDefinition(ProcessDefinition pd) {
| GetProcessInstancesCommand gpic = new GetProcessInstancesCommand();
|
| if (this.showActiveOnly)
| gpic.setOnlyRunning(true);
| else
| gpic.setOnlyRunning(false);
| gpic.setProcessName(pd.getName());
|
| runningProcesses = (List<ProcessInstance>) csi.execute(gpic);
| System.out.println("ShowProcessesForProcessDefinition: runningProcesses contains " + runningProcesses.size() + " entries.");
| }
|
| public void suspendProcessInstance(Integer id) {
| System.out.println("Suspending process instance " + id);
| ProcessInstance pi = context.getProcessInstance(id);
|
| pi.suspend();
|
| System.out.println("Saving process instance " + id);
| context.save(pi);
|
| //Session session = context.getSession();
| //session.flush();
|
| if (pi.isSuspended()) System.out.println("Process instance is suspended = true");
| else System.out.println("Process instance is suspended = false");
|
| System.out.println("Refreshing processes for definition " + this.currentProcessDefinition.getName());
| showProcessesForProcessDefinition(this.currentProcessDefinition);
|
| for (ProcessInstance p : this.runningProcesses) {
| if (p.isSuspended()) System.out.println("Process instance " + p.getId() + " is suspended = true");
| else System.out.println("Process instance " + p.getId() + " is suspended = false");
| }
| }
|
| public Boolean getShowActiveOnly() {
| return this.showActiveOnly;
| }
| public void setShowActiveOnly(Boolean showActiveOnly) {
| this.showActiveOnly = showActiveOnly;
| }
|
| @SuppressWarnings("unchecked")
| private void populateProcessDefinitionList() {
| processDefinitions = context.getGraphSession().findAllProcessDefinitions();
| }
|
| }
|
And the guts of the page:
| <rich:panel>
| <f:facet name="header">Process List</f:facet>
|
| <h:panelGrid columns="2" columnClasses="twoColumnTopAligned">
| <h:panelGroup>
| <rich:dataTable value="#{processDefinitions}" var="processDefinition"
| onRowMouseOver="this.style.backgroundColor='#EAEAEA';this.style.cursor='pointer'"
| onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
| <rich:column>
| <f:facet name="header">Process Name</f:facet>
| <h:outputText value="#{processDefinition.name}"/>
| </rich:column>
|
| <rich:column>
| <f:facet name="header">Description</f:facet>
| <h:outputText value="#{processDefinition.description}"/>
| </rich:column>
|
| <a:support event="onRowClick" reRender="instanceTable"
| action="#{workflowProcessManager.showProcessesForProcessDefinition(processDefinition)}">
| </a:support>
| </rich:dataTable>
|
| <s:decorate id="showActiveOnlyField" template="/layout/edit.xhtml">
| <ui:define name="label">Show only active processes</ui:define>
| <h:selectBooleanCheckbox id="showActiveOnly" value="#{workflowProcessManager.showActiveOnly}" />
| </s:decorate>
| </h:panelGroup>
|
| <rich:dataTable id="instanceTable" value="#{runningProcesses}" var="processInstance">
| <rich:column>
| <f:facet name="header">Id</f:facet>
| <h:outputText value="#{processInstance.id}"/>
| </rich:column>
| <rich:column>
| <f:facet name="header">Version</f:facet>
| <h:outputText value="#{processInstance.version}"/>
| </rich:column>
|
| <rich:column>
| <f:facet name="header">Status</f:facet>
| <h:outputText value="Finished" rendered="#{processInstance.hasEnded()}"/>
| <h:outputText value="Paused" rendered="#{processInstance.suspended}"/>
| <h:outputText value="Running" rendered="#{!(processInstance.hasEnded() or processInstance.suspended)}"/>
| </rich:column>
|
| <rich:column>
| <f:facet name="header">Current Node</f:facet>
| <h:outputText value="#{processInstance.rootToken.name}"/>
| </rich:column>
|
| <rich:column>
| <f:facet name="header">Actions</f:facet>
| <a:commandLink id="pauseProcessInstance"
| action="#{workflowProcessManager.suspendProcessInstance(processInstance.id)}"
| reRender="instanceTable"
| value="Pause">
| <s:conversationId />
| </a:commandLink>
| #{' '}
| <a:commandLink id="resumeProcessInstance"
| action="#{workflowProcessManager.resumeProcessInstance(processInstance.id)}"
| reRender="instanceTable"
| value="Restart">
| <s:conversationId />
| </a:commandLink>
| #{' '}
| <a:commandLink id="signalProcessInstances"
| action="#{workflowProcessManager.signalProcessInstance(processInstance.id)}"
| reRender="instanceTable"
| value="Signal">
| <s:conversationId />
| </a:commandLink>
| </rich:column>
| </rich:dataTable>
|
| </h:panelGrid>
|
| </rich:panel>
|
The problem I experience is that the list of running ProcessInstances is not refreshed correctly, unless I add in the hibernate session flush() (commented out in the code above).
The command service starts up a separate JbpmContext, which I believe is not seeing the results of the suspend() call, and so refreshes the .
Should I be looking for a problem somewhere in the configuration, and if so where? Or am I using the Jbpm features incorrectly somehow? Or do I need to manually flush like this?
Any pointers from more experienced people will be much appreciated...
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246996#4246996
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246996
16 years, 9 months
[JBoss Portal] - Re: Porting application from WebSphere to JBoss
by straypet
Hi,
We are migrating from WebSphere 5.1 to JBoss Portal 2.6.8.
Here is our previous and new code:
| String JNDINAME = "SMOnlineFacade";
| String URL = "jnp://localhost:1099";
| String FACTORY = "org.jnp.interfaces.NamingContextFactory";
| String PKG_PREFIXES = "org.jboss.naming:org.jnp.interface";
|
| Object o = null;
| SMOnlineFacadeHome home = null;
| SMOnlineFacadeRemote smOnlineFacade = null;
|
| try {
| Hashtable env = new Hashtable();
|
| env.put(Context.INITIAL_CONTEXT_FACTORY, FACTORY);
| env.put(Context.PROVIDER_URL, URL);
| env.put(Context.URL_PKG_PREFIXES, PKG_PREFIXES);
| Context initialContext = new InitialContext(env);
|
| o = initialContext.lookup(JNDINAME); // The object returned is of type $Proxy###
| home = (SMOnlineFacadeHome) PortableRemoteObject.narrow(o, SMOnlineFacadeHome.class);
| smOnlineFacade = home.create();
|
| // Was previously
| // org.apache.jetspeed.portlet.PortletContext portletContext = getPortletConfig().getContext();
| // SMOnlineDelegate delegate = null;
| // org.apache.jetspeed.portlet.PortletService portletService;
| // try {
| // portletService = portletContext.getService(SMOnlineDelegate.class);
| // delegate = (SMOnlineDelegate)portletService;
| // } catch (Exception e) {
| // e.printStackTrace();
| // }
|
By the delegating methods I mean our "interface" towards the backend. All our EJBs are deployd and bound to the correct JNDI's.
I get the ClassCastException you see below...
15:27:30,890 ERROR [STDERR] Caused by: java.lang.ClassCastException
15:27:30,890 ERROR [STDERR] at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
15:27:30,890 ERROR [STDERR] at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
15:27:30,890 ERROR [STDERR] at com.te.unitor.portlets.VesselSearch.getRemoteFacade(VesselSearch.java:892)
15:27:30,890 ERROR [STDERR] at com.te.unitor.portlets.VesselSearch.getOnlineDelegate(VesselSearch.java:970)
15:27:30,890 ERROR [STDERR] at com.te.unitor.portlets.VesselSearch.init(VesselSearch.java:132)
15:27:30,890 ERROR [STDERR] at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.initPortlet(PortletContainerImpl.java:359)
15:27:30,906 ERROR [STDERR] at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.start(PortletContainerImpl.java:233)
15:27:30,906 ERROR [STDERR] ... 73 more
15:27:30,906 ERROR [STDERR] Caused by: java.lang.ClassCastException: $Proxy314
15:27:30,906 ERROR [STDERR] at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:212)
15:27:30,906 ERROR [STDERR] ... 79 more
Thanks,
Petter
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246990#4246990
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246990
16 years, 9 months
[JBoss jBPM] - Re: task due date
by frinux
The XML changed, but I d'ont have anything with reminder, but :
<task-node name="valider_demande">
| <description>
| Le valideur doit valider ouy refuser manuellement la demande émise
| </description>
| <task name="valider_demande">
| <description>
| Le valideur doit valider ou refuser la demande de congé effectuée par le collaborateur. Si, lorsque la demande débute, le valideur n'a pas pris de décision, elle est automatiquement validée.
| </description>
| <assignment class="logica.actions.ValideurAssignmentHandler"></assignment>
| <controller class="logica.actions.EndTaskControllerHandler"></controller>
| </task>
| <timer duedate="1 minute" name="waitForApproval" transition="validee">
| <script name="alert">
| System.out.println("trop tard : validee !");
| </script>
| </timer>
| <transition to="notifier_acceptation" name="validee"></transition>
| <transition to="notifier_refus" name="refusee"></transition>
| </task-node>
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246981#4246981
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246981
16 years, 9 months