Pages: [1]
  Print  
Author Topic: My web application does not work but same code works for stanalone application  (Read 1598 times)
nidhi ac
Newbie
*
Posts: 3


« on: July 06, 2009, 04:03:33 AM »

I have written a code that creates a training model for a sample data, which then classifies the actual dataset on the basis of the trained model. however, the code code runs fine when i run it as a stand alone application, however it gives a ClassCastException when i run it as a web application. i m using RapidMiner4.1 , tomcat server & JDK1.6. it gives me error as
com.rapidminer.operator.ContainerModel cannot be cast to com.rapidminer.operator.IOObject
at com.rapidminer.operator.AbstractIOObject.read(AbstractIOObject.java:114)
   at com.rapidminer.operator.io.ModelLoader.apply(ModelLoader.java:94)
   at com.rapidminer.operator.Operator.apply(Operator.java:656)
   at com.rapidminer.operator.OperatorChain.apply(OperatorChain.java:377)
   at com.rapidminer.operator.Operator.apply(Operator.java:656)
   at com.rapidminer.Process.run(Process.java:571)
   at com.rapidminer.Process.run(Process.java:541)
   at com.rapidminer.Process.run(Process.java:531)
   at com.cts.rapidminer.training.CreateExampleSet.classifyTestData(CreateExampleSet.java:198)
   at com.cts.rapidminer.testing.TestDataClassifier.doPost(TestDataClassifier.java:37)

Can somebody please help me?
Logged
Simon Fischer
Administrator
Sr. Member
*****
Posts: 448



WWW
« Reply #1 on: July 06, 2009, 09:04:14 AM »

May I ask what you are trying to achieve?

Does the problem happen on the server or on the client?

Please provide some more information about what is going on. Does the model get serialized? If yes, are you using compatible versions on both sides? Are you sure your web container uses the same class loaders for both classes?

Does the model go through a WebService call? If yes, let me remark that you are loosing the inheritance structure when importing web services on the client side, although I can hardly imagine that this is your problem here.

Cheers,
Simon
Logged

Simon Fischer, Rapid-I
RapidMiner Development on Twitter: @simon_fis
nidhi ac
Newbie
*
Posts: 3


« Reply #2 on: July 09, 2009, 11:00:45 AM »

Simon to answer to ur question r as

May I ask what you are trying to achieve? -- i m trying to apply the model created by the rapidminer to a sample test data.

Does the problem happen on the server or on the client? --- it occurs on the server itself

Please provide some more information about what is going on. -- i m creating a model on a traindataset. the model is getting created (i.e a .mod file is created). When i m tring to apply that model on other sample datadataset by ModelApplier operator of rapidminer i m getting the error.

Does the model get serialized? If yes, are you using compatible versions on both sides?  -- the model is getting serialized. What do u mean by compatible versions on both sides??

Are you sure your web container uses the same class loaders for both classes? --  yes



Logged
Simon Fischer
Administrator
Sr. Member
*****
Posts: 448



WWW
« Reply #3 on: July 10, 2009, 02:36:03 PM »

Hi,

Please provide some more information about what is going on. -- i m creating a model on a traindataset. the model is getting created (i.e a .mod file is created). When i m tring to apply that model on other sample datadataset by ModelApplier operator of rapidminer i m getting the error.

Are you? There is no ModelApplier on the stack trace. I only see the ModelLoader.

Does the model get serialized? If yes, are you using compatible versions on both sides?  -- the model is getting serialized. What do u mean by compatible versions on both sides??

I mean the common notion of compatibility when speaking about Java object serialization. Admittedly, if that was the problem, you would probably get a different exception.

Are you sure your web container uses the same class loaders for both classes? --  yes

Absolutely? Otherwise I cannot imagine why the ContainerModel cannot be cast to IOObject, because it inherits from IOObject.
Could it be that you have several versions of the two classes (ContainerModel and IOObject) on the classpath which are being confused?

You did not answer my question whether anything went through a WebService.

Cheers,
Simon

Logged

Simon Fischer, Rapid-I
RapidMiner Development on Twitter: @simon_fis
nidhi ac
Newbie
*
Posts: 3


« Reply #4 on: July 14, 2009, 09:29:47 AM »

no, i am not using web services.
Logged
Simon Fischer
Administrator
Sr. Member
*****
Posts: 448



WWW
« Reply #5 on: July 15, 2009, 01:40:15 PM »

Any updates? Did you try dumping the classloaders that are being used inside the ModelLoader? That could give some insight as to where the problem is.

We recently had a similar problem that occurs when using more than one plugin. We have changed the class loading mechanism for 4.5 slightly, which might also affect your problem.

Best,
Simon

P.S. Your problem might be related to this one:
http://rapid-i.com/rapidforum/index.php/topic,1056.0.html

4.5. is soon to come, please report whether this affects your problem.
« Last Edit: July 15, 2009, 01:45:47 PM by Simon Fischer » Logged

Simon Fischer, Rapid-I
RapidMiner Development on Twitter: @simon_fis
Pages: [1]
  Print  
 
Jump to: