EvaluationException: IllegalArgumentException

Vokabulator

Mitglied
Hallo!

Ich versuche hier, eine JavaEE-Anwendung aufzubauen und bekommen leider nur Fehlermeldungen:

Die Seite lässt sich laden und es wird auch ein Eintrag aus der Datenbank angezeigt. Wenn ich diesen Eintrag aber editieren will, erhalte ich folgenden Fehler:

Code:
2015-01-30T13:02:35.176+0100|Warnung: #{aktionenUebersichtController.doAktionBearbeiten(aktion)}: java.lang.IllegalArgumentException: Cannot convert abc.models.Aktion@3c0436d2 of type class abc.models.Aktion to class abc.models.Aktion
javax.faces.FacesException: #{aktionenUebersichtController.doAktionBearbeiten(aktion)}: java.lang.IllegalArgumentException: Cannot convert abc.models.Aktion@3c0436d2 of type class abc.models.Aktion to class abc.models.Aktion
	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
	at javax.faces.component.UICommand.broadcast(UICommand.java:315)
	at javax.faces.component.UIData.broadcast(UIData.java:1108)
	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
	at java.lang.Thread.run(Thread.java:745)
Caused by: javax.faces.el.EvaluationException: java.lang.IllegalArgumentException: Cannot convert abc.models.Aktion@3c0436d2 of type class abc.models.Aktion to class abc.models.Aktion
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101)
	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
	... 35 more
Caused by: java.lang.IllegalArgumentException: Cannot convert abc.models.Aktion@3c0436d2 of type class abc.models.Aktion to class abc.models.Aktion
	at com.sun.el.lang.ELSupport.coerceToType(ELSupport.java:417)
	at com.sun.el.ExpressionFactoryImpl.coerceToType(ExpressionFactoryImpl.java:77)
	at javax.el.ELContext.convertToType(ELContext.java:473)
	at com.sun.el.lang.EvaluationContext.convertToType(EvaluationContext.java:166)
	at javax.el.ELUtil.invokeMethod(ELUtil.java:320)
	at javax.el.BeanELResolver.invoke(BeanELResolver.java:536)
	at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:256)
	at com.sun.el.parser.AstValue.invoke(AstValue.java:269)
	at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)
	at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
	at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
	at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
	... 36 more

2015-01-30T13:02:35.184+0100|FATAL: JSF1073: javax.faces.FacesException erfasst w�hrend Verarbeitung von INVOKE_APPLICATION 5 : UIComponent-ClientId=, Message=#{aktionenUebersichtController.doAktionBearbeiten(aktion)}: java.lang.IllegalArgumentException: Cannot convert abc.models.Aktion@3c0436d2 of type class abc.models.Aktion to class abc.models.Aktion
2015-01-30T13:02:35.185+0100|FATAL: #{aktionenUebersichtController.doAktionBearbeiten(aktion)}: java.lang.IllegalArgumentException: Cannot convert abc.models.Aktion@3c0436d2 of type class abc.models.Aktion to class abc.models.Aktion
javax.faces.FacesException: #{aktionenUebersichtController.doAktionBearbeiten(aktion)}: java.lang.IllegalArgumentException: Cannot convert abc.models.Aktion@3c0436d2 of type class abc.models.Aktion to class abc.models.Aktion
	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:89)
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
	at java.lang.Thread.run(Thread.java:745)
Caused by: javax.faces.FacesException: #{aktionenUebersichtController.doAktionBearbeiten(aktion)}: java.lang.IllegalArgumentException: Cannot convert abc.models.Aktion@3c0436d2 of type class abc.models.Aktion to class abc.models.Aktion
	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
	at javax.faces.component.UICommand.broadcast(UICommand.java:315)
	at javax.faces.component.UIData.broadcast(UIData.java:1108)
	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
	... 30 more
Caused by: javax.faces.el.EvaluationException: java.lang.IllegalArgumentException: Cannot convert abc.models.Aktion@3c0436d2 of type class abc.models.Aktion to class abc.models.Aktion
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101)
	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
	... 35 more
Caused by: java.lang.IllegalArgumentException: Cannot convert abc.models.Aktion@3c0436d2 of type class abc.models.Aktion to class abc.models.Aktion
	at com.sun.el.lang.ELSupport.coerceToType(ELSupport.java:417)
	at com.sun.el.ExpressionFactoryImpl.coerceToType(ExpressionFactoryImpl.java:77)
	at javax.el.ELContext.convertToType(ELContext.java:473)
	at com.sun.el.lang.EvaluationContext.convertToType(EvaluationContext.java:166)
	at javax.el.ELUtil.invokeMethod(ELUtil.java:320)
	at javax.el.BeanELResolver.invoke(BeanELResolver.java:536)
	at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:256)
	at com.sun.el.parser.AstValue.invoke(AstValue.java:269)
	at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)
	at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
	at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
	at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
	... 36 more

Leider werde ich daraus überhaupt nicht schlau. Ich weiß nicht, wo ich versuche, diesen Cast auszuführen... Ich weiß auch nicht, wie viel Code ich hier zeigen soll...

Für Tipps und Hilfe wäre ich sehr dankbar!
 

CptSocket

Aktives Mitglied
Hallo

So wie's aussieht wird irgendwo eine Instanz der Klasse Aktion in den Typen Aktion konvertiert werden. (Und zwar unmittelbar vor dem Aufruf von #{aktionenUebersichtController.doAktionBearbeiten(aktion)}).

Ist es möglich, dass die Klasse Aktion zweimal definiert ist?

Ich würde da wo die Exception geworfen wird (javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101)) einen Breakpoint setzen und die Klasse der Instanz mit der erwarteten Klasse vergleichen.


Freundliche Grüsse
CptSocket
 

Vokabulator

Mitglied
ALso zweimal definiert ist sie nicht, aber ich hatte zu testzwecken schon was in die dazugehörige Datenbanktabelle geschrieben, vielleicht war das das Problem. Hab die Daten jetzt aus der Tabelle gelöscht und das Problem ist erstmal weg. Aber jetzt habe ich ein neues, aus dem ich noch weniger schlau werde :D ABer das ist ein anderer Post. Danke erstmal für die Antwort.
 

Ähnliche Java Themen

Neue Themen


Oben