I had recently installed java adopt JDK 1.8.0_202 version.
It worked fine for the first time and later when i start hybris server getting the below issue again & again on console :
JVMJ9GC063E Unable to open file '/opt/hybris/log/tomcat/java_gc_ger-d-maa-apsp-001.log' for writing
<allocation-stats totalBytes="223210880" >
<allocated-bytes non-tlh="13688" tlh="223197192" />
<largest-consumer threadName="localhost-startStop-1" threadId="0000000002F7B000" bytes="217285784" />
</allocation-stats>
<gc-op id="2563" type="scavenge" timems="53.990" contextid="2560" timestamp="2019-03-14T15:18:57.791">
<scavenger-info tenureage="14" tenuremask="4000" tiltratio="88" />
<memory-copied type="nursery" objects="394430" bytes="16048744" bytesdiscarded="115760" />
<finalization candidates="204" enqueued="174" />
<ownableSynchronizers candidates="3195" cleared="7" />
<references type="soft" candidates="9645" cleared="0" enqueued="0" dynamicThreshold="32" maxThreshold="32" />
<references type="weak" candidates="6673" cleared="84" enqueued="67" />
</gc-op>
<gc-end id="2564" type="scavenge" contextid="2560" durationms="54.398" usertimems="46.801" systemtimems="0.000" timestamp="2019-03-14T15:18:57.791" activeThreads="2">
<mem-info id="2565" free="564246568" total="1073741824" percent="52">
<mem type="nursery" free="224266520" total="268435456" percent="83">
<mem type="allocate" free="224266520" total="240451584" percent="93" />
<mem type="survivor" free="0" total="27983872" percent="0" />
</mem>
<mem type="tenure" free="339980048" total="805306368" percent="42" macro-fragmented="3110739">
<mem type="soa" free="299715344" total="765041664" percent="39" />
<mem type="loa" free="40264704" total="40264704" percent="100" />
</mem>
<pending-finalizers system="174" default="0" reference="67" classloader="0" />
<remembered-set count="33247" />
</mem-info>
</gc-end>
<cycle-end id="2566" type="scavenge" contextid="2560" timestamp="2019-03-14T15:18:57.792" />
<allocation-satisfied id="2567" threadId="0000000002F7B000" bytesRequested="48" />
<af-end id="2568" timestamp="2019-03-14T15:18:57.792" threadId="0000000002F7B988" success="true" from="nursery"/>
<exclusive-end id="2569" timestamp="2019-03-14T15:18:57.792" durationms="55.438" />
<exclusive-start id="2570" timestamp="2019-03-14T15:19:06.478" intervalms="8740.918">
<response-info timems="0.039" idlems="0.039" threads="0" lastid="0000000002F7B000" lastname="localhost-startStop-1" />
</exclusive-start>
<af-start id="2571" threadId="0000000002F7B988" totalBytesRequested="24" timestamp="2019-03-14T15:19:06.478" intervalms="8740.939" type="nursery" />
<cycle-start id="2572" type="scavenge" contextid="0" timestamp="2019-03-14T15:19:06.478" intervalms="8740.941" />
<gc-start id="2573" type="scavenge" contextid="2572" timestamp="2019-03-14T15:19:06.479">
<mem-info id="2574" free="339975744" total="1073741824" percent="31">
<mem type="nursery" free="0" total="268435456" percent="0">
<mem type="allocate" free="0" total="240451584" percent="0" />
<mem type="survivor" free="0" total="27983872" percent="0" />
</mem>
<mem type="tenure" free="339975744" total="805306368" percent="42">
<mem type="soa" free="299711040" total="765041664" percent="39" />
<mem type="loa" free="40264704" total="40264704" percent="100" />
</mem>
<remembered-set count="34712" />
</mem-info>
</gc-start>
Any help would be appreciated?
Thanks,
Mohammed
This logs produced by -verbose:gc (or similar) JVM option.
You should remove that option if you don't need this logs.
Related
I am having trouble with getting specific information from my xml using stax. Inside my xml I have a current and average which both have a traveltime inside them. But I only want to get the traveltime from the current and not from the average. Here is how my xml looks like:
<allroutes>
<routes>
<route identification="id_1">
<current>
<traveltime time="1187" trustworthy="j" />
<delay time="0" trustworthy="j" />
</current>
<average>
<traveltime time="1187" trustworthy="j" />
<delay time="0" trustworthy="j" />
</average>
</route>
<route identification="id_2">
<current>
<traveltime time="995" trustworthy="j" />
<delay time="0" trustworthy="j" />
</current>
<average>
<traveltime time="995" trustworthy="j" />
<delay time="0" trustworthy="j" />
</average>
</route>
</routes>
<subpaths>
<subpath identification="id_1">
<current>
<traveltime time="0" trustworthy="n" />
<delay time="0" trustworthy="n" />
</current>
<average>
<traveltime time="0" trustworthy="n" />
<delay time="0" trustworthy="n" />
</average>
</subpath>
<subpath identification="id_2">
<current>
<traveltime time="0" trustworthy="n" />
<delay time="0" trustworthy="n" />
</current>
<average>
<traveltime time="0" trustworthy="n" />
<delay time="0" trustworthy="n" />
</average>
</subpath>
</subpaths>
</allroutes>
The code that I have currently looks like this:
try{
while (streamReader.hasNext()) {
streamReader.next();
if (streamReader.getEventType() == XMLStreamReader.START_ELEMENT) {
switch (streamReader.getLocalName()) {
case "route":
//store which type
break;
case "subpath":
//store which type
break;
case "traveltime":
//store traveltime
break;
}
}
if (streamReader.getEventType() == XMLStreamReader.END_ELEMENT && "allroutes".equals(streamReader.getLocalName())) {
//stop the loop and give back the object
}
}
}catch(XMLStreamException ex) {
LOGGER.log(Level.SEVERE, "XMLStreamException: " + ex);
}
What do I need to add / change to only get the traveltime from 'current' inside this reader?
You just have to keep track of where you are in the document. For example, it's common practice to keep a stack of element names: push a name onto the stack when you hit a startElement, pop it off when you hit endElement, and then inspect the stack to discover the context of the element you are currently processing.
We're going to build a workflow management system and We're embedding the camunda engine Rest API into our Rest Application.
Now I have Inventory defined like this:
public class Inventory {
private String objectName;
private int objectCount;
// getters and setters
}
and this is a sample workflow:
in xml:
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.11.3">
<bpmn:process id="test" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_1v6clcy</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="SequenceFlow_1v6clcy" sourceRef="StartEvent_1" targetRef="testtask" />
<bpmn:userTask id="testtask" name="testtask" camunda:formKey="testform">
<bpmn:extensionElements>
<camunda:formData>
<camunda:formField id="inventories" label="name" type="List<org.example.Inventory>" />
</camunda:formData>
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_1v6clcy</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_07kdfp4</bpmn:outgoing>
</bpmn:userTask>
<bpmn:endEvent id="EndEvent_0vm605w">
<bpmn:incoming>SequenceFlow_07kdfp4</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_07kdfp4" sourceRef="testtask" targetRef="EndEvent_0vm605w" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="test">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="173" y="102" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1v6clcy_di" bpmnElement="SequenceFlow_1v6clcy">
<di:waypoint xsi:type="dc:Point" x="209" y="120" />
<di:waypoint xsi:type="dc:Point" x="275" y="120" />
<bpmndi:BPMNLabel>
<dc:Bounds x="242" y="99" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="UserTask_1s01hea_di" bpmnElement="testtask">
<dc:Bounds x="275" y="80" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_0vm605w_di" bpmnElement="EndEvent_0vm605w">
<dc:Bounds x="439" y="109" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="412" y="149" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_07kdfp4_di" bpmnElement="SequenceFlow_07kdfp4">
<di:waypoint xsi:type="dc:Point" x="375" y="120" />
<di:waypoint xsi:type="dc:Point" x="407" y="120" />
<di:waypoint xsi:type="dc:Point" x="407" y="127" />
<di:waypoint xsi:type="dc:Point" x="439" y="127" />
<bpmndi:BPMNLabel>
<dc:Bounds x="377" y="117.5" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
I'll eventually have a html form which will submit something like this:
{
"inventories" : [{"name": "banana","count": 3},{"name":"orange","count": 4}]
}
I want to submit this to /task/{id}/submit-form but I don't know what to put as type.
I tried putting the type in modeler as List<org.example.Inventory> but the rest api throws an exception when deploying the process definition like this:
org.camunda.bpm.engine.ProcessEngineException: ENGINE-09005 Could not parse BPMN process. Errors:
* unknown type 'List' | org.example/PM.bpmn | line 65 | column 90
I've seen this example as well but I'm only using the Rest API not the whole bpm platform(besides we prefer to have pure html forms).
So how to do it ? what should I put in type ?
my camunda.cfg.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="processEngineConfiguration" class="org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration">
<property name="jdbcUrl" value="jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000" />
<property name="jdbcDriver" value="org.h2.Driver" />
<property name="jdbcUsername" value="sa" />
<property name="jdbcPassword" value="" />
<property name="databaseSchemaUpdate" value="true" />
</bean>
</beans>
my processengineprovider:
public class MyProcessEngineProvider implements ProcessEngineProvider {
#Override
public ProcessEngine getDefaultProcessEngine() {
ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();
RepositoryService repositoryService = engine.getRepositoryService();
repositoryService.createDeployment()
.addClasspathResource("org.newtech/PM.bpmn")
.deploy();
return engine;
}
#Override
public ProcessEngine getProcessEngine(String s) {
return getDefaultProcessEngine();
}
#Override
public Set<String> getProcessEngineNames() {
Set<String> names = new HashSet<>(1);
names.add("default");
return names;
}
}
Process Compilation error : org.drools.lang.descr.ProcessDescr#4c60d6e9
com/sample/Process_com_sample_ruleflowsample.java (21:862) : Type mismatch: cannot convert from int to String
com/sample/Process_com_sample_ruleflowsample.java (29:1151) : Type mismatch: cannot convert from int to String
This is my ruleflowsample.rf under src/main/rules that is throwing the above error.
<?xml version="1.0" encoding="UTF-8"?>
<process xmlns="http://drools.org/drools-5.0/process"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://drools.org/drools-5.0/process drools-processes-5.0.xsd"
type="RuleFlow" name="ruleflowsample" id="com.sample.ruleflowsample" package-name="com.sample" >
<header>
<imports>
<import name="com.sample.Employee" />
</imports>
<variables>
<variable name="caffeineIntake" >
<type name="org.drools.process.core.datatype.impl.type.FloatDataType" />
</variable>
</variables>
</header>
<nodes>
<start id="1" name="Start" x="12" y="129" width="48" height="48" />
<split id="2" name="Gateway" x="101" y="128" width="49" height="49" type="2" >
<constraints>
<constraint toNodeId="4" toType="DROOLS_DEFAULT" name="Coffee" priority="1" type="code" dialect="java" >return caffeineIntake>0.105F;</constraint>
<constraint toNodeId="5" toType="DROOLS_DEFAULT" name="Tea" priority="1" type="code" dialect="java" >return caffeineIntake>0.04F;</constraint>
</constraints>
</split>
<actionNode id="4" name="Coffee" x="198" y="205" width="80" height="48" >
<action type="expression" dialect="java" >String noOfCups = 1;
System.out.println("No of coffee cups = "+noOfCups);
System.out.println("caffeineIntake");</action>
</actionNode>
<actionNode id="5" name="Tea" x="196" y="61" width="80" height="48" >
<action type="expression" dialect="java" >String noOfCups = 1;
System.out.println("No of tea cups = "+noOfCups);
System.out.println("caffeineIntake");</action>
</actionNode>
<end id="6" name="End" x="386" y="127" width="48" height="48" />
<join id="7" name="Gateway" x="311" y="127" width="49" height="49" type="2" />
</nodes>
<connections>
<connection from="1" to="2" />
<connection from="2" to="4" />
<connection from="2" to="5" />
<connection from="7" to="6" />
<connection from="5" to="7" />
<connection from="4" to="7" />
</connections>
</process>
I know the error is occurring because of this line: System.out.println("caffeineIntake");
I want to access this input variable i.e. caffeineIntake to perform some operation on it.
The error is not occurring because of this line: System.out.println("caffeineIntake");
It is occurring because of the Dialect option selection:
Using this option as mvel rather than java resolved the issue.
Well,
from my point of view
String noOfCups = 1;
is the problem.
perhaps change it to
String noOfCups = "1";
I created a Process Engine, Repository Service, Runtime Service and deployed a BPMN workflow.
I also created a Process instance and was able to start it.
The issue is that when I try to either suspend or delete the process instance using the "deleteProcessInstance" method I get an error saying that the ProcessInstanceId could not be found!!
PS: I learnt somewhere that the processId in BPMN is treated as processKey in Activiti.
Code:
public void startProcess(String processDefinitionKey)
{
ListenerClass.processInstance=ListenerClass.runtimeService.startProcessInstanceByKey(processDefinitionKey);
}
public void deleteProcess(String processInstanceId)
{
System.out.println("Stopping Process instance id " +processInstanceId);
ListenerClass.runtimeService.deleteProcessInstance(processInstanceId, "Ok");
}
In the code above while starting the process instance, I pass the "Process Id" of the BPMN.xml file.(which means processId of BPMN.xml=processInstanceKey of Activiti)
My BPMN.xml:
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1" xmlns:activiti="http://activiti.org/bpmn"
targetNamespace="http://bpmn.io/schema/bpmn">
<bpmn:process id="Process_11" isExecutable="true" name="Hima">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_06sykhd</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="SequenceFlow_06sykhd" sourceRef="StartEvent_1" targetRef="Task_1dt8brv" />
<bpmn:endEvent id="EndEvent_0cb0ioi">
<bpmn:incoming>SequenceFlow_1doj4n6</bpmn:incoming>
</bpmn:endEvent>
<bpmn:serviceTask id="Task_1dt8brv"
name="My Java Service Task"
activiti:class="com.bosch.bip.Service.task1" >
<bpmn:incoming>SequenceFlow_06sykhd</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_156te78</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:serviceTask id="Task_10bfll9" activiti:class="com.bosch.bip.Service.task1">
<bpmn:incoming>SequenceFlow_156te78</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1doj4n6</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_156te78" sourceRef="Task_1dt8brv" targetRef="Task_10bfll9" />
<bpmn:sequenceFlow id="SequenceFlow_1doj4n6" sourceRef="Task_10bfll9" targetRef="EndEvent_0cb0ioi" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_11">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="173" y="102" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_06sykhd_di" bpmnElement="SequenceFlow_06sykhd">
<di:waypoint xsi:type="dc:Point" x="209" y="120" />
<di:waypoint xsi:type="dc:Point" x="264" y="120" />
<di:waypoint xsi:type="dc:Point" x="264" y="147" />
<di:waypoint xsi:type="dc:Point" x="318" y="147" />
<bpmndi:BPMNLabel>
<dc:Bounds x="219" y="123.5" width="90" height="20" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="EndEvent_0cb0ioi_di" bpmnElement="EndEvent_0cb0ioi">
<dc:Bounds x="768" y="173" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="741" y="209" width="90" height="20" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_1dt8brv_di" bpmnElement="Task_1dt8brv">
<dc:Bounds x="318" y="107" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_10bfll9_di" bpmnElement="Task_10bfll9">
<dc:Bounds x="528" y="94" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_156te78_di" bpmnElement="SequenceFlow_156te78">
<di:waypoint xsi:type="dc:Point" x="418" y="147" />
<di:waypoint xsi:type="dc:Point" x="473" y="147" />
<di:waypoint xsi:type="dc:Point" x="473" y="134" />
<di:waypoint xsi:type="dc:Point" x="528" y="134" />
<bpmndi:BPMNLabel>
<dc:Bounds x="386" y="202.5" width="90" height="20" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1doj4n6_di" bpmnElement="SequenceFlow_1doj4n6">
<di:waypoint xsi:type="dc:Point" x="628" y="134" />
<di:waypoint xsi:type="dc:Point" x="698" y="134" />
<di:waypoint xsi:type="dc:Point" x="698" y="191" />
<di:waypoint xsi:type="dc:Point" x="768" y="191" />
<bpmndi:BPMNLabel>
<dc:Bounds x="653" y="152.5" width="90" height="20" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
Any help in this regards would be really helpful.
For a running process use this, as you did above:
runtimeService.deleteProcessInstance(processInstanceId, null);
If the process has been ended you need to delete it from the history, maybe your process has already ended?
HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery()
.processInstanceId(processInstanceId).singleResult();
if (historicProcessInstance != null) {
historyService.deleteHistoricProcessInstance(historicProcessInstance.getId());
}
I'm trying to marshal a POJO into a CSV using camel-bindy, using the following setup:
<bean id="bindyDataFormat" class="org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat">
<constructor-arg value="com.foo.kod.domain" />
<camel:route>
<camel:from uri="ref:kod.handler.list.in.csv" />
<camel:choice>
<camel:when>
<camel:xpath>$Accept = 'application/json' </camel:xpath>
<camel:to uri="bean:handlerListProcessor?method=process" />
<camel:marshal ref="myJSON" />
</camel:when>
<camel:when>
<camel:xpath>$Accept = 'text/csv' </camel:xpath>
<camel:to uri="bean:handlerListProcessor?method=process" />
<camel:marshal ref="bindyDataformat">
<camel:bindy type="Csv" packages="com.foo.kod.domain"/>
</camel:marshal>
</camel:when>
<camel:otherwise>
<camel:to uri="bean:handlerListProcessor?method=process" />
<camel:marshal ref="myJSON" />
</camel:otherwise>
</camel:choice>
</camel:route>
But this throws a ClassCastException each time:
java.lang.ClassCastException: com.foo.kod.domain.Handler cannot be cast to java.util.Map
at org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.marshal(BindyCsvDataFormat.java:93)
at org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:58)
at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
at org.apache.camel.fabric.FabricTraceProcessor.process(FabricTraceProcessor.java:81)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)