Today we are upgrading our application from spring 2.1.1 to spring 2.5.5. During upgrdation we encountered the following exception:
nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'viewClass'; nested exception is java.lang.IllegalArgumentException: Cannot find class [org.springframework.web.servlet.view.tiles.TilesView]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
After litte bit digging found that spring 2.5.5 by default supports tiles2, where as we are using tiles 1.x version. To have backward compatibility we added spring-webmvc-struts.jar.
The following are the steps that are followed for upgradation:
1) Added the new version of spring.jar to the project
2) Added spring-webmvc.jar ---> Spring MVC is moved to separate jar in the latest version
3) Added spring-webmvc-struts.jar --.> For back ward compatibility of tiles 1.x. The latest
version of spring supports only tiles2
spring-webmvc.jar and spring-webmvc-struts.jar can be found under :
spring-framework-2.5.5\dist\modules
Wednesday, July 2, 2008
Running Jboss and IIS on same machine with different IP but with same port
In our company we had a situation where we had to run 2 applications(One on Jboss and the other on IIS) on a single physical machine with different IP, but with same port.
Initially people were skecptical whether this is possible.But then we rationalised that it should be possible, because at the end of day on a system every thing translates to a Socket. And the Computer calculates a socket before assigning it to any application. This calculation mainly uses both IP and Port (which normally you configure for ur server). So we have 2 different IP and same port number, which should essentially translate in to 2 unique socket numbers.
To do this we bound Jboss to the first Ip by passing parameter -b Ip_Address to run.bat present in Jboss_Home/bin.
And for IIS we passed the second Ip value as default web site in IIS properties.
After doing this when we tried to bring both the servers, then we had a problem saying the port is already bound. After digging a little bit found that the problem is with IIS as it is trying to bind to all the IP addresses on the machine during start up. Something similar to when we pass -b 0.0.0.0 param to Jboss run.bat.
To disable this functiobality on IIS we did the following that is obtained from MS support web site:
Initially people were skecptical whether this is possible.But then we rationalised that it should be possible, because at the end of day on a system every thing translates to a Socket. And the Computer calculates a socket before assigning it to any application. This calculation mainly uses both IP and Port (which normally you configure for ur server). So we have 2 different IP and same port number, which should essentially translate in to 2 unique socket numbers.
To do this we bound Jboss to the first Ip by passing parameter -b Ip_Address to run.bat present in Jboss_Home/bin.
And for IIS we passed the second Ip value as default web site in IIS properties.
After doing this when we tried to bring both the servers, then we had a problem saying the port is already bound. After digging a little bit found that the problem is with IIS as it is trying to bind to all the IP addresses on the machine during start up. Something similar to when we pass -b 0.0.0.0 param to Jboss run.bat.
To disable this functiobality on IIS we did the following that is obtained from MS support web site:
| 1. | Open a command prompt and make sure you are in the C:\Inetpub\Adminscripts folder (where C is the IIS installation drive). To do this, type the following lines at the command prompt: C:CD\Inetpub\Adminscripts |
| 2. | After you open the Adminscripts folder, type the following line at the command prompt: cscript adsutil.vbs set w3svc/disablesocketpooling true |
| 3. | The command replies as follows: disablesocketpooling : (BOOLEAN) True |
| 4. | Stop and start the IIS Admin service. |
| 5. | Restart the WWW service. |
Binding Jboss to IP of the machine
Found that by Default Jboss binds itself to localhost of the machine where it is installed. To make it to bind to Ip of the machine passed a argument -b IpAddress (e.g -b 10.96.2.120) to run.bat present in Jboss_home/bin
To bind it to both local host and IP pass -b 0.0.0.0
During development if the Jboss server is controlled from IDE like eclipse, then run.bat file will not be picked. So for this you can pass the above parameter in Eclipse itself through program arguments dialog box.
To bind it to both local host and IP pass -b 0.0.0.0
During development if the Jboss server is controlled from IDE like eclipse, then run.bat file will not be picked. So for this you can pass the above parameter in Eclipse itself through program arguments dialog box.
Thursday, May 22, 2008
Hibernate problem Found two representations of same collection
Encountered the above problem when hibernate session is cleared(session.clear()after an object with collections is loaded) and tried to re-attach the loaded object by calling session.saveOrUpdate()...Looks like this is an Hibernate issue....For the time being the unwanted call to session.clear() is removed as solution
Subscribe to:
Posts (Atom)