Apache CXF – Web Service With Jboss 5.1

Apche CXF is an open source service frame work. CXF helps you build and develop services using frontend programming APIs, like JAX-WS and JAX-RS. These services can speak a variety of protocols such as SOAP, XML/HTTP, RESTful HTTP, or CORBA and work over a variety of transports such as HTTP, JMS or JBI.

• Web Services Standards Support: CXF supports a variety of web service standards including SOAP, the WS-I Basic Profile, WSDL, WS-Addressing, WS-Policy, WS-ReliableMessaging, WS-Security, WS-SecurityPolicy, WS-SecureConverstation, and WS-Trust (partial).

• CXF implements the JAX-WS APIs (TCK compliant). CXF JAX-WS support includes some extensions to the standard that make it significantly easier to use, compared to the reference implementation: It will automatically generate code for request and response bean classes, and does not require a WSDL for simple cases.

It also includes a “simple frontend” which allows creation of clients and endpoints without annotations. CXF supports both contract first development with WSDL and code first development starting from Java. For REST, CXF also supports a JAX-RS (TCK compliant) frontend. • Ease of use: CXF is designed to be intuitive and easy to use. There are simple APIs to quickly build code-first services, Maven plug-ins to make tooling integration easy, JAX-WS API support, Spring 2.x XML support to make configuration a snap, and much more.

• Binary and Legacy Protocol Support: CXF has been designed to provide a pluggable architecture that supports not only XML but also non-XML type bindings, such as JSON and CORBA, in combination with any type of transport.

You can download CXF from here
Now let us have a sample. This POC will help you create a web service, one service will send a java object to server and another service will send you back a java object

First of all you need to load cxf file to your container for that you can create a xml file like below and inculde in your web.xml

jboss-cxf.xml

 <?xml version="1.0" encoding="UTF-8"?>  <beans xmlns="http://www.springframework.org/schema/beans"       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"       xmlns:jaxws="http://cxf.apache.org/jaxws"       xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">         <import resource="classpath:META-INF/cxf/cxf.xml" />       <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />       <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />       <bean id="MyServiceBean" class="com.services.MyServiceImpl" />       <jaxws:endpoint id="myService" implementor="#MyServiceBean" address="/MyService" /> </beans> 

MyService.java

import javax.jws.WebService;

/**
 * 
 * Interface for Employee Service
 *  
 * @author	Praveenkumar K
 * @version	last updated : Aug 1, 2011 
 * @see  
 *
*/
@WebService
public interface MyService {
   /**
    * 
    * uploadEmployee service will update employee in local database
    *
    * @param employee
    * @return
    */
   public int uploadEmployee(Employee emp);
   /**
    * 
    * getEmployee service fetches the employee details againist a employee id
    *
    * @param empId
    * @return
    */
   public Emplolyee getEmployee(String empId);

}

MyServiceImpl.java

import javax.jws.WebService;

/**
 * 
 * Implementation class for Employee Service
 *  
 * @author	Praveenkumar K
 * @version	last updated : Aug 1, 2011 
 * @see  
 *
*/
@WebService(endpoint="com.service.MyService")
public interface MyServiceImple {
   /**
    * 
    * uploadEmployee service will update employee in local database
    *
    * @param employee
    * @return
    */
   public int uploadEmployee(Employee emp){
     //ensert to data base
   }
   /**
    * 
    * getEmployee service fetches the employee details againist a employee id
    *
    * @param empId
    * @return
    */
   public Emplolyee getEmployee(String empId){
    //get Employee from db
  }

}

web.xml


 ecomm-web-util

  contextConfigLocation
  WEB-INF/jboss-cxf.xml

  spring-config
  classpath:application-context-webutil.xml

  org.springframework.web.context.ContextLoaderListener

  CXFServlet
  <!--  CXF Servlet  -->
  org.apache.cxf.transport.servlet.CXFServlet
  1

  CXFServlet
  /*

  index.jsp

import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
*//**
 * 
 * EmployeeClient
 *  
 * @author	Praveenkumar K
 * @version	last updated : Aug 8, 2011 
 * @see  
 *
 *//*
public final class MyClient
{

   private static final String serviceURL = "http://localhost:8080/myapp/MyService";

   public static void main(String args[]) throws Exception {

       JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();

       factory.getInInterceptors().add(new LoggingInInterceptor());
       factory.getOutInterceptors().add(new LoggingOutInterceptor());
       factory.setServiceClass(MyService.class);
       factory.setAddress(serviceURL);
       MyService client = (MyService) factory.create();
       /**Upload Employee details*/
       Employee emp = client.getEmployee("124");
       Employee emp = null;
       emp = new Employee();
       emp .setEmployeeId("124");
       emp .setUserId("1111");
       int empid = client.uploadEmployee(emp );
       System.out.println("return token"+empid);

       System.exit(0);

   }

}
Posted in Uncategorized | 1 Comment

Call SOAP Web Service from Android application

This article will cover how to call a soap web service from your android application.

Here I am giving you a sample calculator application. Let us see the WSDL file of the web service

 <?xml version="1.0" encoding="UTF-8" ?>
 <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://cts.calc.com" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ax21="http://cts.calc.com/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://cts.calc.com">
<wsdl:documentation>Please Type your service description here</wsdl:documentation>
 <wsdl:types>
 <xs:schema xmlns:ax22="http://cts.calc.com/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://cts.calc.com">
<xs:import namespace="http://cts.calc.com/xsd" />
 <xs:element name="doService">
 <xs:complexType>
 <xs:sequence>
<xs:element minOccurs="0" name="c" nillable="true" type="ax22:Calculator" />
</xs:sequence>
</xs:complexType>
</xs:element>
 <xs:element name="doServiceResponse">
 <xs:complexType>
 <xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
 <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://cts.calc.com/xsd">
 <xs:complexType name="Calculator">
 <xs:sequence>
<xs:element minOccurs="0" name="a" type="xs:int" />
<xs:element minOccurs="0" name="b" type="xs:int" />
<xs:element minOccurs="0" name="operator" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
 <wsdl:message name="doServiceRequest">
<wsdl:part name="parameters" element="ns:doService" />
</wsdl:message>
 <wsdl:message name="doServiceResponse">
<wsdl:part name="parameters" element="ns:doServiceResponse" />
</wsdl:message>
 <wsdl:portType name="CalcServicePortType">
 <wsdl:operation name="doService">
<wsdl:input message="ns:doServiceRequest" wsaw:Action="urn:doService" />
<wsdl:output message="ns:doServiceResponse" wsaw:Action="urn:doServiceResponse" />
</wsdl:operation>
</wsdl:portType>
 <wsdl:binding name="CalcServiceSoap11Binding" type="ns:CalcServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
 <wsdl:operation name="doService">
<soap:operation soapAction="urn:doService" style="document" />
 <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
 <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
 <wsdl:binding name="CalcServiceSoap12Binding" type="ns:CalcServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
 <wsdl:operation name="doService">
<soap12:operation soapAction="urn:doService" style="document" />
 <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
 <wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
 <wsdl:binding name="CalcServiceHttpBinding" type="ns:CalcServicePortType">
<http:binding verb="POST" />
<wsdl:operation name="doService">
<http:operation location="CalcService/doService" />
<wsdl:input>
<mime:content type="text/xml" part="doService" />
</wsdl:input>
 <wsdl:output>
<mime:content type="text/xml" part="doService" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CalcService">
<wsdl:port name="CalcServiceHttpSoap11Endpoint" binding="ns:CalcServiceSoap11Binding">
<soap:address location="http://localhost:8080/CalcService1.5/services/CalcService.CalcServiceHttpSoap11Endpoint/" />
</wsdl:port>
 <wsdl:port name="CalcServiceHttpSoap12Endpoint" binding="ns:CalcServiceSoap12Binding">
<soap12:address location="http://localhost:8080/CalcService1.5/services/CalcService.CalcServiceHttpSoap12Endpoint/" />
</wsdl:port>
 <wsdl:port name="CalcServiceHttpEndpoint" binding="ns:CalcServiceHttpBinding">
<http:address location="http://localhost:8080/CalcService1.5/services/CalcService.CalcServiceHttpEndpoint/" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

This web service is expecting a payload Calculator.xml

<Calculator>
           <a>2</a>
           <b>5</b>
           <operator>+</operator>
    </Calculator>

The classes should be like this


public class Calculator {
 private int a;
 private int b;
 private String operator;

 public int getA() {
  return a;
 }

 public void setA(int a) {
  this.a = a;
 }

 public int getB() {
  return b;
 }

 public void setB(int b) {
  this.b = b;
 }

 public String getOperator() {
  return operator;
 }

 public void setOperator(String operator) {
  this.operator = operator;
 }
}

---------------------------------------------------------------

public interface CalcInt {
  public int doService(Calculator c);
}

-------------------------------------------------------------------

public class CalcService implements CalcInt {

	public int doService(Calculator c) {
	  try{
		if(c.getOperator()!=null && c.getOperator().equals("+"))
			return c.getA()+c.getB();
		else if(c.getOperator()!=null && c.getOperator().equals("-"))
			return c.getA()-c.getB();
		else if(c.getOperator()!=null && c.getOperator().equals("*"))
			return c.getA()*c.getB();
		else if(c.getOperator()!=null && c.getOperator().equals("/"))
			return c.getA()/c.getB();
		return 0;
          }catch(Exception e){

	    e.printStackTrace();
	  }
	}

Now let us see the Android application .Here I mentioned step by step process ok
1. Create an android application by the help of your IDE (eclipse) with activity name Calculate.

2. Edit AndroidManifest.xml give permission inside the manifest tag

<uses-permissionandroid:name="android.permission.INTERNET"
/>

3. Edit main.xml in layout and one more xml for calulator view calcview.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
   <include android:id="@+id/calcview" layout="@layout/calcview" />
<TextView 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/hello"
    />
</LinearLayout>
-------------------calcview.xml------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="match_parent"
  android:layout_height="match_parent">
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="match_parent"
  android:layout_height="match_parent">

 <TableRow android:id="@+id/tableRow1"
    android:layout_width="wrap_content"
   android:layout_height="wrap_content">

  <EditText android:id="@+id/editText1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:numeric="integer|decimal"></EditText>

  <Spinner android:layout_height="wrap_content" android:id="@+id/spinner1"
   android:layout_width="wrap_content"></Spinner>
  <EditText android:id="@+id/editText2"
   android:numeric="integer|decimal"
   android:layout_height="wrap_content"
   android:layout_width="wrap_content"></EditText>
 </TableRow>
 <TableRow android:id="@+id/tableRow2"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content">

  <Button android:id="@+id/button1"
   android:onClick="doCalculation"
      android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:text="Calculate"></Button>
 </TableRow>
 <TableRow android:id="@+id/tableRow3" android:layout_width="wrap_content"
  android:layout_height="wrap_content">
  <EditText android:id="@+id/editText3" android:layout_width="wrap_content"
   android:layout_height="wrap_content"></EditText>
 </TableRow>

</TableLayout>
</LinearLayout>

4. Now let us include the ksoap2 API for SOAP . Douwnload jar file from the following location and map with your project (Add library in build path in eclipse).

http://ksoap2-android.googlecode.com/files/ksoap2-android-assembly-2.4-jar-with-dependencies.jar

5. Create Calculator class which implements KvmSerializable

import java.util.Hashtable;

import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;

public class Calculator implements KvmSerializable{
 public int a;
 public int b;
 public String operator;

 public Calculator(){}

     public Calculator(int a1, int b1, String operator1) {

         a = a1;
         b = b1;
         operator = operator1;
     }

     public Object getProperty(int arg0) {

         switch(arg0)
         {
         case 0:
             return a;
         case 1:
             return b;
         case 2:
             return operator;
         }

         return null;
     }

     public int getPropertyCount() {
         return 3;
     }

     public void getPropertyInfo(int index, Hashtable arg1, PropertyInfo info) {
         switch(index)
         {
         case 0:
             info.type = PropertyInfo.INTEGER_CLASS;
             info.name = "a";
             break;
         case 1:
             info.type = PropertyInfo.INTEGER_CLASS;
             info.name = "b";
             break;
         case 2:
             info.type = PropertyInfo.STRING_CLASS;
             info.name = "operator";
             break;
         default:break;
         }
     }

     public void setProperty(int index, Object value) {
         switch(index)
         {
         case 0:
             a = Integer.parseInt(value.toString());
             break;
         case 1:
             b = Integer.parseInt(value.toString());
             break;
         case 2:
             operator = value.toString();
             break;
         default:
             break;
         }
     }

}

6. Now the major part: Edit the Calculate activity class and call the webservice

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.PropertyInfo;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.AndroidHttpTransport;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;

public class Calculate extends Activity  {
    /** Called when the activity is first created. */

   static Spinner operator = null;
   private static final String SOAP_ACTION = "doService";
 private static final String METHOD_NAME = "doService";
 private static final String NAMESPACE = "http://cts.calc.com";
 private static final String URL =
  "http://10.230.139.74:8080/CalcService1.5/services/CalcService?wsdl";
 private SoapObject resultRequestSOAP = null;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        operator = (Spinner)findViewById(R.id.spinner1);
        String array_spinner[]  =  new String[4];
        array_spinner[0] = "+";
        array_spinner[1] = "-";
        array_spinner[2] = "*";
        array_spinner[3] = "/";
        ArrayAdapter<?> adapter = new ArrayAdapter(this,android.R.layout.simple_spinner_item, array_spinner);
        operator.setAdapter(adapter);

    }

    public void doCalculation(View view){
     String firstNo =
   ((EditText) findViewById(R.id.editText1))
   .getText().toString();
  String secondNo =
   ((EditText) findViewById(R.id.editText2))
   .getText().toString();
  String operator = ((Spinner) findViewById(R.id.spinner1)).getSelectedItem().toString();
  callWebService(firstNo,secondNo,operator );
    }

    public String callWebService(String firstNo, String secondNo,String operator ){
     String result = "0";
     try {
      SoapObject request = new SoapObject(NAMESPACE,METHOD_NAME);
      AndroidHttpTransport androidHttpTransport =
       new AndroidHttpTransport(URL);

   PropertyInfo p1 = new PropertyInfo();
   Calculator C = new Calculator();
   C.a=Integer.parseInt(firstNo);
   C.b=Integer.parseInt(secondNo);
   C.operator=operator;

   p1.setName("C");
         p1.setValue(C);
         p1.setType(C.getClass());
         request.addProperty(p1);

   SoapSerializationEnvelope envelope =
    new SoapSerializationEnvelope(SoapEnvelope.VER11);

   envelope.dotNet=true;
   envelope.setOutputSoapObject(request);

   // Make the soap call.
   androidHttpTransport.call(SOAP_ACTION, envelope);

   Object results =(Object)envelope.getResponse();
   //to get the data String resultData=result.getProperty(0).toString();
   String temp = results.toString();
   if(temp.equals("0")){
    temp = "The result is 0";
   }
   System.out.println("Result"+temp);
   /** Show the suggestions in a text area field called
    * lblStatus */
   ((TextView) findViewById(R.id.editText3)).setText(temp
     .toString());
  } catch (Exception aE) {
   System.out.println(aE.toString());

   ((TextView) findViewById(R.id.editText3)).setText(aE.getMessage());
   aE.printStackTrace();
  }

     return result;
    }

}

END

Posted in Uncategorized | 24 Comments

Jboss5.0 ERROR [AbstractKernelController] Error installing to Instantiated: name=AttachmentStore state=Described

19:44:02,097 ERROR [AbstractKernelController] Error installing to Instantiated: name=AttachmentStore state=Described
java.lang.IllegalArgumentException: Wrong arguments. new for target java.lang.reflect.Constructor expected=[java.net.URI] actual=[java.io.File]
	at org.jboss.reflect.plugins.introspection.ReflectionUtils.handleErrors(ReflectionUtils.java:395)
	at org.jboss.reflect.plugins.introspection.ReflectionUtils.newInstance(ReflectionUtils.java:153)
	at org.jboss.reflect.plugins.introspection.ReflectConstructorInfoImpl.newInstance(ReflectConstructorInfoImpl.java:106)
	at org.jboss.joinpoint.plugins.BasicConstructorJoinPoint.dispatch(BasicConstructorJoinPoint.java:80)
	at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.createTarget(AOPConstructorJoinpoint.java:282)
	at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.dispatch(AOPConstructorJoinpoint.java:103)
	at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
	at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
	at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
	at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
	at org.jboss.kernel.plugins.dependency.InstantiateAction.installActionInternal(InstantiateAction.java:66)
	at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
	at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
	at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
	at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
	at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
	at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
	at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
	at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:319)
	at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:297)
	at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:130)
	at org.jboss.kernel.plugins.deployment.BasicKernelDeployer.deploy(BasicKernelDeployer.java:76)
	at org.jboss.bootstrap.microcontainer.TempBasicXMLDeployer.deploy(TempBasicXMLDeployer.java:91)
	at org.jboss.bootstrap.microcontainer.TempBasicXMLDeployer.deploy(TempBasicXMLDeployer.java:161)
	at org.jboss.bootstrap.microcontainer.ServerImpl.doStart(ServerImpl.java:138)
	at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:450)
	at org.jboss.Main.boot(Main.java:221)
	at org.jboss.Main$1.run(Main.java:556)
	at java.lang.Thread.run(Thread.java:662)
Failed to boot JBoss:
java.lang.IllegalStateException: Incompletely deployed:

DEPLOYMENTS IN ERROR:
  Deployment "AttachmentStore" is in error due to: java.lang.IllegalArgumentException: Wrong arguments. new for target java.lang.reflect.Constructor expected=[java.net.URI] actual=[java.io.File]

DEPLOYMENTS MISSING DEPENDENCIES:
  Deployment "ProfileServiceDeployer" is missing the following dependencies:
    Dependency "AttachmentStore" (should be in state "Installed", but is actually in state "**ERROR**")
  Deployment "ProfileServicePersistenceDeployer" is missing the following dependencies:
    Dependency "AttachmentStore" (should be in state "Installed", but is actually in state "**ERROR**")
  Deployment "ProfileServiceBootstrap" is missing the following dependencies:
    Dependency "jboss.kernel:service=Kernel" (should be in state "Installed", but is actually in state "**ERROR**")
    Dependency "ProfileService" (should be in state "Installed", but is actually in state "Instantiated")
  Deployment "ProfileService" is missing the following dependencies:
    Dependency "ProfileServiceDeployer" (should be in state "Installed", but is actually in state "Instantiated")
    Dependency "jboss.kernel:service=KernelController" (should be in state "Installed", but is actually in state "**ERROR**")

	at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:278)
	at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:174)
	at org.jboss.bootstrap.microcontainer.ServerImpl.doStart(ServerImpl.java:142)
	at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:450)
	at org.jboss.Main.boot(Main.java:221)
	at org.jboss.Main$1.run(Main.java:556)
	at java.lang.Thread.run(Thread.java:662)
19:44:02,457 INFO  [ServerImpl] Runtime shutdown hook called, forceHalt: true
19:44:02,461 INFO  [ServerImpl] Shutdown complete
Shutdown complete
Halting VM

The fix was to add class=”java.io.File” to conf/bootstrap/profile.xml:

 <!-- The attachment store --> <bean name="AttachmentStore"> <constructor>  <parameter> <inject bean="BootstrapProfileFactory" property="attachmentStoreRoot"/> </parameter>  <parameter> <inject bean="BootstrapProfileFactory" property="attachmentStoreRoot" /></parameter> </constructor> <property name="mainDeployer"><inject bean="MainDeployer" /></property> <property name="serializer"><inject bean="AttachmentsSerializer" /></property> <property name="persistenceFactory"><inject bean="PersistenceFactory" /></property> </bean> 


ASP.NET HOSTING

Posted in Uncategorized | Leave a comment

How to find which application/ process is using ports in windows

For finding all the ports which is running in your system use the following command
C:\Users\Praveen>netstat -a

For finding a particular process using port 8080 use the following command

C:\Users\Praveen>netstat -o -n -a | findstr 0.0:8083

TCP    127.0.0.1:8083    0.0.0.0:0    LISTENING   5148

In the last column is the process id

Now for findng the process execute the following command using this process id

C:\Users\Praveen>tasklist | findstr 5148
The result is :->
javaw.exe    5148    Console    1    4,16,632 K

Posted in Uncategorized | 1 Comment

Step by step for creating Android Applications with Eclipse

Follow the following steps to create android application with eclipse on windows

1. Download android sdk and install on your mechine http://download.boulder.ibm.com/ibmdl/pub/software/dw/opensource/os-android-devel-FlashLight.zip

This will take morethan 30 min depends on your internet speed

 2. Download and unzip eclipse 3.4 or higher version and add andoid plugin

Go to help ->update/install software -> add new ->  
accept the terms and conditions and install
https://dl-ssl.google.com/android/eclipse/
If the URL doesnt work you can download the plugin and directly upload 
it by selecting archive . Download plugin from 
http://dl.google.com/android/ADT-10.0.0.zip

3. Update the SDK in eclipse

Go to windows -> Preferances -> Android-> Chose SDK root fold

SDK - Eclipse Mapping

To create an AVD:

In this tutorial, you will run your application in the Android Emulator. Before you can launch the emulator, you must create an Android Virtual Device (AVD). An AVD defines the system image and device settings used by the emulator.

To create an AVD:

   1. In Eclipse, choose Window > Android SDK and AVD Manager.
   2. Select Virtual Devices in the left panel.
   3. Click New.

      The Create New AVD dialog appears.
   4. Type the name of the AVD, such as “my_avd”.
   5. Choose a target. The target is the platform (that is, the version of the Android SDK, such as 2.1) you want to run on the emulator.

      You can ignore the rest of the fields for now.
   6. Click Create AVD.

Create a New Android

Posted in Uncategorized | Leave a comment

How to add key words in your web pages for search engines like google

Key word Searching

This is the most common form of text search on the Web. Most search engines do their text query and retrieval using keywords. You can give any words which will point to your page content.

How do we do this ?. By the help of meta tags !

<HEAD>
<TITLE>This is test webpage</TITLE>
<META name="description" content="You can give a short note of your content"/>
<META name="keywords" content="about metatag, visa, banking, java, webpage"/>
</HEAD>
Posted in Uncategorized | 1 Comment

How to connect Liferay-portal-6.0.5 with MySQL

Follow the following steps to configure liferay with MySQL

1. Fist unzip the liferay bundle
2. Edit Root.xml file located in {liferay-home}\{tomcat-home}\conf\Catalina\localhost

 <!-- MySQL -->

<Resource name="jdbc/LiferayPool" auth="Container"

type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver"

url="jdbc:mysql://localhost/liferay?useUnicode=true&amp;characterE

ncoding=UTF-8"

username="liferay"

password="liferay"

maxActive="20" />

3. Create portal-ext.properties in {liferay-home} with content


jdbc.default.jndi.name=jdbc/LiferayPool

Restart or Start liferay deployed tomcat

Posted in Uncategorized | 1 Comment