Showing posts from March, 2012

How to generate wsdl using spring-ws application -Part-2

 PART_1-- goes here
The xsd should contain
xmlns --xml name space
targetnamespace-- usally same as xmlns--add this to the
    xs:schema xmlns=""

2 elements -request and response element

org.springframework.web.servlet.DispatcherServlet -reference to be added to web.xml file

update the dependecies  in pom.xml file-- when using a maven web-project





How to generate wsdl using spring-ws application -Part:1

Spring web-service package supports first-contract.
The api generates the wsdl by reading the spring-ws-servlet.xml file.

All the below classes needs to be packaged as .war file.
Its easier to create a maven web-project

src/main/webapp->create a folder "xsd" and add all the xsd files in this.

I have deployed it on jboss5.1

steps for creating a simple spring-ws application

create -src/main/javaCreate -src/main/javacreate servicename.xsd-src/main/webapp/xsdcreate -src/main/javacreate spring-ws-servlet.xml -src/main/webapp/web-inf/
spring-servlet.xml -file will have the following references>>Pojoservicename.xsd-xsd-define the request and response a method with requestObject as a parameter and responseObject as the retrun typename of the wsdl that should be generated- its is usally servicename.wsdlhtt…

org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser

org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser

remove xerces.jar from web-inf/lib

Cruise Control- Continuous Integration tool

Cruise Control is built on java.It comes with built in ant tool  and jetty server.
 Its a free open source build engine.
You dont have to the build but cruise control will do the build and will execute the test case and will also give the status of the build.
The build process can be scheduled.
It can be integrated with svn,cvs,vss.
Whenever a new code checks in the build is triggered.
It works with maven as well.

watch out for more posts on Cruise Control. Installtion - sturcture and more..

Download Maven quick start Guide pdf-Updated

Let Maven project in Eclipse -point to local respository

Using eclipse IndigoDownload the maven pulgin to eclipse and installURL is -->-maven - on New->ProjectSelect "Maven Project"check-Use Default Workspace locationselect "All Catalogs"select maven-archetype-quickstartclick on nextIn the screen Enter artifactid,groupid and click on finishClick on the Maven dependecies on the right side you can see that it is pointing to a deefualt location.We need to point it to our local repostiory.So local repository location is avialable in in conf/settings.xml file of maven folder.Click on window->preferences->Mavenclick on user Settings- browse and enter the settings.xml file location.Click on Update settingsclick on applyClick on okNow go to the project on the left side of the eclipseright click->run->maven testyou can see build successfull message

Quick start with maven and Create a Sample Central Repo for your team

Download maven-apache-maven-3.0.3-binUnzipopen conf folderedit the "settings.xml" (before editing take a back up).In settings.xml file uncomment the localrepository -replace with the below oneE:/maven_local_repoCreate a folder by name- "maven_local_repo" share the folder.(right click and share)Create a .bat file and name it as "mavenstartup.bat"the contents of the mavenstartup.bat file is given below@echo onecho setting java_homeset JAVA_HOME=C:\Program Files\Java\jdk1.6.0_07echo JAVA_HOME to path set PATH=%JAVA_HOME%\bin;%PATH%echo setting MAVEN homeset MAVEN_HOME=E:\mavenecho adding maven home to PATHset PATH=%MAVEN_HOME%\bin;%PATH%echo test maven versionmvn --versionPAUSEtype the command-->mvn archetype:create -DgroupId=com.mysampleproject1 -DartifactId=mysampleprojectthe above command will create a sample java projecttype command-->mvn compile if things are fine you will get "Build Success Message"convert the java project to eclipse pr…

Jmeter and JUnit Testing.

Jmeter and JUnit Testing.

 I was asked to test my junit class in a multi-threaded environment.
 I choose JMeter. for the apache jmeter site.
 Unzip the file.

 Use Eclipse to create a Executable jar.
 In Eclipse-click on Export
 An Export Dialogue should appear.
Click on Java->runnable JAR file.Select a main Class of your project.If you dont have create a dummy main class.Under-Library Handling:Select -"Extract required libraries into generated JAR"Click on Finish.A executable Jar will be created in the specified folder with lib extracted .Also remeber the JUNIT test version,i.eJunit3 or Junit4.Also take care of the libs--dont have duplicate libs in the jar.
  In Jmeter;
 Go to the installation folder of Jmeter Browse Lib->junit here you will find a test.jar.Thats meant for example. Drop your application jar here. Browse to the bin dir of jmeter click on jmeter.batThis will start the jmeter ON the Right side you will …

How to create a src/main/java source folder in Eclipse

How to create a src/main/java source folder in Eclipse
Click on new->Java ProjectClick on nextClick on Source tab--usally source tab will be selected by default..Under Details-click on-Create new source folder link.Enter the folder name as "src/main/java"Click on finish.Start creating packages under this.