Using JBossXB-1.0.0.CR5 in JBoss-4.0.4.GA compiled with JBossXB-1.0.0.CR4 may not work.
NOTE: this is only about the CR5. In the CR6 the stale API was reinstated.
I.e. during the startup of the server a few exceptions like the following will be thrown:
15:55:05,015 ERROR [MainDeployer] Could not initialise deployment: file:/E:/cvsroot/JBoss_4_0_4_GA/jboss-4.0.x /build/output/jboss-4.0.4.GA/server/default/deploy/jms/jms-ra.rar org.jboss.deployment.DeploymentException: Error parsing meta data jar:file:/E:/cvsroot/JBoss_4_0_4_GA/jboss-4. 0.x/build/output/jboss-4.0.4.GA/server/default/tmp/deploy/tmp16157jms-ra.rar!/META-INF/ra.xml; - nested throwa ble: (java.lang.NoSuchMethodError: org.jboss.xb.binding.Unmarshaller.unmarshal(Ljava/lang/String;Lorg/jboss/xb /binding/ObjectModelFactory;Lorg/jboss/xb/binding/metadata/unmarshalling/DocumentBinding;)Ljava/lang/Object;) at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:53) at org.jboss.deployment.ObjectModelFactorySimpleSubDeployerSupport.parseMetaData(ObjectModelFactorySim pleSubDeployerSupport.java:56) at org.jboss.deployment.SimpleSubDeployerSupport.init(SimpleSubDeployerSupport.java:88) at org.jboss.deployment.MainDeployer.init(MainDeployer.java:861) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:798) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
This happens with both Sun's and JRockit JVMs.
The not found method and the
org.jboss.xb.binding.metadata.unmarshalling.DocumentBinding
were removed in 1.0.0.CR5. In fact, noone actually is trying to call the method. The calling line is
di.metaData = unmarshaller.unmarshal(url.toString(), factory, (Object)null);
The method being called does exist in 1.0.0.CR5.
Interesting that running the following class produces the expected result.
public class C { public void m(String str) { System.out.println("m(str): " + str); } public void m(Object o) { System.out.println("m(o): " + o); } public static void main(String[] args) { C c = new C(); c.m("string"); c.m((Object)"object"); c.m(null); c.m((Object)null); } }
Output:
m(str): string m(o): object m(str): null m(o): null
To make JBoss-4.0.4.GA work with JBossXB-1.0.0.CR5 the JBoss-4.0.4.GA should be recompiled with JBossXB-1.0.0.CR5 in the thirdparty folder.
Also there is 1.0.0.CR5_JBoss-4.0.4.GA version in the
repository.jboss.com\jboss\jbossxb
that reinstates the
DocumentBinding
and removed unmarshalling methods to avoid the need to recompile the whole server.
The diff committed to JBossXB_1_0_0_CR5-JBoss_4_0_4_GA:
User: aloubyansky Date: 06/06/09 09:36:12 Modified: src/main/org/jboss/xb/binding Tag: JBossXB_1_0_0_CR5-JBoss_4_0_4_GA Unmarshaller.java UnmarshallerImpl.java Log: reinstate DocumentBinding interface and unmarshalling methods for binary compatibility with 4.0.4.GA compiled with JBossXB 1.0.0.CR4 and Sun's JVM Revision Changes Path No revision No revision 1.8.2.1 +6 -1 jboss-common/src/main/org/jboss/xb/binding/Unmarshaller.java (In the diff below, changes in quantity of whitespace are not shown.) Index: Unmarshaller.java =================================================================== RCS file: /cvsroot/jboss/jboss-common/src/main/org/jboss/xb/binding/Unmarshaller.java,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -b -r1.8 -r1.8.2.1 --- Unmarshaller.java 26 May 2006 15:14:29 -0000 1.8 +++ Unmarshaller.java 9 Jun 2006 13:36:12 -0000 1.8.2.1 @@ -27,12 +27,13 @@ import org.jboss.xb.binding.parser.JBossXBParser; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver; +import org.jboss.xb.binding.metadata.unmarshalling.DocumentBinding; import org.xml.sax.EntityResolver; import org.xml.sax.ErrorHandler; /** * @author <a href="mailto:alex@jboss.org">Alexey Loubyansky</a> - * @version <tt>$Revision: 1.8 $</tt> + * @version <tt>$Revision: 1.8.2.1 $</tt> */ public interface Unmarshaller { @@ -79,4 +80,8 @@ Object unmarshal(InputStream is, ObjectModelFactory factory, Object root) throws JBossXBException; Object unmarshal(String systemId, ObjectModelFactory factory, Object root) throws JBossXBException; + + Object unmarshal(String systemId, ObjectModelFactory factory, DocumentBinding binding) throws JBossXBException; + + Object unmarshal(Reader reader, ObjectModelFactory factory, DocumentBinding binding) throws JBossXBException; } 1.11.2.1 +21 -1 jboss-common/src/main/org/jboss/xb/binding/UnmarshallerImpl.java (In the diff below, changes in quantity of whitespace are not shown.) Index: UnmarshallerImpl.java =================================================================== RCS file: /cvsroot/jboss/jboss-common/src/main/org/jboss/xb/binding/UnmarshallerImpl.java,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -b -r1.11 -r1.11.2.1 --- UnmarshallerImpl.java 26 May 2006 15:14:29 -0000 1.11 +++ UnmarshallerImpl.java 9 Jun 2006 13:36:12 -0000 1.11.2.1 @@ -30,6 +30,7 @@ import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver; import org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler; +import org.jboss.xb.binding.metadata.unmarshalling.DocumentBinding; import org.xml.sax.EntityResolver; import org.xml.sax.ErrorHandler; @@ -38,7 +39,7 @@ * WARNING: this implementation is not thread-safe. * * @author <a href="mailto:alex@jboss.org">Alexey Loubyansky</a> - * @version <tt>$Revision: 1.11 $</tt> + * @version <tt>$Revision: 1.11.2.1 $</tt> */ public class UnmarshallerImpl implements Unmarshaller { @@ -168,6 +169,25 @@ return builder.getRoot(); } + public Object unmarshal(String systemId, ObjectModelFactory factory, DocumentBinding binding) + throws JBossXBException + { + if(binding != null) + { + throw new IllegalStateException("DocumentBinding API is not supported anymore!"); + } + return unmarshal(systemId, factory, (Object)null); + } + + public Object unmarshal(Reader reader, ObjectModelFactory factory, DocumentBinding binding) throws JBossXBException + { + if(binding != null) + { + throw new IllegalStateException("DocumentBinding API is not supported anymore!"); + } + return unmarshal(reader, factory, (Object)null); + } + public JBossXBParser getParser() { return parser;
Comments