[JBoss AS7 Development] - AS7 and Dom4J
by KIM TIAGO BAPTISTA
KIM TIAGO BAPTISTA [http://community.jboss.org/people/kimtiago] created the discussion
"AS7 and Dom4J"
To view the discussion, visit: http://community.jboss.org/message/630474#630474
--------------------------------------------------------------
Hi,
I'm with serious problems with JBoss AS 7.0.2
In my project, I need to use Dom4J as dependency.
When i add Dom4J in my classpath, i receive this error:
{code}
19:00:24,181 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.persistenceunit."sgmj.
war#sgmj": org.jboss.msc.service.StartException in service jboss.persistenceunit."sgmj.war#sgmj": Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1780) [jboss-msc-1.0.1.GA.jar: http://1.0.1.ga/ 1.0.1.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_27]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_27]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]
Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
at org.dom4j.DocumentFactory.getInstance(DocumentFactory.java:97)
at org.dom4j.DocumentHelper.getDocumentFactory(DocumentHelper.java:36)
at org.dom4j.DocumentHelper.createDocument(DocumentHelper.java:41)
at org.hibernate.envers.configuration.RevisionInfoConfiguration.generateDefaultRevisionInfoXmlMapping(RevisionInfoConfiguration.java:86)
at org.hibernate.envers.configuration.RevisionInfoConfiguration.configure(RevisionInfoConfiguration.java:322)
at org.hibernate.envers.configuration.AuditConfiguration.<init>(AuditConfiguration.java:94)
at org.hibernate.envers.configuration.AuditConfiguration.getFor(AuditConfiguration.java:134)
at org.hibernate.envers.event.EnversIntegrator.integrate(EnversIntegrator.java:63)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:294)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1722)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:76)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:899)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:884)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
at org.jboss.as.jpa.service.PersistenceUnitService.createContainerEntityManagerFactory(PersistenceUnitService.java:143)
at org.jboss.as.jpa.service.PersistenceUnitService.start(PersistenceUnitService.java:77)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar: http://1.0.1.ga/ 1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar: http://1.0.1.ga/ 1.0.1.GA]
... 3 more
{code}
When i remove, i receive this error:
{code}
19:11:50,616 AVISO [javax.enterprise.resource.
webcontainer.jsf.lifecycle] (http--127.0.0.1-8080-1) /teste.xhtml @21,85 listener="#{membroMjBean.buscaCep()}": java.lang.NoClassDefFoundError: org/dom4j/DocumentException: javax.el.ELException: /teste.xhtml @21,85 listener="#{membroMjBean.buscaCep()}": java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:111) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
at org.primefaces.component.behavior.ajax.AjaxBehavior.broadcast(AjaxBehavior.java:169) [primefaces-3.0.M3.jar:]
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:760) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:49) [jboss-as-jpa-7.0.2.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]
Caused by: java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.sistemasmj.sgmj.model.beans.MembroMjBean.buscaCep(MembroMjBean.java:44) [classes:]
at org.sistemasmj.sgmj.model.beans.MembroMjBean$Proxy$_$$_WeldClientProxy.buscaCep(MembroMjBean$Proxy$_$$_WeldClientProxy.java) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_27]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_27]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_27]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_27]
at org.apache.el.parser.AstValue.invoke(AstValue.java:196) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:56) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
... 26 more
Caused by: java.lang.ClassNotFoundException: org.dom4j.DocumentException from [Module "deployment.sgmj.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103)
... 37 more
{code}
I don't know what to do... I know AS7 has a module with Dom4J 1.6.1, the same version I need.
If i put in classpath, AS7 don't like, if i remove, my application don't has Dom4J.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/630474#630474]
Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 3 months
[JBoss AS7 Development] - Adding a new Extension/Subsystem via the CLI
by Scott Stark
Scott Stark [http://community.jboss.org/people/starksm64] modified the document:
"Adding a new Extension/Subsystem via the CLI"
To view the document, visit: http://community.jboss.org/docs/DOC-17294
--------------------------------------------------------------
A common configuration change to the AS7 server is the addition of a subsystem. This requires adding the subsystem extension and the subsystem. This can be done with two http://community.jboss.org/docs/DOC-16581 CLI commands. Consider the JMX subsystem elements found in the standalone.xml:
<extension module="org.jboss.as.jmx"/>
<subsystems>
...
<subsystem xmlns="urn:jboss:domain:jmx:1.1" show-model="true">
<jmx-connector server-binding="jmx-connector-server" registry-binding="jmx-connector-registry"/>
</subsystem>
...
<socket-binding-group name="standard-sockets" default-interface="public">
...
<socket-binding name="jmx-connector-registry" port="1090" interface="management"/>
<socket-binding name="jmx-connector-server" port="1091" interface="management"/>
These can be added via the following two CLI commands:
+Note that the jmx extension must be added first in order for the add subsystem=jmx command to be recognized as having a handler.+
[standalone@localhost:9999 /] /extension=org.jboss.as.jmx:add
{"outcome" => "success"}
[standalone@localhost:9999 /] /:composite(steps=[{"operation" => "add","address" => [("subsystem" => "jmx")], "show-model" => true}, {"operation" => "add-connector", "address" => [("subsystem" => "jmx")], "server-binding" => "jmx-connector-server", "registry-binding" => "jmx-connector-registry"}, {"operation" => "add", "address" => [("socket-binding-group" => "standard-sockets"), ("socket-binding" => "jmx-connector-registry")], "port" => 1090, "interface" => "management"}, {"operation" => "add", "address" => [("socket-binding-group" => "standard-sockets"), ("socket-binding" => "jmx-connector-server")], "port" => 1091, "interface" => "management"}])
{
"outcome" => "success",
"result" => {
"step-1" => {"outcome" => "success"},
"step-2" => {"outcome" => "success"},
"step-3" => {"outcome" => "success"},
"step-4" => {"outcome" => "success"}
}
}
A comparision between the previous and current standalone.xml show the expected elements have been added:
[113](ironmaiden:bin) > diff ../standalone/configuration/standalone_xml_history/standalone.last.xml ../standalone/configuration/standalone_xml_history/standalone.boot.xml
26d25
< <extension module="org.jboss.as.jmx"/>
353,355d351
< <subsystem xmlns="urn:jboss:domain:jmx:1.1" show-model="true">
< <jmx-connector server-binding="jmx-connector-server" registry-binding="jmx-connector-registry"/>
< </subsystem>
377,378d372
< <socket-binding name="jmx-connector-registry" port="1090" interface="management"/>
< <socket-binding name="jmx-connector-server" port="1091" interface="management"/>
380c374
< </server>
\ No newline at end of file
---
> </server>
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-17294]
Create a new document in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
13 years, 3 months
[JBoss AS7 Development] - IronJacamar AbstractResourceAdapterDeployer classloader issue
by insipid
insipid [http://community.jboss.org/people/insipid] created the discussion
"IronJacamar AbstractResourceAdapterDeployer classloader issue"
To view the discussion, visit: http://community.jboss.org/message/632888#632888
--------------------------------------------------------------
After being unable to get some AdminObjects to bind, I decided to do a little debugging and noticed this:
if (ao != null && ao instanceof Serializable && ao instanceof Referenceable) [AbstractResourceAdapterDeployer line 859]
which seems to always fail with the provided classloader handed down from ResourceAdapterXmlDeploymentService's deployer implementation. I am still learning my way around the code, but perhaps these interfaces were loaded seperately by ao's classloader and this check needs to be fixed?
The reason I am posting here instead of actually fixing the issue is that I could not get IronJacamar to build in Windows. Perhaps I am not using the correct encoding and that is causing the annotation processor to croak? (been trying to figure it out all night)
[javac]
[javac]
[javac] An annotation processor threw an uncaught exception.
[javac] Consult the following stack trace for details.
[javac] java.lang.StringIndexOutOfBoundsException: String index out of range
: 1
[javac] at java.lang.String.charAt(String.java:695)
[javac] at java.util.regex.Matcher.appendReplacement(Matcher.java:761)
[javac] at java.util.regex.Matcher.replaceAll(Matcher.java:905)
[javac] at java.lang.String.replaceAll(String.java:2210)
[javac] at org.jboss.logging.generator.apt.TranslationFileGenerator.proc
essTypeElement(TranslationFileGenerator.java:55)
[javac] at org.jboss.logging.generator.apt.LoggingToolsProcessor.process
(LoggingToolsProcessor.java:152)
[javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment.cal
lProcessor(JavacProcessingEnvironment.java:793)
[javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment.dis
coverAndRunProcs(JavacProcessingEnvironment.java:722)
[javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment.acc
ess$1700(JavacProcessingEnvironment.java:97)
[javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment$Rou
nd.run(JavacProcessingEnvironment.java:1029)
[javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment.doP
rocessing(JavacProcessingEnvironment.java:1163)
[javac] at com.sun.tools.javac.main.JavaCompiler.processAnnotations(Java
Compiler.java:1106)
[javac] at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.ja
va:824)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:417)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:331)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:322)
[javac] at com.sun.tools.javac.Main.compile(Main.java:76)
[javac] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[javac] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:57)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:43)
[javac] at java.lang.reflect.Method.invoke(Method.java:601)
[javac] at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac
13.java:56)
[javac] at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1134)
[javac] at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:912)
[javac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:291)
[javac] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:43)
[javac] at java.lang.reflect.Method.invoke(Method.java:601)
[javac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchU
tils.java:106)
[javac] at org.apache.tools.ant.Task.perform(Task.java:348)
[javac] at org.apache.tools.ant.Target.execute(Target.java:390)
[javac] at org.apache.tools.ant.Target.performTasks(Target.java:411)
[javac] at org.apache.tools.ant.Project.executeSortedTargets(Project.jav
a:1399)
[javac] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTarget
s(SingleCheckExecutor.java:38)
[javac] at org.apache.tools.ant.Project.executeTargets(Project.java:1251
)
[javac] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
[javac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:291)
[javac] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:43)
[javac] at java.lang.reflect.Method.invoke(Method.java:601)
[javac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchU
tils.java:106)
[javac] at org.apache.tools.ant.Task.perform(Task.java:348)
[javac] at org.apache.tools.ant.Target.execute(Target.java:390)
[javac] at org.apache.tools.ant.Target.performTasks(Target.java:411)
[javac] at org.apache.tools.ant.Project.executeSortedTargets(Project.jav
a:1399)
[javac] at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[javac] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De
faultExecutor.java:41)
[javac] at org.apache.tools.ant.Project.executeTargets(Project.java:1251
)
[javac] at org.apache.tools.ant.Main.runBuild(Main.java:809)
[javac] at org.apache.tools.ant.Main.startAnt(Main.java:217)
[javac] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
[javac] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
BUILD FAILED
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/632888#632888]
Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 3 months
[JBoss AS7 Development] - Adding a new Extension/Subsystem via the CLI
by Scott Stark
Scott Stark [http://community.jboss.org/people/starksm64] created the document:
"Adding a new Extension/Subsystem via the CLI"
To view the document, visit: http://community.jboss.org/docs/DOC-17294
--------------------------------------------------------------
A common configuration change to the AS7 server is the addition of a subsystem. This requires adding the subsystem extension and the subsystem. This can be done with two CLI commands. Consider the JMX subsystem elements found in the standalone.xml:
<extension module="org.jboss.as.jmx"/>
<subsystems>
...
<subsystem xmlns="urn:jboss:domain:jmx:1.1" show-model="true">
<jmx-connector server-binding="jmx-connector-server" registry-binding="jmx-connector-registry"/>
</subsystem>
...
<socket-binding-group name="standard-sockets" default-interface="public">
...
<socket-binding name="jmx-connector-registry" port="1090" interface="management"/>
<socket-binding name="jmx-connector-server" port="1091" interface="management"/>
These can be added via the following two CLI commands:
[standalone@localhost:9999 /] /extension=org.jboss.as.jmx:add
{"outcome" => "success"}
[standalone@localhost:9999 /] /:composite(steps=[{"operation" => "add","address" => [("subsystem" => "jmx")], "show-model" => true}, {"operation" => "add-connector", "address" => [("subsystem" => "jmx")], "server-binding" => "jmx-connector-server", "registry-binding" => "jmx-connector-registry"}, {"operation" => "add", "address" => [("socket-binding-group" => "standard-sockets"), ("socket-binding" => "jmx-connector-registry")], "port" => 1090, "interface" => "management"}, {"operation" => "add", "address" => [("socket-binding-group" => "standard-sockets"), ("socket-binding" => "jmx-connector-server")], "port" => 1091, "interface" => "management"}])
{
"outcome" => "success",
"result" => {
"step-1" => {"outcome" => "success"},
"step-2" => {"outcome" => "success"},
"step-3" => {"outcome" => "success"},
"step-4" => {"outcome" => "success"}
}
}
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-17294]
Create a new document in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
13 years, 3 months