• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Invocation target Exception

 
Ranch Hand
Posts: 37
Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 15743
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic