[Design the new POJO MicroContainer] - Mixing schemas WildcardBinding exception
by alesj
I'm using this xml:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <beans xmlns="urn:jboss:spring-beans:2.0">
|
| <bean id="testBean" class="org.jboss.test.spring.support.SimpleBean">
| <property name="refBean"><ref bean="oldBean"/></property>
| </bean>
|
| <bean xmlns="urn:jboss:bean-deployer:2.0" name="oldBean" class="org.jboss.test.spring.support.OldBean">
| <property name="javaBeanString"><value>JavaBean</value></property>
| </bean>
|
| </beans>
and I get the following exception:
| org.jboss.xb.binding.JBossXBException: Failed to parse source: file:/C:/projects/microcontainer/classes/test/spring-int/org/jboss/test/spring/test/InstantiateMixed2TestCase.xml@13,9
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:173)
| at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:133)
| at org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer.deploy(BasicXMLDeployer.java:135)
| at org.jboss.test.kernel.junit.MicrocontainerTestDelegate.deploy(MicrocontainerTestDelegate.java:212)
| at org.jboss.test.kernel.junit.MicrocontainerTestDelegate.deploy(MicrocontainerTestDelegate.java:283)
| at org.jboss.test.kernel.junit.MicrocontainerTestDelegate.setUp(MicrocontainerTestDelegate.java:78)
| at org.jboss.test.spring.test.TempSpringMicrocontainerTestDelegate.setUp(TempSpringMicrocontainerTestDelegate.java:48)
| at org.jboss.test.AbstractTestSetup.setUp(AbstractTestSetup.java:63)
| at junit.extensions.TestSetup$1.protect(TestSetup.java:18)
| at junit.extensions.TestSetup.run(TestSetup.java:23)
| at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
| Caused by: java.lang.ClassCastException: org.jboss.xb.binding.sunday.unmarshalling.WildcardBinding
| at org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler.setParent(DefaultElementHandler.java:109)
| at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.endRepeatableParticle(SundayContentHandler.java:730)
| at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.endElement(SundayContentHandler.java:138)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.endElement(SaxJBossXBParser.java:353)
| at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
| at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown Source)
| at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
| at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
| at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
| at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
| at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:169)
| ... 23 more
When I do it the other way around - defining root element deployment as MC schema, and using Spring bean inside deployment - it works.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008769#4008769
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008769
17 years, 11 months
[Design the new POJO MicroContainer] - Scoped beans deployment
by alesj
What's the status of being able to define in which scope you want to put / lookup your beans?
E.g. 'visible' only for current deployment unit (single xml file), whole archive deployment (multiple files in .sar, ...), whole app deployment, current kernel bootstrap, cluster, ...
What I want to do with OSGi integration is be able to put in current Bundle bean (under some specific name - similar to what we do with Kernel), and then later use it when wiring beans with OSGi layer. OSGi aware beans are normal beans deployed with BeanMetaDataDeployer, which is currently bound with bootstrap Kernel. There is only special schema handling + the part that is missing = currently deployed beans being aware of their underlying Bundle.
How do I get the currently deployed beans be aware of their Bundle (which is a part of DeploymentUnit attachments). Any elegant way or a horrible ThreadLocal? ;-(
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008731#4008731
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008731
17 years, 11 months
[Javassist development Forum] - How to use Log4j in Struts
by ashish.mishra16
I m facing problem in using log4j in my struts application. My director strutcture is
SRC,Web-Root
WEB-INF
lib,classes,web.xml,struts-config.xml
In classes i have class files, config.properties for log4j, ApplicationResources.properties.
Now i m not able to read the config.properties file. in any ways, the config.properties file is like this:
log4j.rootLogger=DEBUG, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n.
I m using the following method to read the it in LoginAction.java:
static Logger logger = Logger.getLogger(LoginAction.class.getName());
try {
Properties logProperties = new Properties();
logProperties.load(new FileInputStream("config.properties"));
PropertyConfigurator.configure(logProperties);
} catch (Exception e) {
throw new RuntimeException("Enable to Load Logging Properties File");
}
Please tell me how to read the config.properties file. Or what is d other ways to handle Log4J.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008650#4008650
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008650
17 years, 11 months
[Design of JCA on JBoss] - JBAS-1434 Part 2
by weston.price@jboss.com
Quick check of moving over to the JCA/JMS adapter. Change in standardjboss.xml is required. The easiest thing is simply to switch the default container configuration from
|
| <container-name>Standard Message Driven Bean</container-name>
| <call-logging>false</call-logging>
| <invoker-proxy-binding-name>message-driven-bean</invoker-proxy-binding-name>
|
to
| <container-name>Standard Message Driven Bean</container-name>
| <call-logging>false</call-logging>
| <invoker-proxy-binding-name>jms-message-inflow-driven-bean</invoker-proxy-binding-name>
|
Also, as we all know, the old JMSContainerInvoker allowed for creating destinations when a listener was being deployed without one. EJB3 carries this tradition over for EJB3, but for EJB 2.x the JMS/JCA adapter will not.
There are a few reasons for this
a) It's not portable and JBoss specific
b) While we could create a temporary destination using the JMS API, I don't think it is a good idea to carry this 'convenience' forward as it simply masks underlying configuration issues on the client.
In sum, you want to use JMS/JCA inflow, create your destination. Further, I am not sure how much from the JMS API without having to fall back on JBoss specific constructs to create the destination.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008640#4008640
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008640
17 years, 11 months