Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Tuesday, July 16, 2013

Java ClassLoader Example with URLClassLoader


Here i am going to explain how to use java URLClassLoader to load classes in runtime. First i will explain how to run the code without class loaders. Then i will explain how to run the same code using URLClassLoader.

Let's try to convert java object to JSON using google gson 3rd part library.

1. Without ClassLoaders

Main Class
package my.sample.classloading;

import com.google.gson.Gson;

public class Main {
public static void main(String[] args) {
Gson gson = new Gson();
String jsonString = gson.toJson(new Person());
System.out.println(jsonString);
 }
}

Person class
package my.sample.classloading;

public class Person {
private String name="Foo Bar";
private int age= 25;
} 

If you try to run this sample code without providing gson-<version>.jar  at runtime you will end up getting following exception.

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/gson/Gson
    at my.sample.classloading.Main.main(Main.java:27)
Caused by: java.lang.ClassNotFoundException: com.google.gson.Gson
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356) 
 
But if you add gson-<version>.jar to your classpath you will not get above exception instead you will get expected out put.

Let's see how we can handle this with class loading.

2. With ClassLoaders

Main Class
package org.wso2.carbon.classloading;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;

public class Main {
    public static void main(String[] args) throws ClassNotFoundException, MalformedURLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {


        URLClassLoader urlClassLoader = new URLClassLoader(new URL[]{new URL("file:///home/shameera/Desktop/gson-2.2.4.jar")});
        Class gsonClass = urlClassLoader.loadClass("com.google.gson.Gson");
        Constructor constructor = gsonClass.getConstructor();
        Object gsonObj = constructor.newInstance();
        Method method = gsonClass.getMethod("toJson",Object.class);
        Object returnObj =  method.invoke(gsonObj, new Person());
        String jsonString = (String)returnObj;
        System.out.println(jsonString);
    }
}

 With above sample it loads gson-2.2.4.jar file at runtime using Java URLClassLoader and convert a Person object to json string. As you can see there is no any import for Gson class instead we load and use it in runtime.

Install a JAR to local maven repository

When dependency jars are not available in maven central repository you have to install it to your local repository or you can provide it using system path. Using following command you can send your dependency jar to your local m2 repository.

mvn install:install-file -Dfile=<path/to/your/dependecy/jar> -DgroupId=<groupId> -DartifactId=<artifactId> -Dversion=<version> -Dpackaging=jar


Eg:Let's get google gson library as an example, This is already available in maven repository but here we are going to manually install it to our local m2 repo. Assume i have downloaded gson-2.2.4.jar to my desktop

         <dependency>
             <groupId>com.google.code.gson</groupId>
             <artifactId>gson</artifactId>
             <version>2.2.4</version>
         </dependency>

mvn install:install-file -Dfile=/home/shameera/Desktop/gson-2.2.4.jar -DgroupId=com.google.code.gson -DartifactId=gson -Dversion=2.2.4 -Dpackaging=jar

You will see similar output like below.

[INFO] Scanning for projects...
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) @ standalone-pom ---
[INFO] Installing /home/shameera/Desktop/gson-2.2.4.jar to /home/shameera/.m2/repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------


As same as you can install your own jars to local maven repo and refer it in different project.





Saturday, August 25, 2012

How to send http post request using apache commons httpclient




Install Netbeans 7.2 in Ubuntu 11.10

When I try to install Netbeans IDE by downloading netbeas*.sh file from the Netbeans website and run it in terminal, it say installation is not completed please find the log file and try again. I tried with serveral netbeans.sh files , even several versions but result is the same. After that i tried by giving path to javahome using "sh netbeans*.sh  --javahome /path/to/JDK/home ". But still i get the same error message.

Somehow I could able to solve this issue using pack which provided by Oracle. In that pack they have bundle JDK and Netbeans 7.2 together. You can find it in JDK 7u6 with Netbeas 7.2 post published by Oracle. You need to do is accept the license agreement and download it. Then you can run it using sh command as usual.

Thanks,
Shameera.

Friday, July 13, 2012

How to read XML Schema File as Apache commons XmlSchema Object


First you need to get the file as InputStream and then get XmlSchemaCollection of that InputStream. Using this XmlSchemaCollection object you can read XmlSchema. You can find Sample code below, Which get sample.xml XSD file to XmlSchema Object.



Now you can use this XmlSchema object to iterate the XSD file. If you need to know how to do it then have a look my previous post "How to process Apache commons XmlSchema"

How to process Apache commons XmlSchema.


Hi all,

Today I'am going to show you how to iterate XmlSchema to print all complex and simple Types elements and identify whether it is an array or not and also the type of the element.



Thursday, July 5, 2012

Add eclipse jdt core dependency and third party repository

Artifact details
Group: org.eclipse.jdt
Artifact id: core
Version: 3.4.2.v_883_R34x
Version type: Unknown
Repository: JBoss Thirdparty Releases
Repository url: https://repository.jboss.org/nexus/content/repositories/thirdparty-releases


Maven dependency



Maven repository



add this maven repository to your pom file as

<project>
.........
  <repositories>
        <repository>
         ......
      </repository>
    </repositories>
</project>

Friday, June 29, 2012

How to deploy a .aar service in Axis2 server.

I am going to explain this using a simple service which has only a echoString method, which is in-out operation and a ping method, which is in-only operation.

Write your sample service.

write services.xml file for your sample service



There is a folder structure for .aar file, In this case it should be


services.xml file should be inside the META-INF directory. Otherwise you will get an error saying services.xml file is not detecte. Ok now your are ready to create Sample.aar file.

Step 1. Compile above project and Select META-INF and org(which contain SimpleService.class) directories and create sample.zip file using that directories. If you created this in correct way, when you unzip this sample.zip file you will get above both directories not a sample directory.

Step 2. Now rename this sample.zip file to sample.aar (just change the extension .zip to .aar)

Step 3. Now you can deploy this service in axis2. For that you should copy this sample.aar file to AXIS2_HOME/repository/services/

Step 4. Start Axis2 server. (How to start Axis2 server).

Step 5. Open you web browser and go to http://localhost:8080/axis2/services/ you will see your sample service withing this deployed services.

Step 6. You can use soapUI to check the above service(How to use SoapUI). (Hint- click on the SampleService in service list you will get wsdl of this service, save it )

Java Best Practice - Strings Concatenation

1. How to concatenate two Strings inside a loop

Think you need to concatenate strings to an one string, Then probably you chose one of loop in java. But there is a good practice in doing this concatenation which help to increase performance and memory utilization.


Bad  practice

code in line 4 is like

In this syntax it creates a new String object using both previous str object and reStr objects and now str variable is pointed to newly created object. Remember String object is an immutable object hence we can't modify it. Instead of this, we can use StringBuffer to concatenate Strings without creating new objects. see below good practice code segment.

Good practice

here it uses StringBuffer, In initialization it provides first string and inside for loop it append reStr String to that buffer. Therefore this avoid creating immutable string object in each loop. This will help to decrease memory utilization, and increase the performance.

Friday, June 15, 2012

How to run Apache Zookeeper server

It is easy to up and run apache zookeeper server. First you need to download latest stable version of zookeeper distribution . Lets say you have downloaded zookeeper-3.3.4 to home directory , Then open Terminal by pressing Ctrl+Alt+t all together.Go to zookeeper bin folder(run  "cd ~/zookeeper-3.3.4/bin" command in terminal)


Then run "zkServer.sh start" command then you will see following three lines
 JMX enabled by default
Using config: /home/zookeeper-3.3.4/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED


If you can see above output in the terminal window. It means you have started Zookeeper server successfully in your local machine.

To stop the server run "zkServer.sh stop" command.

If you need You can run zookeeper default client come up with the distribution, for that, run "zkCli.sh" command. Then you will see

zookeeper-3.3.4/bin/../conf:
...............
2012-06-14 23:47:35,640 - INFO  [main:Environment@97] - Client environment:java.io.tmpdir=/tmp
2012-06-14 23:47:35,641 - INFO  [main:Environment@97] - Client environment:java.compiler=<NA>
........

connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@7369ca65
Welcome to ZooKeeper!
2012-06-14 23:47:35,697 - INFO  [main-SendThread():ClientCnxn$SendThread@1061] - Opening socket connection to server localhost/127.0.0.1:2181
JLine support is enabled
2012-06-14 23:47:35,713 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@950] - Socket connection established to localhost/127.0.0.1:2181, initiating session
[zk: localhost:2181(CONNECTING) 0] 2012-06-14 23:47:35,915 - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@739] - Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x137ec2306ef0000, negotiated timeout = 30000


WATCHER::

WatchedEvent state:SyncConnected type:None path:null 


[zk: localhost:2181(CONNECTED) 0] 

Then type "ls" or what ever you will see list of available commands


[zk: localhost:2181(CONNECTED) 0] ls 
ZooKeeper -server host:port cmd args
    connect host:port
    get path [watch]
    ls path [watch]
    set path data [version]
    delquota [-n|-b] path
    quit
    printwatches on|off
    create [-s] [-e] path data acl
    stat path [watch]
    close
    ls2 path [watch]
    history
    listquota path
    setAcl path acl
    getAcl path
    sync path
    redo cmdno
    addauth scheme auth
    delete path [version]
    setquota -n|-b val path

 [zk: localhost:2181(CONNECTED) 1]

eg: If you like to list down zookeeper root directory, Type "ls / "


Note: If you need you can change zookeeper configuration file(zoo.cfg). You can fine it zookeeper-3.3.4/conf/ directory. Sometimes you need to change its default values. As an example, If you need to connect more than 10 zookeeper client to your zookeeper server Then you should probably add maxClientCnxns=# (#-any number) otherwise defalut value is 10. if you add maxClientCnxns=0 it means there is no any client limit. please refer advanced configuration in Zookeeper administrator's guide

Saturday, January 28, 2012

Configure pom.xml to use JAVA_HOME to compile a mavan project

If you have a new maven project then you will definitely need to use another jdk version instead of maven default jdk version which is jdk_1.3 to build your maven project. Here I point you out how to use your JAVA_HOME to build your maven project. It is simple what you need is just add maven-compiler-plugin to pom.xml file of your project as i have mentioned below.

I have exported jdk_1.6.0_30 as my JAVA_HOME variable in .bashrc file and have set PATH bin.

i.e : export JAVA_HOME=/path/to/jdk
export PATH=$JAVA_HOME/bin:$PATH 

Here is how i uses my jdk_1.6 to build my maven project.

<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <executable>${java.home}/bin</executable>
                </configuration>
            </plugin>
        </plugins>
    </build>

Friday, January 20, 2012

How to Install Maven2/Maven3 in ubuntu

Maven is a java building tool which can uses for compile,run test, install, etc.. Today I'm going to tell you how to install maven2/maven3 in ubuntu by manually and by apt-get package manager.

Install Maven2 manually

1. First you need to download maven 2.2.1 binary file.
2.Extract downloaded binary file to a directory where you like to keep maven . Let's say you created a directory call "maven-2.2.1" in your home directory.
3. Now you need to set maven classpath in ".bashrc" file.
         i. Open your terminal and type "cd" to go to home directory where .bashrc has located
         ii. Now Type "gedit .bashrc" in your terminal. It will open .bashrc file via gedit.
         iii. Add this line to the end of .bashrc file "export PATH=/home/your_home_directory_name/maven-2.2.1/bin:$PATH" (note: replace your home directory name with "your_home_directory_name", i have added "export PATH=/home/shameera/maven-2.2.1/bin:$PATH"  as my home directory name is "shameera") 

 4. Save and close .bashrc file.

5. Get a new terminal and type "mvn --version" then you will get below line and some other information like java versin and java home. If you need to install oracal(sun) java 1.7 on your machine see my previous post Install Oracle(sun) jdk 1.7 in ubuntu.

          Apache Maven 2.2.1 (r801777; 2009-08-07 00:46:01+0530)



6. If you get same out put then you have installed maven2 on your machine. NOTE: if you used previous terminal for  this before type "mvn --version" type "source .bashrc".
 
 Install Maven3 using manual

This is same as Maven2 installation. Download apache-maven-3.0.4 instead of maven2 


Install Maven2 using apt-get 

Open a new terminal and type "sudo apt-get install maven2". Then it will ask your password type your password. After that it will ask to install some necessary packages including openjdk if you like to install openjdk on your machine type "y" if not type "n" and use Install Maven2 manuall procedure to install maven2/maven3 on your machine. 

Sunday, December 25, 2011

Install Oracle(sun) jdk 1.7 in ubuntu 11.10 (Oneiric Ocelot)

When i upgraded to ubuntu 11.10(oneiric Ocelot) i have noticed that there is no any jdk installed in default. But it is good as previous ubuntu versions have OpenJdk in default. I am preffer to use Oracle(sun) jdk instead of OpenJdk for some reasons. Therefore i have to first uninstall Openjdk and then install Oracle(sun) jdk in those versions. Thanks to ubuntu developers in ubuntu 11.10 i don't need to uninstall OpenJdk to install Oracle jdk.

Here are the steps you need to install Oracle jdk 1.7 on ubuntu 11.10



Step 1. Download Oracle jdk 1.7 form here 


Step 2. Extract it to your home folder and move to usr/lib/jvm/


open terminal(ctrl+Alt+T)
(assume that extracted folder name is "java_1.7" now we need to move this folder to usr/lib/jvm)
shameera@dell:~$ sudo mv java_1.7/ usr/lib/jvm/


Step 3. Install Update Java package created by Bruce Ingalls (packages available for Ubuntu 11.10, 11.04, 10.10 and 10.04)

shameera@dell:~$ sudo add-apt-repository ppa:nilarimogard/webupd8
shameera@dell:~$ sudo apt-get update
shameera@dell:~$ sudo apt-get install update-java


Step 4. To install oracal jdk 1.7 run following command in terminal 


shameera@dell:~$ sudo update-java
after this you have installed java-1.7-oracal successfully for



you can check version by running "java -version" in terminal then you will see an output like this(my os is 64 bit if your one is 32 bit then this will different little bit)


java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)


It means you have installed jdk 1.7 on your machine successfully  




Install oracal java 7 browser plugin for Firefox



first remove old firefox java plugin 


shameera@dell:~$ rm -f ~/.mozilla/plugins/libnpjp2.so ~/.mozilla/plugins/libjavaplugin_oji.so
shameera@dell:~$ sudo rm -f /usr/lib/firefox/plugins/libnpjp2.so /usr/lib/firefox/plugins/libjavaplugin_oji.so


for 32bit :- 
shameera@dell:~$ mkdir -p ~/.mozilla/plugins 
shameera@dell:~$ ln -s /usr/lib/jva/java_1.7/jre/lib/i386/libnpjp2.so ~/.mozilla/plugins/


for 64bit :-
shameera@dell:~$ mkdir -p ~/.mozilla/plugins
shameera@dell:~$ ln -s /usr/lib/jvm/java_1.7/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/



Sunday, September 11, 2011

Introducing Enum Support With Apache Axis2

Now you can find java Enum support with Axis2 1.7.0 version (Not yet released, you can download trunk and build it). It is a new feature to Axis2 as previous versions didn't support a java Enum as a service method parameter. But with this new feature you can use java Enum constants as a service method parameter in your service. Not only in java level it supports wsdl level too. Therefore we can use this new feature in code-first approach as well as in contract-first approach. The following example explains about how to use Enum support in code-first approach and contract-first approach in pojo service.

Deploying a Service which uses Enum in method parameter.

Here is the simple pojo service class. This service class have three methods and two enum classes Day and Status, where Day is a simple enum constant and Status has a user defined constructor which gets an int and a String as its parameters.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
 * @author shameera
 */
public class EnumService {

    public Day testDay(Day day) {
        System.out.println(day.getDeclaringClass());
        System.out.println(day.toString());
        return day;
    }

    public Event callEvent(Event newEvent) {
        Day eventDay = newEvent.getStartingDay();
        System.out.println("Event Starting day is : " + eventDay.toString());
        return newEvent;
    }

    public Status testStatus(Status status) {
        return status;
    }

    public enum Day {
        MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;

    }

    public enum Status {
        START(0, "start"), ACTIVE(1, "active"), STOP(2, "stop");

        private final int val;
        private final String desc;

        Status(int val, String desc) {
            this.val = val;
            this.desc = desc;
        }

        public int value() {
            return this.val;
        }

        public String description() {
            return this.desc;
        }
    }
}
Methods :

1. testDay - get and return Day enum constant.

2. testStatus - get and return Status enum constant.

3. callEvent - get and return Event pojo object which use Day enum constant.

Here is the Event pojo class.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
 * @author shameera
 */
public class Event {

    private EnumService.Day startingDay;
    private String eventDesc ;
    private String eventName;

    public EnumService.Day getStartingDay() {
        return startingDay;
    }

    public void setStartingDay(EnumService.Day startingDay) {
        this.startingDay = startingDay;
    }

    public String getEventDesc() {
        return eventDesc;
    }

    public void setEventDesc(String eventDesc) {
        this.eventDesc = eventDesc;
    }

    public String getEventName() {
        return eventName;
    }

    public void setEventName(String eventName) {
        this.eventName = eventName;
    }
}

Using these two classes and services.xml create .aar file and deploy it in Axis2. After successfully deploy it you can see it in axis2 services page.

You can see generated wsdl of EnumService service by clicking it. Here are some parts of the wsdl file of Enumservice service.
NOTE: make sure that you are using Axis2 1.7.0 if not generated wsdl for this service is not a validated wsdl.

In wsdl file you can see that for the enum constants it has a new schema generated "http://ws.apache.org/namespaces/axis2/enum" as targetNamespace.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
    <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://ws.apache.org/namespaces/axis2/enum">
    <xs:simpleType name="Status">
        <xs:restriction base="xs:string">
            <xs:enumeration value="START"/>
            <xs:enumeration value="ACTIVE"/>
            <xs:enumeration value="STOP"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="Day">
        <xs:restriction base="xs:string">
            <xs:enumeration value="MONDAY"/>
            <xs:enumeration value="TUESDAY"/>
            <xs:enumeration value="WEDNESDAY"/>
            <xs:enumeration value="THURSDAY"/>
            <xs:enumeration value="FRIDAY"/>
            <xs:enumeration value="SATURDAY"/>
            <xs:enumeration value="SUNDAY"/>
        </xs:restriction>
    </xs:simpleType>
    </xs:schema>

This is the generated schema part for testDay method
1
2
3
4
5
6
7
    <xs:element name="testDay">
    <xs:complexType>
        <xs:sequence>
            <xs:element minOccurs="0" name="day" nillable="true" type="ax21:Day"/>
        </xs:sequence>
    </xs:complexType>
    </xs:element>

This is the generated schema part for testDayResponse
1
2
3
4
5
6
7
    <xs:element name="testDayResponse">
    <xs:complexType>
        <xs:sequence>
            <xs:element minOccurs="0" name="return" nillable="true" type="ax21:Day"/>
        </xs:sequence>
    </xs:complexType>
    </xs:element>

Here is the main generated schema for this service
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
    <xs:schema xmlns:ax24="http://axis2userguide.axis2.apache.org/xsd" xmlns:ax22="http://ws.apache.org/namespaces/axis2/enum" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://axis2userguide.axis2.apache.org">
    <xs:import namespace="http://ws.apache.org/namespaces/axis2/enum"/>
    <xs:import namespace="http://axis2userguide.axis2.apache.org/xsd"/>
    <xs:element name="testStatus">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" name="status" nillable="true" type="ax21:Status"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="testStatusResponse">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" name="return" nillable="true" type="ax21:Status"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="testDay">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" name="day" nillable="true" type="ax21:Day"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="testDayResponse">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" name="return" nillable="true" type="ax21:Day"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="callEvent">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" name="newEvent" nillable="true" type="ax23:Event"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="callEventResponse">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" name="return" nillable="true" type="ax23:Event"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    </xs:schema>

Here is the generated schema for Event Pojo object.
1
2
3
4
5
6
7
8
9
    <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://axis2userguide.axis2.apache.org/xsd">
    <xs:complexType name="Event">
        <xs:sequence>
            <xs:element minOccurs="0" name="eventDesc" nillable="true" type="xs:string"/>
            <xs:element minOccurs="0" name="eventName" nillable="true" type="xs:string"/>
            <xs:element minOccurs="0" name="startingDay" nillable="true" type="ax21:Day"/>
        </xs:sequence>
    </xs:complexType>
    </xs:schema>

Enum schema generation process is intelligent enough to generate only one schema type for each enum class.

You can write a schema for Enum support now which means now you can use contract-first approach too.

If you have any problem regarding enum support in Axis2 you can ask it here or Axis2-user mailing list.

Sample Text

Website counter

Categories