How to change deployment order in WebLogic? - deployment

According to this documentation it is possible to change deployment order in WebLogic:
http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13952/taskhelp/deployment/ChangeTheServerDeploymentOrder.html
For example I have two web applications app1.war and app2.ear.
I set "Deployment order" to 1 for app1.war.
And "Deployment order" 100 for app2.ear.
Does it mean that app1.war will be up and running prior WebLogic starting to launch app2.ear?
Unfortunately it does not work fo me. WebLogic starting to launch app1.war but then it starting to launch app2.ear when app1.war is not in STATE_ACTIVE yet.

I think it will start and then complete the launching as per that order. I have tested on my server
It performs the following sequence.
One thread runs through all the apps in the deployment order and transitions all of them to PREPARED, then to ADMIN then to ACTIVE
In my example below, dms.war is set at 50 and portletapp is set at 100 as deployment order.
Thread 0 runs to make all to PREPARED and ADMIN
Thread 1 starts running to make them ACTIVE
####<04-Feb-2011 17:02:05 > <Info> <Deployer> <DefaultServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1296819125939> <BEA-149060> <Module dms.war of application DMS Application [Version=11.1.1.1.0] successfully transitioned from STATE_NEW to STATE_PREPARED on server DefaultServer.>
####<04-Feb-2011 17:02:19 > <Info> <Deployer> <DefaultServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1296819139834> <BEA-149060> <Module portletapp of application wsrp-samples [Version=11.1.1.2.0] successfully transitioned from STATE_NEW to STATE_PREPARED on server DefaultServer.>
####<04-Feb-2011 17:03:25 > <Info> <Deployer> <DefaultServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1296819205627> <BEA-149060> <Module dms.war of application DMS Application [Version=11.1.1.1.0] successfully transitioned from STATE_PREPARED to STATE_ADMIN on server DefaultServer.>
####<04-Feb-2011 17:03:33 > <Info> <Deployer> <DefaultServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1296819213183> <BEA-149060> <Module portletapp of application wsrp-samples [Version=11.1.1.2.0] successfully transitioned from STATE_PREPARED to STATE_ADMIN on server DefaultServer.>
####<04-Feb-2011 17:04:57 > <Info> <Deployer> <DefaultServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <00e884cc3b492be0:-20717040:12df0741b5b:-8000-0000000000000006> <1296819297757> <BEA-149060> <Module dms.war of application DMS Application [Version=11.1.1.1.0] successfully transitioned from STATE_ADMIN to STATE_ACTIVE on server DefaultServer.>
####<04-Feb-2011 17:04:57 > <Info> <Deployer> <DefaultServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <00e884cc3b492be0:-20717040:12df0741b5b:-8000-0000000000000006> <1296819297767> <BEA-149060> <Module portletapp of application wsrp-samples [Version=11.1.1.2.0] successfully transitioned from STATE_ADMIN to STATE_ACTIVE on server DefaultServer.>

In your example, thread 1 puts two applications "dms.war" and "portletapp" to ACTIVE at the same time. If indeed the 2nd app depends on the 1st app, the 2nd app would fail. Maybe in your testing, it happens there is no such dependency?

If you have not already done so, in the Change Center of the Administration Console, click Lock & Edit (see Use the Change Center).
In the left pane of the Administration Console, select Deployments. The right pane displays all modules configured for deployment in the domain, listed in their current deployment order.
In the right pane, click the name of the module for which you want to change the deployment order.
In the Overview tab that displays, enter a new value in the Deployment Order field, and click Save to apply your changes.
To change the deployment order of a Startup class, follow the instructions in Configure startup classes.
To activate these changes, in the Change Center of the Administration Console, click Activate Changes.
Not all changes take effect immediately—some require a restart (see Use the Change Center).

Related

JBoss AS 7.1 server is failing to deploy ear applications during the startup process regardless of the default-timeout set in deployment scanner

One of our JBoss Application Server version 7.1 is failing to deploy ear applications during the startup process. I have tried many different values for the default-timeout parameter (600secs, 1200secs, 2400secs) in the deployment scanner section of the standalone.xml file. It keeps on failing with the same message no matter the value set for the default-timeout.
It used to work just fine till yesterday with the default-timeout set at 300 secs. Please find the error message in the "Error Message" section below.
Along with trying out different default-timeout values, i have also tried removing cache such as renaming or removing tmp directory several times before restarting.
What can I try to fix this?
Error Message:
15:46:01,732 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015052: Did not receive a response to the deployment operation within the allowed timeout period [600 seconds]. Check the server configuration file and the server logs to find more about the status of the deployment.
15:46:01,734 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015052: Did not receive a response to the deployment operation within the allowed timeout period [600 seconds]. Check the server configuration file and the server logs to find more about the status of the deployment.
15:46:01,733 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015871: Deploy of deployment "ServerApps.ear" was rolled back with no failure message
15:46:01,736 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015052: Did not receive a response to the deployment operation within the allowed timeout period [600 seconds]. Check the server configuration file and the server logs to find more about the status of the deployment.
15:46:01,736 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015871: Deploy of deployment "bpm.ear" was rolled back with no failure message
15:46:01,776 INFO [javax.enterprise.resource.webservices.jaxws.servlet.http] (MSC service thread 1-1) WSSERVLET15: JAX-WS servlet destroyed
15:46:01,779 INFO [javax.enterprise.resource.webservices.jaxws.server.http] (MSC service thread 1-1) WSSERVLET13: JAX-WS context listener destroyed
The error may cause due to the init() method of Servlet or other EE component was calling System.exit() which triggers shutdown hook to run. The JBoss Modular Service Container or MSC registers a hook and when triggered it shuts down the container. The container shutdown operation needs to wait until the EAR deployment over so that it knows if the deployment succeeded or failed. This may cause the deadlock as the System.exit() call waits until the hooks finish its execution and deadlock will be broken when the deployment gets failed due to timeout and release the MSC and continue with the shutdown.
You can try to collect the thread dumps and see if there is
A "MSC service thread" which has called into System.exit() or Runtime.exit(), and is waiting until the shutdown hooks complete.
The "MSC Shutdown Hook" thread, which is waiting for a CountDownlatch

tomcat conf/context.xml - Property 'factory' not supported

I'm trying to change the connection pool of my web app to use the Tomcat Connection pool (org.apache.tomcat.jdbc.pool.DataSourceFactory). So, I added the factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" line into the conf/context.xml file, like below:
<Context>
<Resource
type="javax.sql.DataSource"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
name="jdbc/mcbell"
auth="Application"
maxActive="50"
maxIdle="30"
maxWait="10000"
removeAbandoned="true"
removeAbandonedTimeout="1200"
logAbandoned="true"
driverClassName="com.ibm.as400.access.AS400JDBCDriver"
url="jdbc:as400://mcbell4;secure=true;naming=system;errors=full;prompt=false;libraries=*LIBL;timeFormat=iso;dateFormat=iso;dateSeparator=-"
username=""
password=""
validationQuery="select 1 from sysibm/sysdummy1"
alternateUsernameAllowed="true"
validationQueryTimeout="10"
validationInterval="30000"
testWhileIdle="true"
timeBetweenEvictionRunsMillis="30000"
minEvictableIdleTimeMillis="30000"
/>
</Context>
The reason for changing it to Tomcat connection pool is so that I can use this validationInterval property. But the validationInterval still does not seem to be working. In the log I see this warning below. Is that means that the Tomcat Connection Pool setting is not taking effect? Why is the factory property not supported?
INFO: Creating Resource(id=host-manager/jdbc/mcbell)
Nov 14, 2018 3:17:11 PM org.apache.openejb.assembler.classic.Assembler unusedProperty
WARNING: Property "factory" not supported by "host-manager/jdbc/mcbell"

How to avoid printing this WARN message in JBoss

My logs are getting hammered by below log message in JBOSS 7. Can you anyone suggest how to stop this log message.
2018-02-28 13:37:13,618 WARN [com.arjuna.ats.arjuna] (default-threads - 48) ARJUNA012141: Multiple last resources have been added to the current transaction. This is transactionally unsafe and should not be relied upon. Current resource is LastResourceRecord(XAOnePhaseResource(LocalXAResourceImpl#5d70439b[connectionListener=653eac5d connectionManager=7f6856e8 warned=false currentXid=null productName=MySQL productVersion=10.2.13-MariaDB-log jndiName=java:/jdbc/db_jndi]))
In your standalone.xml file, in the logging section, add something like this under the appropriate handler element:
<filter>
<not>
<match pattern="ARJUNA012141"/>
</not>
</filter>
Of course, you should add these lines using the jboss-cli utility. Did you know that changes to logging don't require a server restart, but will be picked up at the defined refresh interval?

Problems Deploying application to Weblogic through the Admin Console

I'm using Weblogic 10.3.5. When I deploy my Struts2 application locally in eclipse, it runs fine. When I try to deploy my application through the Admin console, I get a Struts 2 error, name not found for action.
When I look at the .war file, it has all the libraries and classes. I followed these directions for deploying through the Admin Console. I can successfully deploy through the Admin Console, but when I try and use the test links for the application, I get the same error. If I try to access the application through the url:
http://localhost:7001/app-name
I get the same error.
Here is the stack trace:
[[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default
(self-tuning)'] WARN org.apache.struts2.dispatcher.Dispatcher - Could
not find action or result: /eServices/login.action There is no Action
mapped for namespace [/] and action name [login] associated with
context path [/eServices]. - [unknown location] at
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185)
at
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)
at
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:37)
at
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:552)
at
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at
oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at java.security.AccessController.doPrivileged(Native Method) at
oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at
oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at
oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
at
oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at
oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) at
weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
What am I doing wrong? Why can I access the application when I deploy it through eclipse, but I can't access the application when I deploy it through the Admin Console.
Thanks for your help!
Sounds like your struts.xml file in WEB-INF/classes is somehow wrong when you're trying a manual deploy. Crack open your .ear/.war file and see what's in your struts.xml (if it even exists). Eclipse might be automatically putting it into a folder for you that doesn't get deployed when you do it manually. Below is a working example for reference:
<struts>
<constant name="struts.devMode" value="true" />
<package name="default" namespace="/" extends="struts-default">
<action name="myAction"
class="com.something.myAction" >
<result name="success">pages/myPage.jsp</result>
</action>
</package>
</struts>
If the project root context is “app-name“, you can access the above action via a URL like –
http://domain:8080/app-name/myAction.action

How can I debug tomcat request threads?

I have a Tomcat application running and for some reason one of my servlets is being put on hold while all the others respond while requests are being executed.
My connector config for Tomcat :
<Connector port="8008" protocol="HTTP/1.1"
maxThreads="50" minSpareThreads="5" maxSpareThreads="50"
enableLookups="false" acceptCount="100"
connectionTimeout="20000"
redirectPort="8443"
compression="off"
allowTrace="true"
compressionMinSize="128"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml,text/x-gwt-rpc; charset=utf-8,application/json; charset=utf-8,application/javascript" />
My GWT RPC servlet keeps responding while a very long request is being executed. But I created a servlet outside GWT (i.e. a plain old servlet) and when I send requests to this one, it will not respond until the long GWT request is over. It actually does not start executing at all (I added logs to see if it actually starts executing and it doesn't until the end of the log gwt request).
How can I debug the thread pool / inbounding request queue of Tomcat instance?
Look at your IDE debug settings.
For example, on IntelliJ IDEA, you need to change Suspend policy to Thread in breakpoint settings. This means that only this thread which stopped for breakpoint will block and others will continue to run as normal.