MarshalException: Failed to communicate due to unread block data [closed] - java

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I am getting this exception in my java program.Can anyone have idea on it?
MarshalException: Failed to communicate due to unread block data
java.rmi.MarshalException: Failed to communicate.
Problem during marshalling/unmarshalling; nested exception is:
java.lang.IllegalStateException: unread block data
com.naresh.product.common.exception.ApplicationException:
java.rmi.MarshalException: Failed to communicate.
Problem during marshalling/unmarshalling; nested exception is:
java.lang.IllegalStateException: unread block data
at com.naresh.product.client.library.util.ServerDelegate.search(Unknown Source)
at com.naresh.product.client.Product.workflow.form4.ProductForm4DashboardView.refreshDashboard(Unknown Source)
at com.naresh.product.client.Product.workflow.form4.ProductForm4DashboardView.access$3(Unknown Source)
at com.naresh.product.client.Product.workflow.form4.ProductForm4DashboardView$7.run(Unknown Source)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
at com.naresh.product.client.Product.workflow.form4.ProductForm4DashboardView.refreshDashboard(Unknown Source)
at com.naresh.product.client.Product.workflow.form4.ProductForm4DashboardView$5.widgetSelected(Unknown Source)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at com.naresh.product.client.app.Application.start(Unknown Source)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
Caused by: java.rmi.MarshalException: Failed to communicate. Problem during marshalling/unmarshalling; nested exception is:
java.lang.IllegalStateException: unread block data
at org.jboss.remoting.transport.socket.SocketClientInvoker.handleException(SocketClientInvoker.java:122)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:646)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
at org.jboss.remoting.Client.invoke(Client.java:1634)
at org.jboss.remoting.Client.invoke(Client.java:548)
at org.jboss.invocation.unified.interfaces.UnifiedInvokerProxy.invoke(UnifiedInvokerProxy.java:183)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
at $Proxy1.search(Unknown Source)
... 34 more
Caused by: java.lang.IllegalStateException: unread block data
at java.io.ObjectInputStream$BlockDataInputStream.setBlockDataMode(ObjectInputStream.java:2376)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1360)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObjectVersion2_2(JavaSerializationManager.java:239)
at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:133)
at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:120)
at org.jboss.invocation.unified.marshall.InvocationUnMarshaller.read(InvocationUnMarshaller.java:59)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.versionedRead(MicroSocketClientInvoker.java:957)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:586)
... 45 more
Why this exception is comming. Do you guys have any idea to solve it?

From java.io.ObjectInputStream.BlockDataInputStream Javadoc :
boolean java.io.ObjectInputStream.BlockDataInputStream.setBlockDataMode(boolean newmode) throws IOException
Sets block data mode to the given mode (true == on, false == off) and
returns the previous mode value. If the new mode is the same as the
old mode, no action is taken. Throws IllegalStateException if block
data mode is being switched from on to off while unconsumed block data
is still present in the stream.
But in your stacktrace, the problem takes its origin from org.jboss.remoting.transport.socket.MicroSocketClientInvoker which processes deserialization on some objects.
So, you can imagine that it is hard to guess the cause of this error with just a stacktrace.
With a little luck, you could have a precise answer.
But if it is not the case, I propose you some tracks :
to update or downgrade the version of the jboss lib if possible. Maybe, it is a bug.
to run your server with breakpoints to discover the root of the problem.
to ask your question to JBoss support

Related

How to resolve "Caused by: org.hibernate.HibernateException: Unable to access lob stream"

I have recently Upgraded my application.
Upgradation details:
- Java 6 to Java 8
- Hibernate 3 to Hibernate 3.6.10
- Spring 2.5 to Spring 4
- JBoss EAP 6 to JBoss EAP 7
I am trying to save some values which include some text values and files(Clob). The data is getting saved but I am getting an exception on the next hibernate operation.
Caused by: org.hibernate.HibernateException: Unable to access lob stream
at org.hibernate.type.descriptor.java.ClobTypeDescriptor.unwrap(ClobTypeDescriptor.java:117)
at org.hibernate.type.descriptor.java.ClobTypeDescriptor.unwrap(ClobTypeDescriptor.java:46)
at org.hibernate.type.descriptor.sql.ClobTypeDescriptor$3$1.doBind(ClobTypeDescriptor.java:83)
at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:91)
at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:283)
at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:278)
at org.hibernate.type.AbstractSingleColumnStandardBasicType.nullSafeSet(AbstractSingleColumnStandardBasicType.java:89)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2184)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2559)
at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2495)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2822)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:113)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:185)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
at com.honeywell.cdd.dao.RptGrpDAOImpl.removeUnConfigGrpMTDT(RptGrpDAOImpl.java:2373)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:112)
... 68 more
Caused by: java.sql.SQLException: could not reset reader
at org.hibernate.engine.jdbc.ClobProxy.resetIfNeeded(ClobProxy.java:178)
at org.hibernate.engine.jdbc.ClobProxy.getCharacterStream(ClobProxy.java:89)
at org.hibernate.engine.jdbc.ClobProxy.invoke(ClobProxy.java:121)
at com.sun.proxy.$Proxy133.getCharacterStream(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.hibernate.engine.jdbc.SerializableClobProxy.invoke(SerializableClobProxy.java:74)
at com.sun.proxy.$Proxy132.getCharacterStream(Unknown Source)
at org.hibernate.type.descriptor.java.ClobTypeDescriptor.unwrap(ClobTypeDescriptor.java:114)
... 98 more
I am not able to find out exact cause of this exception.
> The Same Code is working fine in the older configuration
"The Same Code is working fine in the older configuration"
is not really relevant ... unless you want to submit a but report to someone.
Lets look at what the nested exception:
Caused by: java.sql.SQLException: could not reset reader
The stacktrace indicates that something is calling getCharacterStream() on a Clob proxy and that is failing when the proxy attempts to reset the proxy's reader. The failure is (presumably) occurring because the JDBC object wrapped by the proxy doesn't allow a reader to be reset.
So why is this happening?
Again ... presumably ... something in your application has tried to call getCharacterStream() twice on a Clob proxy.
My guess is that you are (implicitly) using Clob objects as if they were in-memory files ... to avoid reading them when you don't need to. Except that sometimes you need to, and this is interfering with the persisting.

Eclipse debugging for null pointer exception

I am getting a NullPointerException as shown below.
However, the debugger is not able to bring it up when enabled in this method, the code is getting invoked with reflections. Can you please provide me ideas\techniques to be able to debug this code?
[10/18/16 18:20:47:933 EST] 00000051 DWLExceptionU E java.lang.NullPointerException
at com.dwl.base.notification.NotificationManager$NotificationChannel.notify(NotificationManager.java:662)
at com.dwl.base.notification.NotificationManager$NotificationType.notify(NotificationManager.java:402)
at com.dwl.base.notification.NotificationManager.notify(NotificationManager.java:1454)
at com.dwl.base.notification.bean.impl.NotificationBean.notify(NotificationBean.java:142)
at com.dwl.base.notification.EJSLocalCSLNotification_e2801c59.notify(EJSLocalCSLNotification_e2801c59.java)
at com.dwl.base.notification.EJSProxy$$NotificationLocal.notify(Unknown Source)
at au.com.xxxxx.mdm.notification.NotificationHelper.sendNotification(NotificationHelper.java:75)
at au.com.xxxxxx.mdm.behaviour.SingleCustomerViewId.triggerNotification(SingleCustomerViewId.java:159)
at au.com.xxxxxxx.mdm.behaviour.SingleCustomerViewId.execute(SingleCustomerViewId.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:613)
at com.dwl.base.extensionFramework.JavaExtensionSet.invoke(JavaExtensionSet.java:159)
at com.dwl.base.extensionFramework.ExtensionHandler.executeExtension(ExtensionHandler.java:251)
at com.dwl.base.DWLCommonComponent.handleExtensions(DWLCommonComponent.java:1380)
at com.dwl.base.DWLCommonComponent.postExecute(DWLCommonComponent.java:509)
at com.dwl.tcrm.common.TCRMCommonComponent.postExecute(TCRMCommonComponent.java:263)
at com.dwl.tcrm.coreParty.component.TCRMPersonComponent.addPerson(TCRMPersonComponent.java:1641)
at com.dwl.tcrm.coreParty.component.TCRMPartyComponent.addPerson(TCRMPartyComponent.java:3079)
at com.dwl.tcrm.coreParty.component.TCRMPartyComponent.addPartySimple(TCRMPartyComponent.java:2813)
at com.dwl.tcrm.coreParty.component.TCRMPartyComponent.addParty(TCRMPartyComponent.java:2471)
at com.dwl.tcrm.coreParty.controller.TCRMCorePartyTxnBean.addPerson(TCRMCorePartyTxnBean.java:1764)
at Proxy5aa32899_c04f_46c5_9706_69af241cd3c4.addPerson(Unknown Source)
at Proxy5aa32899_c04f_46c5_9706_69af241cd3c4.addPerson(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:613)
at com.dwl.base.requestHandler.DWLTxnBP.processPersistentObject(DWLTxnBP.java:262)
at com.dwl.base.requestHandler.DWLTxnBP.execute(DWLTxnBP.java:115)
at com.dwl.base.requestHandler.DWLTxnProcessor.processTx(DWLTxnProcessor.java:98)
at com.dwl.unifi.tx.manager.CTxRxFacade.processTxNormal(CTxRxFacade.java:681)
at com.dwl.unifi.tx.manager.CTxRxFacade.processTx(CTxRxFacade.java:544)
at com.dwl.base.requestHandler.DWLRequestHandler.processTransaction(DWLRequestHandler.java:1187)
at com.dwl.base.requestHandler.DWLRequestHandler.processTx(DWLRequestHandler.java:591)
at com.dwl.base.requestHandler.DWLServiceControllerBase.processRequest(DWLServiceControllerBase.java:253)
at com.dwl.base.requestHandler.beans.EJSRemoteCSLDWLServiceController_2c54996d.processRequest(EJSRemoteCSLDWLServiceController_2c54996d.java)
at com.dwl.base.requestHandler.beans._EJSRemoteCSLDWLServiceController_2c54996d_Tie.processRequest(_EJSRemoteCSLDWLServiceController_2c54996d_Tie.java:1)
at com.dwl.base.requestHandler.beans._EJSRemoteCSLDWLServiceController_2c54996d_Tie._invoke(_EJSRemoteCSLDWLServiceController_2c54996d_Tie.java)
at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:669)
at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:523)
at com.ibm.rmi.iiop.ORB.process(ORB.java:523)
at com.ibm.CORBA.iiop.ORB.process(ORB.java:1575)
at com.ibm.rmi.iiop.Connection.doRequestWork(Connection.java:3039)
at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2922)
at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:64)
at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
Can you please provide me ideas\techniques to be able to debug this code?
Since you said the method is called from reflection, you can see that in the stacktrace.
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:613)
So, keep reading up from that.
I'm guessing you intentionally edited the xxxx values, so these are your libraries that are being dynamically called.
at au.com.xxxxx.mdm.notification.NotificationHelper.sendNotification(NotificationHelper.java:75)
at au.com.xxxxxx.mdm.behaviour.SingleCustomerViewId.triggerNotification(SingleCustomerViewId.java:159)
at au.com.xxxxxxx.mdm.behaviour.SingleCustomerViewId.execute(SingleCustomerViewId.java:129)
Then, the rest of the call stack just goes through some other code library within the same package.
at com.dwl.base.notification.NotificationManager$NotificationChannel.notify(NotificationManager.java:662)
at com.dwl.base.notification.NotificationManager$NotificationType.notify(NotificationManager.java:402)
at com.dwl.base.notification.NotificationManager.notify(NotificationManager.java:1454)
at com.dwl.base.notification.bean.impl.NotificationBean.notify(NotificationBean.java:142)
at com.dwl.base.notification.EJSLocalCSLNotification_e2801c59.notify(EJSLocalCSLNotification_e2801c59.java)
at com.dwl.base.notification.EJSProxy$$NotificationLocal.notify(Unknown Source)
So, the problem definitely starts at NotificationHelper.sendNotification(NotificationHelper.java:75), but it cannot easily be determined the path that the code took in order to reach its eventual destination or what exactly caused the exception without inspecting the source of (NotificationManager.java:662)

how to solve this issue about InvalidClassException when deserializing objects from inputstream?

I am using james2.3.2 to be my mail server and the backend is mysql 5.5.
I got a exception as the following:
23/06/11 16:39:49 DEBUG mailstore: Exception reading attributes Mail1308818378708-0-to-163.com in spool
java.io.InvalidClassException: [Ljava.lang.StackTraceElement;; enum descriptor has non-zero serialVersionUID: 163864874655243298
at java.io.ObjectStreamClass.readNonProxy(ObjectStreamClass.java:620)
at java.io.ObjectInputStream.readClassDescriptor(ObjectInputStream.java:789)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1534)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1591)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1910)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1834)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at java.util.HashMap.readObject(HashMap.java:1067)
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 java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1812)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.apache.james.mailrepository.JDBCMailRepository.retrieve(JDBCMailRepository.java:846)
at org.apache.james.mailrepository.JDBCSpoolRepository.accept(JDBCSpoolRepository.java:203)
at org.apache.james.mailrepository.JDBCSpoolRepository.accept(JDBCSpoolRepository.java:126)
at org.apache.james.mailrepository.MailStoreSpoolRepository.accept(MailStoreSpoolRepository.java:105)
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 org.apache.avalon.phoenix.components.application.BlockInvocationHandler.invoke(BlockInvocationHandler.java:134)
at $Proxy5.accept(Unknown Source)
at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:299)
at java.lang.Thread.run(Thread.java:595)
How to solve this issue?
Thanks!
I have spent 3 hours on testing with different databases,such as mysql 5.0 and oracle.It workes well on oracle but not on mysql.It seems it's the issue of mysql, not james.

Eclipse "Create Web Service" Showing Weird Error

EDIT 2:
I probably should have mentioned this earlier, but I'm getting a warning after I set up the Web Service (but before it is actually made, where the error occurs). Here is the warning:
The service class
"net.rim.Indy.WebService.Functions_JSONP"
does not comply to one or more
requirements of the JAX-RPC 1.1
specification, and may not deploy or
function correctly.
And the juice:
The service class
"net.rim.Indy.WebService.Functions_JSONP"
does not comply to one or more
requirements of the JAX-RPC 1.1
specification, and may not deploy or
function correctly. The field or
property "cause" on the value type
"atg.taglib.json.util.JSONException"
used via the service class
"net.rim.Indy.WebService.Functions_JSONP"
has a data type,
"java.lang.Throwable", that is not
supported by the JAX-RPC 1.1
specification. Instances of the type
may not serialize or deserialize
correctly. Loss of data or complete
failure of the Web service may result.
If this is fixed, I have a feeling the Web Service will start working, because it is identical to another one I have except for the JSON functionality. Something needs to be changed so that my web service is fully supported by the JAX specs.
EDIT:
I'm now getting around the issue where it is automatically choosing the wrong project for me. I followed File->New->Web Service. My settings are as follows:
Web service type: Bottom up
Service implementation: net.aaa.bbb.WebService.Functions_JSONP
Server runtime: Tomcat v6
Web service runtime: Apache Axis
Service project: ABC
Client type: Java Proxy
I check off "Publish the Web service" and hit Next. Then on the next page I hit Next again to generate Functions_JSONP.wsdl and get the following error:
IWAB0398E Error in generating WSDL from Java: java.lang.ClassNotFoundException: net.aaa.bbb.WebService.Functions_JSONP
Here is the full stack trace:
IWAB0398E Error in generating WSDL from Java: java.lang.ClassNotFoundException: net.aaa.bbb.WebService.Functions_JSONP
java.lang.ClassNotFoundException: net.aaa.bbb.WebService.Functions_JSONP
at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:204)
at org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:100)
at org.apache.axis.wsdl.fromJava.Emitter.setCls(Emitter.java:2079)
at org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask.execute(Java2WsdlAntTask.java:188)
at org.eclipse.jst.ws.internal.axis.consumption.core.command.Java2WSDLCommand.executeAntTask(Java2WSDLCommand.java:180)
at org.eclipse.jst.ws.internal.axis.consumption.core.command.Java2WSDLCommand.execute(Java2WSDLCommand.java:95)
at org.eclipse.jst.ws.internal.axis.creation.ui.command.BUCodeGenOperation$BottomUpWSModifyOperation.execute(BUCodeGenOperation.java:122)
at org.eclipse.jst.ws.internal.axis.creation.ui.command.BUCodeGenOperation.execute(BUCodeGenOperation.java:86)
at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.runCommand(CommandFragmentEngine.java:419)
at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.visitTop(CommandFragmentEngine.java:359)
at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.moveForwardToNextStop(CommandFragmentEngine.java:254)
at org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager$6.run(SimpleCommandEngineManager.java:294)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1008)
at org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager.runForwardToNextStop(SimpleCommandEngineManager.java:264)
at org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager.runForwardToNextStop(WizardPageManager.java:91)
at org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager.getNextPage(WizardPageManager.java:154)
at org.eclipse.wst.command.internal.env.ui.widgets.SimpleWizardPage.getNextPage(SimpleWizardPage.java:136)
at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:887)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:426)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:254)
at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:274)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:157)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
What could be the issue?
Thanks!
From your message it looks like a serialization problem. You seem to be exposing a throwable class as part of the public api and this is in violation with JAX-RPC. (Please check your exception classes for instances of throwable. Remove them and you should be fine).
Note: Example of occurrence. If your exception has this, then its a violation.
private Throwable throwable;
public Throwable getThrowable() {
return throwable;
}

Unable to execute a function using reflection

i am developing a eclipse plugin . In this plugin i am using reflection to execute a function in a class present in another project which is a hibernate project.Whenever the invoke is used i.e
mymethod.invoke(myobj);
it is giving this exception
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:37)
at java.lang.reflect.Method.invoke(Method.java:599)
at packagesearch.DummyExecution.execution(DummyExecution.java:154)
at packagesearch.HelloWorldAction.run(HelloWorldAction.java:48)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2384)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:599)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: java.lang.NoClassDefFoundError: org.dom4j.DocumentException
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:72)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:134)
at test.Example.demo1(Example.java:38)
... 36 more
Caused by: java.lang.ClassNotFoundException: org.dom4j.DocumentException
at java.net.URLClassLoader.findClass(URLClassLoader.java:419)
at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:345)
at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
... 40 more
what is the exact problem . i have used loader to load the class.Help
It means exactly what it says, it couldn't find the class org.dom4j.DocumentException. Most likely, your classpath is incorrect.
I wonder if this has anything to do with Hibernate using proxy objects to represent the persistent entities. So in essence, if you checked the class type for an entity x, you may get something like x_javassist_1334 because Hibernate wraps your object to add some persistence specific functionality. I would do a simple check and print out the classname for the object you're invoking the method on before proceeding any further.

Categories