<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JavaBeat &#187; JAXB</title>
	<atom:link href="http://www.javabeat.net/category/jaxb/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javabeat.net</link>
	<description>Java Technology News</description>
	<lastBuildDate>Mon, 13 May 2013 20:10:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>JAXB Exception : nor any of its super class is known to this context</title>
		<link>http://www.javabeat.net/2012/04/jaxb-exception-nor-any-of-its-super-class-is-known-to-this-context/</link>
		<comments>http://www.javabeat.net/2012/04/jaxb-exception-nor-any-of-its-super-class-is-known-to-this-context/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 05:23:38 +0000</pubDate>
		<dc:creator>krishnas</dc:creator>
				<category><![CDATA[JAXB]]></category>

		<guid isPermaLink="false">http://www.javabeat.net/examples/?p=1018</guid>
		<description><![CDATA[<p>Connect to us ( <a href="https://twitter.com/javabeat">@twitter</a> | <a href="https://www.facebook.com/javabeat.net">@facebook )</p><p>When you are working with the JAXB objects, there are some times you would encounter the exception saying the &#8220;nor any of its super class is known to this context&#8221;. The reason for this error could be many reasons it depends on the environment you are working. The simple solution for fixing the problem is [...]</p>]]></description>
				<content:encoded><![CDATA[<p>Connect to us ( <a href="https://twitter.com/javabeat">@twitter</a> | <a href="https://www.facebook.com/javabeat.net">@facebook )</p><div class="wpInsert wpInsertInPostAd wpInsertLeft" style="float: left; margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* Article-Rect */
google_ad_slot = "9976259118";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><a id="dd_start"></a><p>When you are working with the JAXB objects, there are some times you would encounter the exception saying the &#8220;nor any of its super class is known to this context&#8221;. The reason for this error could be many reasons it depends on the environment you are working. The simple solution for fixing the problem is to add</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">@XmlSeeAlso({ClassName.class})</pre></td></tr></table></div>

<p>element in all the classes generated by the JAXB generator. For example, if you are trying to marshall the java object into the XML file using the following code:</p><div class="wpInsert wpInsertInPostAd wpInsertMiddle" style="margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* Article-Middle-Med-Rect */
google_ad_slot = "7805667846";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">JAXBContext jaxbContext = JAXBContext     .newInstance(&quot;com.request&quot;);
&nbsp;
   Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
&nbsp;
   // output pretty printed
&nbsp;
   jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
&nbsp;
   RequestClass request = new RequestClass();
&nbsp;
   jaxbMarshaller.marshal(requestClass, file);</pre></td></tr></table></div>

<p>The XML file will be generated base don the RequestClass. All the other files would have to add the @XmlSeeAlso({RequestClass.class}) to avoid this exception. It is only the work around and not the fixed solution for this problem.</p>
<div class='dd_outer'><div class='dd_inner'><div id='dd_ajax_float'><div class='dd_button_v'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Fwww.javabeat.net%2F2012%2F04%2Fjaxb-exception-nor-any-of-its-super-class-is-known-to-this-context%2F" send="false" show_faces="false"  layout="box_count" width="50"  ></fb:like></div><div style='clear:left'></div><div class='dd_button_v'><script type='text/javascript' src='https://apis.google.com/js/plusone.js'></script><g:plusone size='tall' href='http://www.javabeat.net/2012/04/jaxb-exception-nor-any-of-its-super-class-is-known-to-this-context/'></g:plusone></div><div style='clear:left'></div><div class='dd_button_v'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.javabeat.net/2012/04/jaxb-exception-nor-any-of-its-super-class-is-known-to-this-context/" data-count="vertical" data-text="JAXB Exception : nor any of its super class is known to this context" data-via="javabeat" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style='clear:left'></div><div class='dd_button_extra_v'><script type="text/javascript">jQuery(document).load(function(){ stLight.options({publisher:'bab47279-62c9-46af-addc-79fd1fe8fee0'}); });</script><div class="st_email_custom"><span id='dd_email_text'>email</span></div></div><div style='clear:left'></div><div class='dd_button_extra_v'><div id='dd_print_button'><span id='dd_print_text'><a href='javascript:window:print()'>print</a></span></div></div><div style='clear:left'></div></div></div></div><script type="text/javascript">var dd_offset_from_content = 44; var dd_top_offset_from_content = 0;</script><script type="text/javascript" src="http://www.javabeat.net/wp-content/plugins/digg-digg//js/diggdigg-floating-bar.js?ver=5.3.0"></script><div class="wpInsert wpInsertInPostAd wpInsertBelow" style="margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* JB-Footer-LU 468x15 */
google_ad_slot = "8789107210";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>]]></content:encoded>
			<wfw:commentRss>http://www.javabeat.net/2012/04/jaxb-exception-nor-any-of-its-super-class-is-known-to-this-context/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
