[jboss-user] [Installation, Configuration & Deployment] - help with embedded server - driving me nuts
wiggy
do-not-reply at jboss.com
Tue Jan 2 12:07:56 EST 2007
having problems seeting up the embedded server for EJB3 so that i can run outside an app server.
imported a bootsrap main programme from hibernate chapter 2 into an Eclipse project
where i have a structure as
| src
| NeilsApp2.java (default package)
| objectModel
| more java files ...
| ejb3-interceptors-aop.xml
| jndi.properties
| log4j.properties
| META-INF
| persistence.xml (for mysql)
| neilsapp-beans.xml (ds for the beans)
|
|
| import objectModel.TestHandler;
|
| import org.jboss.ejb3.embedded.EJB3StandaloneBootstrap;
| import javax.naming.InitialContext;
|
| public class NeilsApp2
| {
|
| public static void main(String[] args) throws Exception {
| // Boot the JBoss Microcontainer with EJB3 settings, automatically
| // loads ejb3-interceptors-aop.xml and embedded-jboss-beans.xml
| EJB3StandaloneBootstrap.boot(null);
| // Deploy custom stateless beans (datasource, mostly)
| EJB3StandaloneBootstrap
| .deployXmlResource("META-INF/NeilsApp-beans.xml");
| // Deploy all EJBs found on classpath (slow, scans all)
| // EJB3StandaloneBootstrap.scanClasspath();
| // Deploy all EJBs found on classpath (fast, scans build directory)
| // This is a relative location, matching the substring end of one
| // of java.class.path locations. Print out the value of
| // System.getProperty("java.class.path") to see all paths.
| EJB3StandaloneBootstrap.scanClasspath("helloworld-ejb3/bin");
| // Create InitialContext from jndi.properties
| InitialContext initialContext = new InitialContext();
| // Look up the stateless MessageHandler EJB
| TestHandler tstHandler = (TestHandler) initialContext
| .lookup("TestHandlerBean/local");
| // Call the stateless EJB
| tstHandler.testMessage();
| // Shut down EJB container
| EJB3StandaloneBootstrap.shutdown();
| }
| }
|
and unpacked the embedded server release 9 patch 1 into a jboss install dir.
Now we get the problems. The book said I should have an embedded-jboss-beans.xml file. However there is not one of these to be found in the
E:\jboss\jboss-EJB-3.0_RC9_Patch_1 directories at all.
further, included the /lib jar files into my class path and Eclipse couldnt resolve org.jboss.ejb3.embedded an any of the jars.
I have partially fixed that by donwloading the full jboss AS5 beta - and eventually found a version of E:\jboss\jboss-5.0.0.Beta1\server\all\deployers\ejb3.deployer\jboss-ejb3.jar which had the org.jboss.ejb3.embedded package defined within in.
couldnt find on the the EJB3 download at all.
so i finally the code and it fails looking for the embedded-jboss-beans.xml.
couldnt find one of these anywhere so i copied a default from one of the html files as this
|
| <?xml version="1.0" encoding="UTF-8"?>
| <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
| xmlns="urn:jboss:bean-deployer:2.0">
| <!-- Enable a JCA datasource available through JNDI -->
| <bean name="DefaultDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
| <property name="driverClass"><value>org.hsqldb.jdbcDriver</value></property>
| <property name="connectionURL"><value>jdbc:hsqldb:.</value></property>
| <property name="userName"><value>sa</value></property>
| <property name="jndiName"><value>java:/DefaultDS</value></property>
| <property name="minSize"><value>0</value></property>
| <property name="maxSize"><value>10</value></property>
| <property name="blockingTimeout"><value>1000</value></property>
| <property name="idleTimeout"><value>50000</value></property>
| <property name="transactionManager"><inject bean="TransactionManager"/></property>
| <property name="cachedConnectionManager"><inject bean="CachedConnectionManager"/></property>
| <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
| </bean>
|
| <bean name="DefaultDS" class="java.lang.Object">
| <constructor factoryMethod="getDatasource">
| <factory bean="DefaultDSBootstrap"/>
| </constructor>
| </bean>
|
|
| </deployment>
|
|
this now fails as it cant find a parser
| Exception in thread "main" java.lang.RuntimeException: org.jboss.xb.binding.JBossXBException: Failed to parse source: file:/C:/Documents%20and%20Settings/Will/Neils%20project/NeillsApp2/bin/embedded-jboss-beans.xml at 4,37
| at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(EJB3StandaloneBootstrap.java:386)
| at NeilsApp2.main(NeilsApp2.java:19)
| Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: file:/C:/Documents%20and%20Settings/Will/Neils%20project/NeillsApp2/bin/embedded-jboss-beans.xml at 4,37
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:164)
| at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:133)
| at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:86)
| at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(EJB3StandaloneBootstrap.java:373)
| ... 1 more
| Caused by: java.lang.IllegalStateException: Failed to create schema loader: org.apache.xerces.dom.DOMXSImplementationSourceImpl cannot be cast to org.w3c.dom.DOMImplementationSource
| at org.jboss.xb.binding.Util$5.run(Util.java:518)15:51:11,189 ERROR Util:517 - Failed to create schema loader.
| java.lang.ClassCastException: org.apache.xerces.dom.DOMXSImplementationSourceImpl cannot be cast to org.w3c.dom.DOMImplementationSource
| at org.w3c.dom.bootstrap.DOMImplementationRegistry.newInstance(Unknown Source)
| at org.jboss.xb.binding.Util$5.run(Util.java:512)
| at java.security.AccessController.doPrivileged(Native Method)
| at org.jboss.xb.binding.Util.getXSImplementation(Util.java:488)
| at org.jboss.xb.binding.Util.loadSchema(Util.java:387)
| at org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.java:168)
| at org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.java:139)
| at org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver.resolve(DefaultSchemaResolver.java:247)
| at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:187)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:323)
| at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
| at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
| at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(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.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:160)
| at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:133)
| at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:86)
| at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(EJB3StandaloneBootstrap.java:373)
| at NeilsApp2.main(NeilsApp2.java:19)
|
| at java.security.AccessController.doPrivileged(Native Method)
| at org.jboss.xb.binding.Util.getXSImplementation(Util.java:488)
| at org.jboss.xb.binding.Util.loadSchema(Util.java:387)
| at org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.java:168)
| at org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.java:139)
| at org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver.resolve(DefaultSchemaResolver.java:247)
| at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:187)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:323)
| at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
| at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
| at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(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.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:160)
| ... 4 more
|
I have included just about every jar file in evey /lib and /client directores in the jboss as5 and other directories - no soap.
just how are you supposed to get this blasted embedded server to run!! The documentation and tutorials dont help me - theres nothing to explain how to setup the ejb3 standlone properly strainght from the download .
Can any help in simple terms for idiots (me), what we are supposed to do get the embedded server running outside of an AS as a standalone application.
unhappy in ipswich !
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997304#3997304
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997304
More information about the jboss-user
mailing list