Solved

MBean operation return error?

Posted on 2014-03-07
3
328 Views
Last Modified: 2014-03-17
Hi,

I am working with the MBean and deployed to the JMX server.
One of the operations (methods) return object data type.
One with string/integer/boolean works fine and return the result.
But when the return type is object type, it fails.

Why is it doing that?
What do I need to do to fix it?

The error says:
Problem invoking getxxxxx():java.rmi.unmarshalException: errror unmarshalling return;
the nested exception is: java.io.writeaborstedExceptin: writing aborted;java.io.notserizableexception


mbean.setxxxDao(svcxxxDao);
		ObjectName name = new ObjectName(
				"xx.xxx..mbean:type=ServiceCatalog");

		mbs.registerMBean(mbean, name);
		 System.out.println("Waiting forever..."); 
	     Thread.sleep(Long.MAX_VALUE

Open in new window

);
0
Comment
Question by:dkim18
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 21

Accepted Solution

by:
Amitkumar Panchal earned 500 total points
ID: 39915204
What kind of object does Mbean return?

In EJB world we used to get unmarshalException when we were expecting an object for a custom class (ie. Emplolyee, User, Subscriber) which didn't implement the Serializable interface.

Check at your end, bcaz the object that you are expecting is not implementing Serializable interface. It mentioned in the exception.
"java.io.writeaborstedExceptin: writing aborted;java.io.notserizableexception"
0
 

Author Comment

by:dkim18
ID: 39916120
Thank you for your answer.
My custom class did not use the Serializable.

 I will try that when I get back tomorrow.
0
 

Author Comment

by:dkim18
ID: 39917568
Still getting this error after making it Serializable and also now it is complaining  that object data type class not found error.

Problem invoking getxxxxx():java.rmi.unmarshalException: errror unmarshalling return
ClassNotFoundException.

Do I need to make these class as MBean also?
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Suggested Courses

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question