Solved

MBean operation return error?

Posted on 2014-03-07
3
325 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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

751 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