wood burning stoves 2.0*
The moose likes Java in General and the fly likes Invocation target Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Invocation target Exception" Watch "Invocation target Exception" New topic
Author

Invocation target Exception

Nirmal Mukundan
Ranch Hand

Joined: Feb 21, 2007
Posts: 37

Hi,

I was trying to propogate an exception to the client window inorder to display the error message message to the user. I was throwing the user defined exception ConcurrentUserException from the service class and was catching it in the window class. But when executing the program, I am getting the below error trace. I do not know what needs to be corrected. Could any one tell me what needs to be corrected so as to catch the exact "ConcurrentUserException" exception.

This is a swing program in which when I click on a Menu item, the service layer code is getting executed. The service layer code is RMI, in which i have the interface and the implementation classes and the generated stub and skeleton. The method which is invoked throws ConcurrentUserException and RemoteException. Inside this code I have caught a SQL Exceptiion and am trying to throw ConcurrentUserException.

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at com.calypso.tk.service.handler.TransactionInvocationHandler$1.perform(TransactionInvocationHandler.java:509)
at com.calypso.tk.transaction.TransactionAdapter.process(TransactionAdapter.java:46)
at com.calypso.tk.service.handler.TransactionInvocationHandler.invoke(TransactionInvocationHandler.java:402)
at $Proxy11.generateKPISettleExtract(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at com.calypso.tk.service.handler.ServerInvocationHandler.invoke(ServerInvocationHandler.java:109)
at $Proxy11.generateKPISettleExtract(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.reflect.UndeclaredThrowableException
at $Proxy11.generateKPISettleExtract(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at com.calypso.tk.service.handler.TransactionInvocationHandler$1.perform(TransactionInvocationHandler.java:509)
at com.calypso.tk.transaction.TransactionAdapter.process(TransactionAdapter.java:46)
at com.calypso.tk.service.handler.TransactionInvocationHandler.invoke(TransactionInvocationHandler.java:402)
at $Proxy11.generateKPISettleExtract(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at com.calypso.tk.service.handler.ServerInvocationHandler.invoke(ServerInvocationHandler.java:109)
at $Proxy11.generateKPISettleExtract(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:154)
... 4 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at calypsox.tk.service.handler.TradeLockingInvocationHandler.invoke(TradeLockingInvocationHandler.java:324)
at $Proxy11.generateKPISettleExtract(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at com.calypso.tk.service.handler.TransactionInvocationHandler$1.perform(TransactionInvocationHandler.java:509)
at com.calypso.tk.transaction.TransactionAdapter.process(TransactionAdapter.java:46)
at com.calypso.tk.service.handler.TransactionInvocationHandler.invoke(TransactionInvocationHandler.java:402)
at $Proxy11.generateKPISettleExtract(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at com.calypso.tk.service.handler.ServerInvocationHandler.invoke(ServerInvocationHandler.java:109)
at $Proxy11.generateKPISettleExtract(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
... 4 more
Caused by: idea.tradecycle.util.apps.payment.ConcurrentUserException: le verrou outil.pilotage.conf est d?j? pris par un autre processus
at idea.tradecycle.persistence.tk.service.TradeCyclePersistenceServer.generateKPISettleExtract(TradeCyclePersistenceServer.java:7485)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at calypsox.tk.service.handler.TradeLockingInvocationHandler.invoke(TradeLockingInvocationHandler.java:324)
at $Proxy11.generateKPISettleExtract(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at com.calypso.tk.service.handler.TransactionInvocationHandler$1.perform(TransactionInvocationHandler.java:509)
at com.calypso.tk.transaction.TransactionAdapter.process(TransactionAdapter.java:46)
at com.calypso.tk.service.handler.TransactionInvocationHandler.invoke(TransactionInvocationHandler.java:402)
at $Proxy11.generateKPISettleExtract(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at com.calypso.tk.service.handler.ServerInvocationHandler.invoke(ServerInvocationHandler.java:109)
at $Proxy11.generateKPISettleExtract(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:154)
... 4 more

Regards
Nirmal
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3605
    
  14

I doubt anyone here can tell you that, since we don't have access to your code. When you have a problem, TellTheDetails please.

Try to make an SSCCE that demonstrates the problem you're having and post it here.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

You can get an InvocationTargetException when you call a method via reflection. If the target method (the method that's called through the reflection API) throws an exception, then this will be propagated as an InvocationTargetException. You could catch the InvocationTargetException and look inside it, to get the cause. The cause will be the original exception thrown by the method.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Invocation target Exception
 
Similar Threads
Problem deploying sample HelloWorld Bean in JBoss 4.2.1 GA
Issue looking up session bean in UDP
Error while accessing JNDI Bindings over IIOP
Session Beans in Jboss
faint for cmp