Solved

MBean operation return error?

Posted on 2014-03-07
3
315 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
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
Amitkumar Panchal earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
powerN  challenge 3 46
word0 challenge 4 52
backtracking recursion  code 19 39
how do i compare an object based on two fields 6 28
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

772 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now