Showing posts with label Application Server. Show all posts
Showing posts with label Application Server. Show all posts

Saturday, December 12, 2015

Multiple time Invoking custom Nucleus initializer for Apache Tomcat in JBOSS EAP 6 and ATG 11


Issue:

During server startup in JBOSS EAP 6.X version with ATG 11, nucleus tries to initialize multiple times.
It prints the CLASSPATH and CONFIGPATH multiple times in logs.
You may see errors like ERROR [stderr] (ServerService Thread Pool -- 52)   at atg.nucleus.servlet.NucleusServlet.init(NucleusServlet.java:465)

The stack trace could also be:
ERROR [stderr] (ServerService Thread Pool -- 126) java.lang.NoSuchFieldException: policy
ERROR [stderr] (ServerService Thread Pool -- 126)  at java.lang.Class.getDeclaredField(Class.java:1953)
ERROR [stderr] (ServerService Thread Pool -- 126)  at atg.servlet.ServletUtil.setJBoss5PageCompileClasspath(ServletUtil.java:680)
ERROR [stderr] (ServerService Thread Pool -- 126)  at atg.nucleus.servlet.NucleusServlet.setJBoss5PageCompileClasspath(NucleusServlet.java:1371)
ERROR [stderr] (ServerService Thread Pool -- 126)  at atg.nucleus.servlet.NucleusServlet.initBigEarNucleus(NucleusServlet.java:1299)
ERROR [stderr] (ServerService Thread Pool -- 126)  at atg.nucleus.servlet.NucleusServlet.init(NucleusServlet.java:465)
ERROR [stderr] (ServerService Thread Pool -- 126)  at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1194)
ERROR [stderr] (ServerService Thread Pool -- 126)  at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1100)
ERROR [stderr] (ServerService Thread Pool -- 126)  at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3593)
ERROR [stderr] (ServerService Thread Pool -- 126)  at org.apache.catalina.core.StandardContext.start(StandardContext.java:3802)
ERROR [stderr] (ServerService Thread Pool -- 126)  at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163)
ERROR [stderr] (ServerService Thread Pool -- 126)  at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61)
ERROR [stderr] (ServerService Thread Pool -- 126)  at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96)
ERROR [stderr] (ServerService Thread Pool -- 126)  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
ERROR [stderr] (ServerService Thread Pool -- 126)  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
ERROR [stderr] (ServerService Thread Pool -- 126)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
ERROR [stderr] (ServerService Thread Pool -- 126)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
ERROR [stderr] (ServerService Thread Pool -- 126)  at java.lang.Thread.run(Thread.java:745)
ERROR [stderr] (ServerService Thread Pool -- 126)  at org.jboss.threads.JBossThread.run(JBossThread.java:122)
ERROR [stderr] (ServerService Thread Pool -- 61) java.lang.NoSuchFieldException: policy
ERROR [stderr] (ServerService Thread Pool -- 61)   at java.lang.Class.getDeclaredField(Class.java:1953)


Cause:

 JBOSS 6  introduce a new element <initialize-in-order> element in <ear>/META_INF/application.xml

Solution:

When running runAssembler use the argument -jboss which adds the <initialize-in-order> element in application.xml


Thursday, November 19, 2015

How to change the default APEX port 8080

When you install Oracle XE, it uses the JBoss default 8080 port and conflict with JBoss.
So to change the apex port follow below steps:

1. Login into sqlplus or sqldeveloper using system/<password>
2. Execute the below command:
EXEC DBMS_XDB.SETHTTPPORT(8087);


Now port has changed and can connect apex with http://localhost:8087

Thursday, November 5, 2015

Setting up Certificate for enabling SSL in JBOSS 4 and JBOSS 5

The instructions below is for setting up a development Certificate in jboss. This is required for enabling a SSL connection for our jboss app server.
Instructions:
1. open a command prompt window
2. Go to your ATG jboss Conf directory. i.e.: (C:\atg\jboss-4.0.3SP1\server\atg\conf)
3. Then run the following command "keytool -keystore keystore -alias jboss -genkey -keyalg RSA"
4.  While in the Keytool program:  Provide a password that you will remember:  example:  "changeit"
5. Then just press Enter on all the other functions. No need to provide any data in those fields.
6. Finally Answer "y" to continue.
7. Now go to your jboss Tomcat deploy directory: i.e.: (c:\atg\jboss-4.0.3SP1\server\atg\deploy\jbossweb-tomcat55.sar\)
8. Open the "server.xml" file in a text editor of your choosing.
9. uncomment and edit the following. Make sure you use the same "keystorePass" as the one you entered earlier in step 4:
  <Connector port="8443" address="${jboss.bind.address}"
          maxThreads="100" strategy="ms" maxHttpHeaderSize="8192"
          emptySessionPath="true"
          scheme="https" secure="true" clientAuth="false"
          keystoreFile="${jboss.server.home.dir}/conf/keystore"
          keystorePass="changeit" sslProtocol = "TLS" />
10. Start your ATG server, and port 8443 should now be your SSL enabled URL. You should now be able to use your browser to access the following    URL: "https://localhost:8443"

Modifying the default JSESSIONID cookie name

In Servlet 3.0 API

Modify the web.xml


<session-config>
    <cookie-config>
        <name>MY_JSESSIONID_YAHOOOOOO</name>
    </cookie-config>
</session-config>



Modify default JBOSS JSESSIONID cookie


There will be cases we need to modify the default JSESSIONID for all the applications deployed on the server.
In that case add below java startup argument.

-Dorg.apache.catalina.JSESSIONID=PSESSIONID



Modify JSESSIONID in WebLogic 


In Weblogic we can either modify a particular war at <war>/WEB-INF/weblogic.xml or or entire ear at <ear>/META-INF/weblogic-application.xml

Below is sample weblogic-application.xml

<?xml version="1.0" encoding="UTF-8"?><wls:weblogic-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-application.xsd"> <wls:session-descriptor>  
         <wls:cookie-name>PSESSIONID</wls:cookie-name>
</wls:session-descriptor></wls:weblogic-application>