Help coderanch get a
new server
by contributing to the fundraiser

Saptarshi Chakraborty

+ Follow
since Jul 26, 2007
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Saptarshi Chakraborty

I am having exactly the same problem on this similar code .
12 years ago
Can I use ContextLoaderServlet instead of DispatcherServlet ?
I think ContextLoaderListener or ContextLoaderServlet should be used if I want the objects to be visible application wide.The code above will initialize objects for that specific servlet.
Am I right ?
13 years ago
Thanks Raj.
But anything to write inside web.xml as <servlet-class> (like org.springframework.web.servlet.DispatcherServlet when we use spring MVC) .
13 years ago
Thanks Raj.
but what to write inside web.xml as <servlet-class> ?
There should be a spring servlet (like org.springframework.web.servlet.DispatcherServlet when I am using spring MVC) which will initialize the other objects through IOC.
13 years ago
Hi All,

I am new in Spring framework. I want to initialize a process using spring framework.
Typically this can be done by overriding init() method in servlet and making the <load-on-startup>1</load-on-startup> in web.xml .I want to use spring as it provides DI features through which I can initialize the dependent objects in time of initialization.
Please guide me how this can be done by using spring. What should be the servlet class in web.xml.

13 years ago
Hi all,
I am a java programmer and I am familiar with Windows only. I want to migrate to Linux.I don't have much knowledge about linux and I am a complete beginner .Which Linux you people suggest for me . Does choosing any linux will help me.Suppose I am starting with Ubuntu will it help me to develop application in Fedora Core also.
14 years ago
Hi all ,
I am new to ejb 2 entity bean. I am creating a simple application with entity bean and JBoss 4.0.2.As i want want my application to grow further i am maintaining few design patterns like service locator and delegate. I have made two .jar files and one .war file .In one .jar i have all the ejb classes(D_SEjb.jar) and in another(L_simple.jar) service locator and delegate classes. I am putting first .jar along with the .war in deploy folder and the later in lib folder of JBoss.My ejb gets deployed easily and creates the necessary table but when the create method is called from the client to save the data in the database it gives a Class cast exception in the service locator in the PortableRemoteObject.narrow(objref, className) part.
My sevice locator method looks like this:

and in delegate it casted to the Home interface l like this :

My entity bean is:

After running XDoclet my home interface and ejb-jar.xml looks like this

home interface :

part of my ejb-jar.xml looks like this:

and the stack trace is

2009-10-04 11:48:24,119 INFO [STDOUT] at
2009-10-04 11:48:24,119 INFO [STDOUT] at javax.rmi.PortableRemoteObject.narrow(
2009-10-04 11:48:24,159 INFO [STDOUT] at com.ejbSimple.serviceLocator.AppServiceLocator.getHome(
2009-10-04 11:48:24,159 INFO [STDOUT] at com.ejbSimple.delegate.Simpledelegate.<init>(
2009-10-04 11:48:24,159 INFO [STDOUT] at com.ejbSimple.action.simpleAction.execute(
2009-10-04 11:48:24,159 INFO [STDOUT] at org.apache.struts.action.RequestProcessor.processActionPerform(
2009-10-04 11:48:24,159 INFO [STDOUT] at org.apache.struts.action.RequestProcessor.process(
2009-10-04 11:48:24,159 INFO [STDOUT] at org.apache.struts.action.ActionServlet.process(
2009-10-04 11:48:24,209 INFO [STDOUT] at org.apache.struts.action.ActionServlet.doGet(
2009-10-04 11:48:24,219 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(
2009-10-04 11:48:24,219 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(
2009-10-04 11:48:24,229 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
2009-10-04 11:48:24,229 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(
2009-10-04 11:48:24,229 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(
2009-10-04 11:48:24,229 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
2009-10-04 11:48:24,229 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(
2009-10-04 11:48:24,229 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(
2009-10-04 11:48:24,289 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(
2009-10-04 11:48:24,299 INFO [STDOUT] at
2009-10-04 11:48:24,299 INFO [STDOUT] at
2009-10-04 11:48:24,299 INFO [STDOUT] at
2009-10-04 11:48:24,299 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(
2009-10-04 11:48:24,299 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(
2009-10-04 11:48:24,319 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(
2009-10-04 11:48:24,319 INFO [STDOUT] at org.apache.catalina.connector.CoyoteAdapter.service(
2009-10-04 11:48:24,319 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(
2009-10-04 11:48:24,319 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(
2009-10-04 11:48:24,319 INFO [STDOUT] at
2009-10-04 11:48:24,329 INFO [STDOUT] at
2009-10-04 11:48:24,329 INFO [STDOUT] at
2009-10-04 11:48:24,329 INFO [STDOUT] Caused by: java.lang.ClassCastException: $Proxy53 cannot be cast to org.omg.CORBA.Object
2009-10-04 11:48:24,329 INFO [STDOUT] at
2009-10-04 11:48:24,329 INFO [STDOUT] ... 29 more

I tried by putting L_simple.jar in the deploy but that didn't solve the problem.
Can any body help to figure out where the problem is and what mistake I made.
Hi all,
I'm a new learner in EJB 2. I am creating a demo application in EJB 2 CMP with JBoss 4.0.2. In my bean within the tag I've written

After running the XDoclet the jbosscmp-jdbc.xml comes like this

While deploying my log file gives the following exception
org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml : datasource-mapping postgreSQL not found
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData.<init>(
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.<init>(
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(
at org.jboss.ejb.plugins.CMPPersistenceManager.start(

Do I need to change anything in the standardjbosscmp-jdbc.xml in conf folder because <datasource-mapping> is tagged as optional from version 4.0.Though I changed the <datasource-mapping> but it still the same error.
nad my postgre-ds.xml is written like this

Hi folks,
I am going to write a hand over document of a project which was written in j2ee.I have not been able to find any template .Can any one provide me a good template for a hand over document in a java project?If not the template at least guide me to write it.
14 years ago
hi folks,

How can i know the size of an ArrayList through any of the struts logic tag and EL or JSTL?
I am sending an arraylist consisting of several objects from action and before iterating it in jsp I want to check whether the arraylist is not null or its size is greater than zero. To solve it I don't want to use scriptlet .Please try to provide the solution with struts logic tag,EL or jstl.
15 years ago
hi folks,
I'm new to hibernate.In my code there is a pojo object like

and the corresponding mapping file is

isactive column takes integer datatype in the table department .So is in my hbm file.That means it takes value 0 or 1 to represent boolean output.In my pojo I am putting the isActive property as boolean.
Now I am having problem while writing criteria query.

It gives the exception like
org.hibernate.PropertyAccessException: IllegalArgumentException occurred

If I convert 'isActive' to boolean it is showing class cast exception.
In a nutshell what should I do if the datatype of any property in the pojo class is different from the datatype of the same property in the hbm file (but the property in the hbm file has same datatype with column in the database table).
Is there any solution if I want to solve this problem keeping my pojo class and the database table intact?
I was wrong in my approach.Date objects don't have a format.A date is the number of milliseconds since Jan 1st, 1970 UTC. It is a number. It has no format. SimpleDateFormat can parse it to a String with our desired format.
15 years ago
yes I want to convert a Date into a Date with a specific format.
15 years ago
hi folks ,
I am having a problem in SimpleDateFormat class. I have a method like this

running the code throws an exception like

Unparseable date: "Tue May 05 13:38:42 IST 2009"
at java.text.DateFormat.parse(Unknown Source)

Can any one figure out what is the problem here in this code?
and how can I convert the date to my desired format.
15 years ago
I am using Eclipse JBoss IDE . I tried that approach by copying the file to the classes directory and it worked fine,but is this a right approach ??In development time we put all the configuration files inside the WEB-INF directory just like struts-config.xml,web.xml.
Yes you are right right I put all the pojos,along with the *.hbm.xml files inside a different jar file .This is because I tried to follow the enterprise development structure and the design patterns (front-controller,business delegate, etc) and I am quite familiar with DAO pattern also .That is why I am trying the same approach simply by using hibernate instead of normal sqls .