Save info   Get password
Home Submit your blog Edit Account Rules RSS-Archive Contact


JNDI lookup on Tomcat and JBoss using Spring
2008-12-24 11:57:00
Unfortunately Java EE specs does not specify any standard way of JNDI naming conventions, hence most of the application servers have their own way of JNDI naming. On specifying a Datasource's JNDI name as 'jdbc/myDatasource', Tomcat (6) binds that as 'java:/comp/env/jdbc/myDatasource' while JBoss (5) binds as 'java:/jdbc/myDatasource'. So if one wants to deploy the application on multiple applicat
Read more: Spring

Let Spring load service class for JAX-WS
2008-12-20 06:31:00
During deployment JAX-WS RI by default creates an instance (singleton) of web service implementation class and uses that to serve requests. At times we may want to customize the instantiation of the web service implementation class e.g. let Spring configure and load the object. JAX-WS Commons has an extension for Spring integration, which delegates total configuration to Spring and makes RI speci


Locally packaged WSDL
2008-12-07 02:17:00
As discussed in my earlier post Consuming web services with Spring, web service client initialization might fail due to non-availability of the running web service. We can overcome this limiting factor by packaging the WSDL with client and using that for creating the instance of client stub and during service method invocation use the live URL of the service. Have a look at Packaging dynamic resou


Environment specific property with Spring
2008-11-30 10:16:00
In an application there are lots of properties which vary from one environment to another e.g. database used in development will be different from the one used in production, leading to different connection properties (url, user names and password). Applications using Spring Framework usually fallback on PropertyPlaceholderConfigurer for inserting such values from an external properties file.I wou
Read more: Environment , property

Packaging dynamic resources with Maven
2008-11-29 01:38:00
Maven is an excellent project management tool which makes difficult things easy. With doing so many things it also bundles resource files if we tell it the path to resources as shown below-<?xml version="1.0" encoding="UTF-8"?><project xmlns="" xmlns:xsi="-instance"    xsi:schemaLocation=" -v4_0_0.xsd">    . . .    <properties>        <resource.dir>${code.ba
Read more: Packaging

Consuming web services with Spring
2008-11-23 01:49:00
Consuming web services with Spring framework is amazingly easy. It avoids the need of creating client side stubs during compile time and does the same at run time. A typical web service client can be configured as shown below-<bean id="myWebService" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean">    <property name="serviceInterface" value="pkg.MyService"/>  


Using dynamic proxies for cache implementation
2008-10-06 22:54:00
The act of storing a copy of data (which is usually expensive to fetch or compute) from the original source, near (ideally, though not necessary) the users is called caching. Once the data is stored in the cache , future use can be made by accessing the cached copy rather than re-fetching or re-computing the original data, so that the average access time is shorter, leading to performance gains. Th


Proxy setting on Linux
2008-09-26 11:58:00
If your Linux box is behind a proxy server then to access the internet, proxy configuration will be required. The 'http_proxy' and 'ftp_proxy' environment variables hold the information about proxy server. Just execute the following commands-$export http_proxy=http://<proxy-server-ip>:<port>$export ftp_proxy=http://<proxy-server-ip>:<port>Now wget, yum, apt-get etc. can use
Read more: Proxy

Using JAX-WS Handlers
2008-09-25 00:52:00
The JAX-WS provides a good facility to do pre/post processing on SOAP messages using SOAPHandler. The handlers are useful for auditing, logging and potentialy some more functionality. In this entry I will try to explain a typical usage of handlers for logging the SOAP messages. Every handler class needs to implement javax.xml.ws.handler.soap.SOAPHandler interface as shown below-public class Loggin


JAX-WS web service and JBoss
2008-09-18 18:59:00
Yesterday I wrote an entry about building JAX-WS web service. So thought about testing them on latest versions of JBoss. I chose 4.2.3 and 5.0.0 CR2 (released yesterday), both with Java 6.JBoss 4.2.3The deployment of web service failed with following error-Error configuring application listener of class com.sun.xml.ws.transport.http.servlet.WSServletContextListenerjava.lang.ClassNotFoundException:


Building JAX-WS web service
2008-09-16 22:10:00
Last year I wrote a small step by step guide to build JAX-RPC web services. Now JAX-RPC has been replaced by new standard JAX-WS, so I thought it is good time to write an entry for JAX-WS as well. Building web services with JAX-WS is pretty straight forward though it might look cumbersome to a newbie. In this entry I am going explain the basic steps for building a Java first web service, which I d


AnyType object over webservice and Hibernate
2008-09-04 22:20:00
Recently I came across a requirement of moving objects over the network using web services (JAX-WS 2.1). The application was CRUD in nature and Hibernate was used as data tier on the server. In case of web service usually we have WSDL, which clearly defines the kind of objects it expects in request and response. So we can have add/modify/delete/retrieve methods for each type of entity in the WSDL.


SVN with Apache + LDAP
2008-07-28 23:30:00
We have been using CVS at work for long, though personally I am a big fan of SVN. Lately we thought to catch up with the SVN buzz and I was asked to have a Proof Of Concept before we officially move to SVN. Installation of SVN with Apache was pretty straightforward. Though LDAP integration was also simpler but at times it failed without any obvious reasons. Here are the steps for the entire proces


Webservice endpoint
2008-05-31 04:11:00
The Java JAX-RPC implementation used to create simple to use web service clients, where developer can easily change the web service endpoint as shown below-MyWsImpl stub = new MyWsImplService_Impl().getXXX();((Stub) stub)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "");See this entry for details about building JAX-RPC web services.The JAX-WS has changed the way it generates the clients. As a gene


Proxy authentication in Java
2008-05-28 04:05:00
The usual corporate networks provide internet access via proxy servers and at times they require authentication as well. May applications do open the connections to servers which are external to the corporate intranet. So one has to do proxy authentication programmatically. Fortunately Java provides a transparent mechanism to do proxy authentications.Create a simple class like below-import java.ne
Read more: Proxy

@Stateless + @WebService +Weblogic 10 = :-(
2008-05-05 03:42:00
On my last project we have to expose some stateless session beans as web service as well. The deployment platform was Weblogic 10 MP1. For the initial few weeks everything (development, deployment and testing) went fine and then all of a sudden Weblogic refused to deploy couple of EJBs without any error messages. The general observation is, if a class has both @Stateless and @WebService on a singl


Primitives vs Objects
2008-04-07 04:47:00
At times we come across a situation when we need to decide whether to use primitive types or wrapper objects for numeric values in Java. The wrapper classes come in handy when we need to pass on the null values, which can't be achieved with primitive types as they are always initialized to their respective default values.The general concept is that primitive types are far more efficient then using


Monitor SOAP messages
2007-11-19 05:25:00
While developing Web Services at times one has to look for what is going out and coming in during web service interaction. Eclipse has a built-in TCP/IP Monitor but somehow I did not have a good experience using it.Apache SOAP project has small utility called TCP Tunnel/Monitor, which is available here. TCP Tunnel/Monitor can be started using follwing command-set CLASSPATH=%CLASSPATH%;./soap.jar;j
Read more: messages

Struts 2 does not like mathematical operators in attribute names
2007-09-03 23:36:00
If mathematical operators (+, -, *, /) are made part of an attribute name then Struts 2 may mis-interpret them during lookups. Say if one uses "user-name" as attribute name for storing an object in request scope. On attempt of retrieving this variable from request scope using-request.getAttribute("user-name");if Struts 2 does not find this variable in request scope then it looks in ValueStack usin


Bottom Up JAX-RPC web service with JWSDP
2007-08-14 00:09:00
A simple step by step guide to develop a bottom up web service using Java Web Services Developer Pack.Step #1 Install JWSDPDownload Java Web Services Developer Pack 1.6 (JWSDP) from and install it. The installation directory will be called hereafter as $JWSDP_HOME.Step #2 Write code and Package war fileWrite an interface and implementation of it. This interface will be exposed as web service thro
Read more: Bottom

Switched to 64bit Linux
2006-08-04 05:46:00
I bought a new shiny AMD Athlon64 3800+ 64bit machine with NVIDIA GeForce6100 GPU. After inserting the Ubuntu 6.06 CD the installation was a breeze, much simpler than the Windows one. Ubuntu detected all hardware without any problem.The honeymoon ended in 10 minutes when system refused to accept any input from keyboard and mouse. Hard re-boot was the only option to get out of the deadlock. System
Read more: Linux , Switched

Page 1 of 1 « < 1 > »
eXTReMe Tracker