Monday, August 19, 2013

Good Links


http://jcp.org/en/procedures/overview

http://www.mastertheboss.com/resteasy/resteasy-tutorial/page-2

IBM was console
http://servername::9060/ibm/console/login.do


webservice CXF
http://cxf.apache.org/docs/application-server-specific-configuration-guide.html

CXF tutorial
http://www.javatips.net/blog/2012/02/cxf-restful-tutorial

WebSphere Basics
http://docs.splunk.com/Documentation/WAS/2.0.1/User/WebSpherebasics

J2EE tutorial
http://docs.oracle.com/javaee/6/tutorial/doc/bnaaw.html

Thursday, May 9, 2013

Log4j a quick solution

log4j.xml
<?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
        <appender name="AppLogAppender" class="org.apache.log4j.DailyRollingFileAppender">
                <param name="DatePattern" value="'.'yyyy-MM-dd"/>
                 <param name="File" value="${jboss.server.log.dir}/CATAppLogsFile.log" />   
                 <!-- <param name="File" value="C:/Temp/CBBAppLogsFile.log" /> -->  
                <!--  <param name="File" value="/opt/jboss/jboss-as/standalone/log/CATAppLogsFile.log" /> -->  
                <layout class="org.apache.log4j.PatternLayout">
                    <!--  <param name="ConversionPattern" value="%d[%t] %F %l %L |%r| %C         %-5p  %c:[%M]%m%n" /> -->
                    <param name="ConversionPattern" value="%d[%t] %l  %-5p %m%n" />
                </layout>
       
        </appender>
   
         <!-- The "category" represents the package names of your Application APIs which we want to log -->
         <category name="servlets">
             <priority value="DEBUG"/>
         </category>
         <root>
             <priority value ="INFO,DEBUG"/>
             <appender-ref ref="AppLogAppender"/>
            
         </root>
</log4j:configuration>

sample entry output

<param name="ConversionPattern" value="%d[%t] %F %l %L |%r| %C         %-5p  %c:[%M]%m%n" />
<param name="ConversionPattern" value="%d[%t] %l  %-5p %m%n" />

%d    2013-05-09 16:17:29,607
[%t]    [http-/0.0.0.0:8080-1]
%F    CATFilter.java
%l    com.dd.dd.dd.dd.CATBFilter.doFilter(CATFilter.java:219)
%L    219
%r    |1253856|
%C    com.dd.dd.dd.dd.CATFilter  
%-5p    INFO  
%c:[%M]%m%n    com.dd.dd.dd.dd.CATFilter:[doFilter]*****Exiting*****

Thursday, January 12, 2012

Connect to SQLServer with out any username/password

Here is the steps
- Download your sqljdbc.jar driver (it can be X86 and x64 )
-file name : sqljdbc_2.0.1803.100_enu.zip
- Extract it and get the sqljdbc_auth.dll from above file
place sqljdbc_auth.dll file inside the C:\WINDOWS\system32 directioy
Now u r ready for connection

Now in your java file
String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
String server="localhost";
Class.forName(driverName);
dbConn =java.sql.DriverManager.getConnection("jdbc:sqlserver://"+server+":1433;Database=tempdb;integratedSecurity=true");

Here integratedSecurity=true will help you to connect the sqlserver with out authentication 

Sunday, November 13, 2011

How to develop Build scrip for a java/J2ee project ?

build scrip ant script java j2ee

Hi guys. let us discuss about build script for any java-j2ee project .Developing build scrip will be very fun and interesting.. Hope you will enjoy this ..

Let us start from basis. A typical j2ee project will be deliver in .ear or .jar format. Here we will discuss both cases

.ear - will work as pack to cover the .jar and .war file
As an example let us deliver a .ear file which contains one .jar(this contains ejb and normal class) and one .war(this contains jsp and normal class,property files etc)

Developing tools:
Ant - latest version (install ant in local machine or server)
WSAD/eclipse/RAD - any development tool will be fine

Steps to develop build script
  • Get a clean build project using your development tool (WSAD,RAD etc)
  • Make sure all dependent jar are in right position
  • Structure of the final product
    • myproject.ear
      • myejb.jar
        • ejbfiles
        • java classes
      • myweb.war
        • WEB-INF
          • classes
          • properties
      • depended jar which used across jar and war
      • META-INF



--will continue

Wednesday, November 9, 2011

Tips and Tools for WCS: Read about OrderTrashCan

Tips and Tools for WCS: Read about OrderTrashCan: OrderTrashCan is a feature in WCS This feature is ......?.......by default in v7 This feature is enabled by default in v6 If the OrderTra...

Tuesday, September 27, 2011

ear and jar and war

These files are simply zipped files using java jar tool. These files are created for different purposs. Here is the description of these files:

.jar files: These files are with the .jar extension. The .jar files contain the libraries, resources and accessories files like property files.

.war files: These files are with the .war extension. The war file contains the web application that can be deployed on the any servlet/jsp container. The .war file contains jsp, html, javascript and other files for necessary for the development of web applications.

.ear files: The .ear file contains the EJB modules of the applications.

J2EE defines three types of archives:

1. Java Archives (JAR) A JAR file encapsulates one or more Java classes, a manifest, and a descriptor. JAR files are the lowest level of archive. JAR files are used in J2EE for packaging EJBs and client-side Java Applications.

2. Web Archives (WAR) WAR files are similar to JAR files, except that they are specifically for web applications made from Servlets, JSPs, and supporting classes.

3. Enterprise Archives (EAR) ”An EAR file contains all of the components that make up a particular J2EE application.

Thursday, April 21, 2011

what is www2, www3 ?

www2, www3, etc are just the different servers handled by HP to handle load balancing or something. You can set it up for a site so that one client is assigned to one container on a server and another on another container of a server, this is set so that if one server gets down another will remain active to handle the clients request. Its just a subdomain and so don't worry.