[Design of JBossXB] - Re: @XmlElementWrapper/@XmlElements
by alex.loubyansky@jboss.com
This should be closer to what we would like to have
@XmlRootElement
| public static class Application
| {
| private List<Module> modules;
|
| public void setModules(List<Module> modules)
| {
| this.modules = modules;
| }
|
| @XmlElement(name="module", type=ModuleHolder.class)
| public List<Module> getModules()
| {
| return modules;
| }
| }
|
| public static class ModuleAdapter extends XmlAdapter<ModuleHolder, Module>
| {
| @Override
| public ModuleHolder marshal(Module arg0) throws Exception
| {
| // TODO Auto-generated method stub
| return null;
| }
|
| @Override
| public Module unmarshal(ModuleHolder arg0) throws Exception
| {
| return arg0.getModule();
| }
| }
|
| @XmlJavaTypeAdapter(value = ModuleAdapter.class)
| public static class ModuleHolder
| {
| private Module module;
|
| public void setModule(Module module)
| {
| this.module = module;
| }
|
| @XmlTransient
| public Module getModule()
| {
| return module;
| }
|
| public void setConnector(ConnectorModule module)
| {
| this.module = module;
| }
|
| public ConnectorModule getConnector()
| {
| return (ConnectorModule) module;
| }
|
|
| public void setEjb(EjbModule module)
| {
| this.module = module;
| }
|
| public EjbModule getEjb()
| {
| return (EjbModule) module;
| }
|
| public void setJava(JavaModule module)
| {
| this.module = module;
| }
|
| public JavaModule getJava()
| {
| return (JavaModule) module;
| }
| }
|
| public static abstract class Module
| {
| private String value;
|
| public void setValue(String value)
| {
| this.value = value;
| }
|
| @XmlValue
| public String getValue()
| {
| return value;
| }
| }
|
| public static class ConnectorModule extends Module
| {
| }
|
| public static class EjbModule extends Module
| {
| }
|
| public static class JavaModule extends Module
| {
| }
But there is an issue... currently it applies the adapter to the collection of modules as well as to the each module separately. I am looking into it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094623#4094623
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094623
18 years, 6 months
[Design of POJO Server] - Re: Scoped domain with java2ParentDelegation=false loads cla
by kabir.khan@jboss.com
The following modification helps
| Index: C:/cygwin/home/Kabir/sourcecontrol/jboss-head/system-jmx/src/main/org/jboss/system/deployers/HackClassloaderMetaDataDeployer.java
| ===================================================================
| --- C:/cygwin/home/Kabir/sourcecontrol/jboss-head/system-jmx/src/main/org/jboss/system/deployers/HackClassloaderMetaDataDeployer.java (revision 66088)
| +++ C:/cygwin/home/Kabir/sourcecontrol/jboss-head/system-jmx/src/main/org/jboss/system/deployers/HackClassloaderMetaDataDeployer.java (working copy)
| @@ -32,6 +32,7 @@
| import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
| import org.jboss.deployers.structure.spi.DeploymentUnit;
| import org.jboss.deployers.structure.spi.classloading.ClassLoaderMetaData;
| +import org.jboss.deployers.structure.spi.classloading.ExportAll;
| import org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig;
| import org.jboss.system.metadata.ServiceDeployment;
|
| @@ -101,6 +102,7 @@
| }
| boolean useParentFirst = Boolean.valueOf(java2ParentDelegation).booleanValue();
| metaData.setJ2seClassLoadingCompliance(useParentFirst);
| + metaData.setExportAll(ExportAll.NON_EMPTY);
|
| unit.addAttachment(ClassLoaderMetaData.class, metaData);
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094620#4094620
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094620
18 years, 6 months
[Design of POJO Server] - Re: Scoped domain with java2ParentDelegation=false loads cla
by adrian@jboss.org
Ok, your problem looks to be that your domain doesn't have any classloaders:
| No classloaders in this domain (the null)
|
| 2007-10-12 11:33:46,015 TRACE [org.jboss.classloader.spi.base.BaseClassLoaderDomain] ClassLoaderDoma
| in@11b3435{aop.loading:loader=scopedextender1} trying to get resource org/jboss/test/aop/scopedexten
| der/blah.txt from all exports null
|
| So load from parent
|
| 2007-10-12 11:34:10,906 TRACE [org.jboss.classloader.spi.ClassLoaderDomain] ClassLoaderDomain@11b343
| 5{aop.loading:loader=scopedextender1} org/jboss/test/aop/scopedextender/blah.txt matches parent afte
| rFilter=<EVERYTHING>
|
| The parent has a classloader.
|
| 2007-10-12 11:34:10,921 TRACE [org.jboss.classloader.spi.base.BaseClassLoaderDomain] ClassLoaderDoma
| in@1f21056{<DEFAULT>} trying to get resource org/jboss/test/aop/scopedextender/blah.txt from all exports [VFSClassLoader
| Policy@c1a0a6]
|
So the question is why is there no classloader policies in
aop.loading:loader=scopedextender1
You'll need to look at the deployment trace logging to see whether (and when)
the classloader gets added to the domain or whether it is getting added to the
wrong domain.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094588#4094588
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094588
18 years, 6 months