Monday, November 26, 2012

Setting Up JBoss

Hello There,

Hope everyone is doing great, me too.!!

Been in new assignment from few days, so thought could give some work for my brain.. to refurbish my JBoss ideas..!!

Started with JBoss Installation and Starting Up..!!

You will find this very simple though, thought of sharing with you in case if you find this challenging.;)

Step 1. Download JBoss Package (.zip) file from http://www.jboss.org/jbossas/downloads/

I downloaded : http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.zip as it is latest.

Step 2 : Copy the file to desired location and Unzip it.

Step 3 : Installation is Completed.

Step 4 : To Sample Start up, go to Unzipped JBoss Directory and Open the Gates of bin Directory.

Step 5 : Copy the PATH till here and navigate to bin directory from Command Prompt ( => Start-> Run-> CMD) by command cd <PATH to bin directory)

Step 6 : Once in bin directory, execute standalone.bat or standalone.sh in case if you do not have Windows Box.

Step 7 : Hold On..!!, You Should Have JAVA Installed Before You Introduce Yourself with JBoss.

Step 8 : After you execute standalone.bat file, your eyes will witness following output.

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\shailesh.dyade>cd C:\SandBox\AppServers\jboss-as-7.1.1.Final\bin


C:\SandBox\AppServers\jboss-as-7.1.1.Final\bin>standalone

Calling "C:\SandBox\AppServers\jboss-as-7.1.1.Final\bin\standalone.conf.bat"
===============================================================================

  JBoss Bootstrap Environment


  JBOSS_HOME: C:\SandBox\AppServers\jboss-as-7.1.1.Final


  JAVA: C:\Program Files\Java\jdk1.7.0_09\bin\java


  JAVA_OPTS: -XX:+TieredCompilation -Dprogram.name=standalone.bat -Xms64M -Xmx51

2M -XX:MaxPermSize=256M -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.se
rver.gcInterval=3600000 -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.war
ning=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djboss.server.default.c
onfig=standalone.xml

===============================================================================


15:09:26,732 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA

15:09:30,059 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
15:09:30,139 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" sta
rting
15:09:45,406 INFO  [org.xnio] XNIO Version 3.0.3.GA
15:09:45,406 INFO  [org.jboss.as.server] JBAS015888: Creating http management se
rvice using socket-binding (management-http)
15:09:45,440 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
15:09:45,546 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.3.GA
15:09:45,658 INFO  [org.jboss.as.configadmin] JBAS016200: Activating ConfigAdmin
 Subsystem
15:09:45,665 INFO  [org.jboss.as.clustering.infinispan] JBAS010280: Activating I
nfinispan subsystem.
15:09:45,674 INFO  [org.jboss.as.osgi] JBAS011940: Activating OSGi Subsystem
15:09:45,676 INFO  [org.jboss.as.naming] JBAS011800: Activating Naming Subsystem

15:09:45,693 INFO  [org.jboss.as.security] JBAS013101: Activating Security Subsy

stem
15:09:45,694 INFO  [org.jboss.as.webservices] JBAS015537: Activating WebServices
 Extension
15:09:45,733 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log han
dlers
15:09:45,844 INFO  [org.jboss.as.security] (MSC service thread 1-4) JBAS013100:
Current PicketBox version=4.0.7.Final
15:09:45,880 INFO  [org.jboss.as.connector] (MSC service thread 1-7) JBAS010408:
 Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
15:09:47,481 INFO  [org.jboss.as.naming] (MSC service thread 1-6) JBAS011802: St
arting Naming Service
15:09:47,485 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-6) JBAS01
5400: Bound mail session [java:jboss/mail/Default]
15:09:48,981 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread
 1-3) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080
15:09:49,160 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerServic
e Thread Pool -- 39) JBAS010403: Deploying JDBC-compliant driver class org.h2.Dr
iver (version 1.3)
15:09:49,699 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service
thread 1-7) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
15:09:51,878 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC se
rvice thread 1-5) JBoss Web Services - Stack CXF Server 4.0.2.GA
15:09:53,160 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread
1-5) JBAS015012: Started FileSystemDeploymentService for directory C:\SandBox\Ap
pServers\jboss-as-7.1.1.Final\standalone\deployments
15:09:53,199 INFO  [org.jboss.as.remoting] (MSC service thread 1-4) JBAS017100:
Listening on /127.0.0.1:9999
15:09:53,199 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100:
Listening on /127.0.0.1:4447
15:09:53,810 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin con
sole listening on http://127.0.0.1:9990
15:09:53,813 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS
7.1.1.Final "Brontes" started in 30795ms - Started 133 of 208 services (74 servi
ces are passive or on-demand)

Step 9 : As it says, Admin console Listening on http://127.0.0.1:9990/ go to this URL on your browser, do not try to click this URL right away, you have not installed the JBoss yet.!!


Here you can see the console of JBoss Application Server, which says to add user first then you will be able to see the complete console.

And to Add user we need to execute the add-user.bat script in bin directory, lets try that..!!

After you add, there will be a link to refresh the configuration - you got to click that.





C:\SandBox\AppServers\jboss-as-7.1.1.Final\bin>add-user.bat

What type of user do you wish to add?
 a) Management User (mgmt-users.properties)
 b) Application User (application-users.properties)

(a): a

Enter the details of the new user to add.
Realm (ManagementRealm) :
Username : shailesh
Password :
Re-enter Password :
About to add user 'shailesh' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'shailesh' to file 'C:\SandBox\AppServers\jboss-as-7.1.1.Final\standa
lone\configuration\mgmt-users.properties'
Added user 'shailesh' to file 'C:\SandBox\AppServers\jboss-as-7.1.1.Final\domain
\configuration\mgmt-users.properties'
Press any key to continue . . .




Enter your username and password created in above step, you can make your machine to remember the same till you brainwash him.

Once you login, you will be able to see the page, little familiar from last versions I have worked but very much different in looks, RedHat has changed the Application Server in whole, time to explore it..


Try dropping an application in the deployment folder of standalone profile and try to access.

Its your homework too, explore the same, do it and share your ideas here, you are very welcome to post comments, feedback's about the post and suggestions are very much welcome.

I will end the session here now, and will come back with more goodies of tips and technologies with all that tricks very soon in blog pages.

Take Care, 
Shailesh Dyade.



Tuesday, November 20, 2012

Web Based Link for Learning Java and Related Few Products

Hello There,

Recently found a link about learning Java Programming along with few technologies like, Tomcat, MySql, Unix, Windows, etc..

Link is : http://www3.ntu.edu.sg/home/ehchua/programming/index.html

Please go through this and share as much as this will be very helpful for Middleware Administrators.

Regards
Shailesh Dyade.

Sunday, September 30, 2012

Few YouTube Based WebLogic Server Administration Tutorials

Hello There

Below are few of the YouTube based Videos for WebLogic Server Administration, you are suggested to go through for understanding the WebLogic Server features and configuration to work with it.

1) Installing WebLogic Server
 

2) Architecture of WebLogic Server

3) WebLogic Administration Port 

 

4) Configuring the Node Manager in WebLogic Server 


5)  Creating Users and Groups by Using WebLogic Administration Console : 


 6) WebLogic Server Side-by-Side Deployment

 

7) Viewing WebLogic Server Performance 

 

8) WebLogic Server HTTP Session Replication




9) Configuring Watch Logs and Sending Emails through WebLogic Server



10) WebLogic with JRockit Mission Control And Flight Recorder.




11) Create WebLogic Diagnostics Image with Metric Threshoulds

 

12)  WebLogic Server 11g R1 PS3 (10.3.4) New Features Overview

13) How to Apply the patch in WebLogic Server 11g

 

14) Basic WebLogic WebService Example 


15) WebLogic Server Distributed JMS

16) WebLogic Advanced JMS

 

17) WebLogic High Available JMS
 

 

 18) WebLogic Class Loaders and Class Loading Analysis Tool.


19) Advanced WLST

 

20) Oracle WebLogic Server with Active Grid Link And RAC



Hope you will enjoy learning more about WebLogic Server, will further come up with more postings and update on WLS, stay tuned..!!

Regards
Shailesh Dyade

Sunday, March 11, 2012

Configure Extended Logging In HTTP Access Logs For WebLogic Application Server

Hello There,

Most of us are aware that Access Logs Prints Application Access logs Information as below.

192.168.238.1 - - [01/Mar/2012:15:52:45 +0530] "GET /HelloWorld/welcome.jsp HTTP/1.1" 200 895
192.168.238.1 - - [01/Mar/2012:15:52:46 +0530] "GET /HelloWorld/GoodMorning.jsp HTTP/1.1" 200 2963


Which Specifically uses common logging format, syntax/format of the common logging format is as below.

host RFC931 auth_user [day/month/year:hour:minute:second UTC_offset] "request" status bytes.

The Above information is very limited in case if you need to know lot from it, each parameter above are specific to below information.

host
Either the DNS name or the IP number of the remote client
RFC931
Any information returned by IDENTD for the remote client; WebLogic Server does not support user identification
auth_user
If the remote client user sent a userid for authentication, the user name; otherwise "-"
day/month/year:hour:minute:second UTC_offset
Day, calendar month, year and time of day (24-hour format) with the hours difference between local time and GMT, enclosed in square brackets
"request"
First line of the HTTP request submitted by the remote client enclosed in double quotes
status
HTTP status code returned by the server, if available; otherwise "-"
bytes
Number of bytes listed as the content-length in the HTTP header, not including the HTTP header, if known; otherwise "-"

with the above information the access log is only used for to check whether application is being accessed or not over the server and the time and date of access, finally it will provide the status of the access.

Whereas the Extended Logging Format in WebLogic Server uses the W3C Specifications for the log format, for more information, please refer to http://www.w3.org/TR/WD-logfile.html

According to this logging format we can specify the customized fields for the HTTP Log file as in below link :

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/676400bc-8969-4aa7-851a-9319490a9bbb.mspx?mfr=true

And : http://docs.oracle.com/cd/E13222_01/wls/docs91/config_wls/web_server.html#elf

Follow the below steps to configure the Extended Logging format for HTTP Logs.

 Step 1 : Install the WebLogic Server Software, Create a Domain, Start the Admin Server and Deploy a Sample Application to keep everything ready to test the Extended Logging format.

Step 2 : Click on Admin Server and Go to Logging Tab in the console

Step 3 : Click on HTTP to modify the HTTP logging format for the Application Access.

Step 4 : Scroll down and click on Advanced

Step 5 : Change the Format to Extended

Step 6 : And Specify the fields for Extended Logging in "Extended Logging Format Fields" as you would like to see the information from : http://docs.oracle.com/cd/E13222_01/wls/docs91/config_wls/web_server.html#elf




In my example domain I have specified the following fields.


date time cs-method cs-uri sc-status cs-username cs(User-Agent)  s-sitename s-ip s-port time-taken cs(Cookie) sc-substatus cs-host cs-version


So as per the above link it will provide us the information for : 

date : Date at which transaction completed, field has type <date>, as defined in the W3C specification. 

time : Time at which transaction completed, field has type <time>, as defined in the W3C specification.

cs-method : The request method, for example GET or POST. This field has type <name>, as defined in the W3C specification. 

cs-uri: The full requested URI. This field has type <uri>, as defined in the W3C specification. 

sc-status: Status code of the response, for example (404) indicating a "File not found" status. This field has type <integer>, as defined in the W3C specification.

cs-username: The name of the authenticated user who accessed your server. Anonymous users are indicated by a hyphen.

cs(User-Agent) : The browser type that the client used.

s-sitename: The Internet service name and instance number that was running on the client.

s-ip: The IP address of the server. 

s-port: The Port number of the server.

time-taken: Time taken for transaction to complete in seconds, field has type <fixed>, as defined in the W3C specification. 


cs(Cookie)
The content of the cookie sent or received, if any.

sc-substatus: The substatus error code.

cs-host: The host header name, if any.

cs-version: The protocol version —HTTP or FTP —that the client used.

After this has been specified, save the same and activate the changes.

Step 7: Restart the server to activate the changes.

Step 8 : Access the Application deployed over the server.

Step 9: View the Access logs created 

You will find following information sample in your access logs : 

#Version:    1.0
#Fields:    date time cs-method cs-uri sc-status cs-username cs(User-Agent)  s-sitename s-ip s-port time-taken cs(Cookie) sc-substatus cs-host cs-version
#Software:    WebLogic
#Start-Date:    2012-03-01    16:02:41
2012-03-01    10:33:22    GET    /helloworld/welcome.jsp    200    -    "Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2"    -    192.168.238.1:7001    -    0.047    "JSESSIONID=QHclPPNTdXyGRJ5QRQFjC97t2PTnVKQTd2tB1hDVSFbf2pJNsw9t!-500938956"    -    -    -
2012-03-01    10:33:24    GET    /helloworld/hellothere    200    -    "Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2"    -    192.168.238.1:7001    -    0.015    "JSESSIONID=wZDZPPQSqFY6n25mgNcZGsF2MmVxT05XQZ0vLnxqCltrJcYjt7nw!-1723970954"    -    -    -
2012-03-01    10:33:25    GET    /helloworld/hello.jsp    200    -    "Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2"    -    192.168.238.1:7001    -    0.031    "JSESSIONID=wZDZPPQSqFY6n25mgNcZGsF2MmVxT05XQZ0vLnxqCltrJcYjt7nw!-1723970954"    -    -    -

You can check the each parameters and check for the log created, and cross check the information you have gathered.

Hope this posting was helpful for you.

Please share your feedback.

Regards
Shailesh Dyade

Thursday, March 1, 2012

Debugging WebLogic Server Process

Hello Folks,

Sometimes you will not understand what exactly the WebLogic Server thinks when it throws some Errors / Exceptions, WebLogic Server is Open enough that it will allow you to understand it completely at the microscopic level, but you got to have eyes and mind to understand it :).

Whenever WebLogic Server Works it will say what it is doing in very brief way by printing it over the logs like Server Logs, Access Logs, Domain logs, Diagnostics, etc.., However they are very specific and cannot print much more information for you to help unless you need them, as they have disadvantages too, one is you will have no more disk space in some days if you enable the trace level of logging.

But you might need this to be enabled for Debug Level to Understand few Operations of WebLogic Server, in this posting we will study how to enable the Debug Logging and How to Enable the Debugs for Cluster Component for Session Replication.

I have setup the WebLogic Server Version 10.3.0 at my labs and will configure and show it you how the Debugs Work.

Step 1.  Verify Running Servers are in Cluster for Enabling Replication Debugs - If you don't have clustered server there is no use of enabling Debug for Replication :)


Step 2 : Click on Server which needs Debug to be enabled.

For an instance click on Server1 -- Logging
Step 3: Scroll down and Click on Advanced

Step 4 : Select Severity Level as "Debug" for Server Log file, Standard Out, Minimum Severity to Log And Check the Check Box : "Redirect stdout logging enabled" -- Save it.

Step 5 : Repeat This For All the Server on which you need to know exactly how its behaving during the operation.

Note : This Configuration Change Requires Server Restart to Take Effect, Before We Restart the Servers, we will enable the Debugs for Session Replication.

Step 6 : Click On Debug Tab on Server Configuration Page.

Step 7: Expand "weblogic" -> "core" -->"cluster" Click on following Debugs and Click Enable.

--> DebugReplication
--> DebugReplicationDetails
--> DebugCluster - In Case if you think you might be running issue with cluster setup. 

Step 8 : Activate the Changes.

Step 9: Restart the Servers

Note : You can do all above operation in case if your managed servers are down also.

While you are starting the server, you can notice the Cluster Debugs as below.

####<Mar 1, 2012 9:22:53 AM IST> <Debug> <Cluster> <SDYADE-LAP> <Server1> <[STANDBY] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1330573973281> <BEA-000000> <Sending senderNum:0 seqNum:0 message:Heartbeat with 0 items outgoing message:message:[115, 114, 0, 33, 119, 101, 98, 108, 111, 103, 105, 99, 46, 99, 108, 117, 115, 116, 101, 114, 46, 72, 101, 97, 114, 116, 98, 101, 97, 116, 77, 101, 115, 115, 97, 103, 101, -98, -77, -6, 99, 112, -53, -92, -119, 12, 0, 0, 119, 2, 0, 0, 120, 112, 115, 114, 0, 19, 106, 97, 118, 97, 46, 117, 116, 105, 108, 46, 65, 114, 114, 97, 121, 76, 105, 115, 116, 120, -127, -46, 29, -103, -57, 97, -99, 3, 0, 1, 73, 0, 4, 115, 105, 122, 101, 119, 2, 0, 0, 120, 112, 0, 0, 0, 0, 119, 4, 0, 0, 0, 0, 120, 119, 8, 0, 0, 1, 53, -52, 99, -105, 33, 120, 0, 0, 0, 0, 0], size:123, seqNum:0, messageVersion:0,0,0>


Step 10: Deploy a Session Based Application to the cluster and Test the Application at Web Server Side and Test the Replication.

Step 11 : Shutdown the Server Where the Session is directed.

Debug for Debug Replication is as below : 

####<Mar 1, 2012 9:29:53 AM IST> <Debug> <Replication> <SDYADE-LAP> <Server2> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1330574393984> <BEA-000000> <Creating primary -3805878817075153326>
 

Debugs for the Replication details sample : 

####<Mar 1, 2012 9:29:53 AM IST> <Debug> <ReplicationDetails> <SDYADE-LAP> <Server2> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1330574393984> <BEA-000000> <Unable to create secondary for -3805878817075153326 on null>
####<Mar 1, 2012 9:29:54 AM IST> <Debug> <ReplicationDetails> <SDYADE-LAP> <Server2> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1330574394125> <BEA-000000> <Has secondary servers? false>
####<Mar 1, 2012 9:29:54 AM IST> <Debug> <ReplicationDetails> <SDYADE-LAP> <Server2> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1330574394125> <BEA-000000> <Current secondary server? null>


There seems to be some issue with the Secondary server creation for the session to be replicated, you can see that it has printed out the same message.


Now you are the Administrator, WebLogic Server has informed that what it is going through, please help it to help you to replicate the application session to the secondary server successfully.

Hope After this posting you are able to Debug the issues with different components too, keep trying.

Let me know if you need any more help.

Regards
Shailesh Dyade