Tomcat server - JBPM - Takes 3 hours to start - java

I'm trying to deploy the jBPM 6.1.0.Final version code using Spring on Tomcat 6.0 server. It is taking more than 3 hours to start the RuntimeManager when server starts. I have used below :
1) Spring integration
2) Added process and task lifecycle listeners
3) Used singleton session strategy
I am not sure why it is taking so much time to deploy. With JBPM 5.4 it worked just fine.
I have taken the thread dump and memory dump, but there is nothing out of the ordinary. Are there any other ways I can view exactly which threads are hogging the time?
EDIT - Java version 6, Tomcat version 6

So the issue has been identified. The bottle neck was with http://www.omg.org/spec/BPMN/20100524 namespace. There were several such namespaces included in the BPM XML file for XSD. But they weren't getting loaded. The root cause is an Eclipse plugin bug for BPMN2 plugin that generates incorrect XSD definitions in the XML file. By removing all XSD definitions except BPMN2.0.xsd it started correctly.

Related

Jboss EAP 7.4.1 configuration issues

I am trying to bring one of the environments EAP 7.0 to EAP7.4.1 and I have managed to migrate one of the environments successfully. However, on one of the environments, as soon as I start EAP after upgrade in the domain mode, the server runs out of memory with the error below:
> "WFLYCTL0030: No resource definition is registered for address [
> (\"host\" => \"somehost-server-1\"),
> (\"server\" => \"server-1\"),
> (\"core-service\" => \"platform-mbean\"),
> (\"type\" => \"operating-system\") ]"
I have tried to copy the exact configuration as the other environment where EAP is running smoothly and find no difference. I couldn't find any help if I try to find this error, all I can see is that it has something to do with the Monitoring service of Jboss EAP. Can someone help?
I found the issue, apparently jberet was internally trying to fetch details about the job executions from the table(JDBC repository). And since there was a lot of rows in that table, the committed heap size would run out.
After I deleted rows from that table, the server looks stable and everything runs smoothly. I wonder how the server handles a large load since it is constantly trying to fetch that data. Is there an alternate to the solution?

Websphere object cahce Implementation not working

Tried using DistributedObjectCache for sharing data between clusters in WAS liberty server.
I have configured things based on IBM Distributed Map
I used Method 5 from the link, my server version is 7 and web.xml version is 2.4
After the configurations on my "server.xml" and ibm-web-bnd.xmi, I have used the below code to get the map instance on the application start.
DistributedObjectCache dm1a =(DistributedObjectCache)ic.lookup("java:comp/env/dmap/LayoutCache");
the dm1a is always null
As the servlet cache is used for caching JSP pages. etc, I need to cache java object so I used DistributedObjectCache
I am not sure that the .xmi file is getting read by the server, because I have tested by changing the webapp reference in there which was different from web.xml, but no error was thrown on the server startup
Is there anything i am missing?

More than 20 minutes to start Spring application. How to reduce it?

I'm maintaining an old Spring project and it's startup time is very long. The app is running under Tomcat 7 and using Hibernate 4.3 + PostgreSQL 9.5. This is the log from IntelliJ IDEA that is being written on app start (uploaded to Pastebin due to SO post length limitations). Notice that time gap between 3rd and 2nd lines from the bottom. It seems that nothing is happening during that time. I've tried to set all log levels to TRACE but still haven't seen any other output to log. The question is how can I reduce the startup time? This is the things I've already tried:
set default-lazy-init=true on the main context configuration file;
set hibernate.hbm2ddl.auto to none on the persistance config;
set hibernate.temp.use_jdbc_metadata_defaults to false on the persistance config.
Non of them produced any measurable results. What else can I try? At least how can I understand what is happening during all this time?
I would suggest you to copy the .war file of your application to the webapps folder and let tomcat do the deployment, it is quicker and will save your time.
Tomcat supports hot deployment. Tomcat monitors the deployment directory for changes, so you can just copy the .war file into that directory, and the server will undeploy/redeploy.
You can write a script using ANT to automate the deployment process.

Preventing ViewExpiredException with JSF 2 after redeploy

I have a problem where every time I redeploy my app, any existing sessions are broken and the requests result in a ViewExpiredException. None of the advice in related questions or outside mailing list / forum posts seems to fix this issue. I can redeploy the same WAR file completely unchanged and the behavior is the same.
I'm using Apache MyFaces 2.2.0, Tomcat 7.0.56 and Primefaces 5.0.
The message of the exception is No saved view state could be found for the view identifier: with whatever page would be requested. Primefaces' menubar is used for navigation, which seems to be implemented as a <form> with POST requests. These messages occur both with those navigation options and other AJAX that uses POST.
I have tried:
Setting explicit org.apache.myfaces.SECRET and org.apache.myfaces.MAC_SECRET values, as seen in this document.
Both client and server values for the javax.faces.STATE_SAVING_METHOD parameter.
Ensuring all beans and their transitive fields are serializable. No serialization errors are reported in the logs.
Using a filter to add no-cache headers, e.g. as suggested in this answer.
Session persistence is not disabled, that is my context.xml has <Manager pathname="" /> commented out.
try with:
<Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="true"/>
It seems that losing sessions is a "feature" of Tomcat since at least version 6 and continuing to version 7 when deploying via WAR file. We have to copy an unpacked directory to avoid losing the sessions, because WAR changes cause an undeploy followed by a deploy, as opposed to a reload.
This bug report states:
There are ways to achieve an update to an application without dropping the sessions. The simplest is probably:
- deploy as an exploded directory rather than a WAR
- update the files
- touch web.xml to trigger a reload
The reason for the current behaviour is to prevent problems when WARs are updated in incompatible ways and anything other than a full undeploy followed by (essentially) a new deployment causes conflicts.
This is still the case in the current Tomcat 7.0 documentation:
Currently, application reloading (to pick up changes to the classes or web.xml file) is not supported when a web application is deployed directly from a WAR file. It only works when the web application is deployed from an unpacked directory.

Toplink runtime error in Tomcat 6

Let me give a little background to give context to this question. Over the course of time, the application I have been assigned to work on lost the ability to be built and deployed as a full application. By that I mean the previous developer compiled the code in his local IDE, and dropped single class files, as opposed to building out proper JARs and WARs to be deployed out to tomcat. So I have been tasked to clean up the project so it is a standard deployable app again. So to sum up the important part, the application exists in a working format on a windows tomcat environment, that hasn't had a clean deploy in a long time, my goal is to make the app buildable and deployable via a jenkins CI server to a tomcat instance running on a Linux server. Now on to the problem. I get the following toplink exception in one application module.
Local Exception Stack:
Exception [TOPLINK-6007] (OracleAS TopLink - 10g (9.0.4) (Build 031126)): oracle.toplink.exceptions.QueryException
Exception Description: Missing descriptor for [class edu.cornell.finsys.datamodel.AccountDTO].
Query: ReadObjectQuery(edu.cornell.finsys.datamodel.AccountDTO)
I have verified that the toplink mapping file has been loaded by tomcat, and the AccountDTO is mapped in the file. To double check that, I have moved the mapping file out, and I get a completly different error at load time. I know the file mapping is correct, as it worked correctly on the old server. I don't know what else could be causing the toplink exception.
For more information, I am on tomcat version 6.0.37, Java version 1.6.0_45, toplink version 9.0.4.031126
Any ideas?
This may be it; right from Metalink:
Cause:
This is an issue with loading the sessions.xml file, once when the application was first deployed using that application's classloader and then not reloading the session when the application was redeployed and a new XMLContext was created. The caused us to attempt to use a session that had been loaded with a different classloader than the current application.
Possible solution:
The issue occurs when TopLink is part of the main classpath (Eg: Applib directory rather than stored in the ear file). When this happens, the static SessionManager has trouble finding descriptors the second and subsequent times an application is deployed. Basically the descriptors are indexed by class. When the application is redeployed, the classes used for the indexing are unloaded and new versions of those classes appear. This causes "Descriptor not found" exceptions.
Potential Workarounds
Put the toplink.jar file in the ear.
Write some code to manually clean up when the toplink application is torn down.
For certain architectures they may be able to use the version sessionManager.getSession() that allows the session to be refreshed.
Workaround 3 is best and very feasible. The session has to be lazily
obtained from the SessionManager and held in an application code
variable. When the application is restarted its handle on the TopLink
session will be null. The session can then be obtained from the
SesssionManager using the getSession(XMLLoader xmlLoader, String
sessionName, ClassLoader objectClassLoader, boolean
shouldLoginSession, boolean shouldRefreshSession) API with
shouldRefreshSession set to true. This will ensure that the old
session (if any) is logged out and removed from the SessionManager
before a new one is created.
Did any of the workarounds help?

Categories