Updated ActiveMQ Artemis and broker will not start - activemq-artemis

I updated ActiveMQ Artemis from 2.20.0 to 2.21.0. Now the broker will not start!
ERROR:
org.xml.sax.SAXParseException; lineNumber: 19; columnNumber: 44; cvc-elt.1.a: Cannot find the declaration of element 'broker'
java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204)
I moved the <broker> tag to line 20 in bootstrap.xml and it correspond to lineNumber in the error message.
Here's my bootstrap.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<broker xmlns="activemq.org/schema">
<jaas-security domain="activemq"/>
<server configuration="${artemis.URI.instance}/etc/broker.xml"/>
<web bind="localhost:23161" path="web">
<!-- <app url="jolokia" war="jolokia.war"/> -->
<app url="activemq-branding" war="activemq-branding.war"/>
<app url="artemis-plugin" war="artemis-plugin.war"/>
<app url="console" war="console.war"/>
</web>
</broker>
Is this familiar to anyone?

You need to follow the upgrade instructions outlined in the ActiveMQ Artemis documentation:
Due to XML schema changes to correct an inaccurate domain name 2 files will need to be updated:
etc/bootstrap.xml
etc/management.xml
In both files change the XML namespace from activemq.org to activemq.apache.org, e.g. in bootsrap.xml use:q:
<broker xmlns="http://activemq.apache.org/schema">
And in management.xml use:
<management-context xmlns="http://activemq.apache.org/schema">

Related

JBOSS Migration AS6 to EAP 7 404 Error

This question is Not Answered.(Mark as assumed answered)
Andy Gowdy
Newbie
Andy Gowdy 31-Mar-2017 06:56
HI
I am having difficulty referencing an ear file after I have deployed it in EAP 7. I have no deployment errors but when I try to access the the ear /beans through the URL I get a 404 error. In the now deprecated JBOSS.xml the URI was configured as shown. Any help would be much appreciated. Many Thanks Andy
<jboss>
<enterprise-beans>
<session>
<ejb-name>HousingFacadeEJB</ejb-name>
<jndi-name>HousingFacadeEJB</jndi-name>
<local-jndi-name>LocalHousingFacadeEJB</local-jndi-name>
<call-by-value>false</call-by-value>
<!-- <configuration-name>Facade</configuration-name> -->
<clustered>false</clustered>
<port-component>
<port-component-name>HousingFacade</port-component-name>
<port-component-uri>HousingFacade/HousingFacadeEJB
</port-component-uri>
</port-component>
</session>
</enterprise-beans>
<container-configurations>
<container-configuration extends="Standard Stateless SessionBean">
<container-name>HousingFacade</container-name>
<container-pool-conf>
<MinimumSize>50</MinimumSize>
<MaximumSize>150</MaximumSize>
</container-pool-conf>
</container-configuration>
</container-configurations>
</jboss>
----------------------------------------------------------
I have replaced this with a JBOSS-EJB3.xml
<enterprise-beans>
<session>
<ejb-name>HousingFacadeEJB2_Live</ejb-name>
<home>com.comino.cxm.housingfacade.HousingFacadeHome</home>
<remote>com.comino.cxm.housingfacade.HousingFacade</remote>
<local-home>com.comino.cxm.housingfacade.LocalHousingFacadeHome</local-home>
<local>com.comino.cxm.housingfacade.LocalHousingFacade</local>
<ejb-class>com.comino.cxm.housingfacade.HousingFacadeBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<env-entry-name>UHDSJNDINAME</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>java:/UHTLIVE_2</env-entry-value>
</env-entry>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>HousingFacadeEJB2_Live</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
My ejb-jar.xml
<jboss:ejb-jar>
<enterprise-beans>
<session>
<ejb-name>HousingFacadeEJB2_Live</ejb-name>
<home>com.comino.cxm.housingfacade.HousingFacadeHome</home>
<remote>com.comino.cxm.housingfacade.HousingFacade</remote>
<local-home>com.comino.cxm.housingfacade.LocalHousingFacadeHome</local-home>
<local>com.comino.cxm.housingfacade.LocalHousingFacade</local>
<ejb-class>com.comino.cxm.housingfacade.HousingFacadeBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<env-entry-name>UHDSJNDINAME</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>java:/UHTLIVE_2</env-entry-value>
</env-entry>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>HousingFacadeEJB2_Live</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</jboss:ejb-jar>
JBOSS Server log extract.. I have redacted the connection addresses.
----------------------------REQUEST---------------------------
URI=/HousingFacade2_Live/HousingFacadeEJB2_Live
characterEncoding=null
contentLength=1304
contentType=[text/xml; charset=utf-8]
header=Connection=Keep-Alive
header=SOAPAction=""
header=Cache-Control=no-cache
header=Content-Type=text/xml; charset=utf-8
header=Content-Length=1304
header=User-Agent=W2
header=Host=**************
locale=[]
method=POST
protocol=HTTP/1.1
queryString=
remoteAddr=*************
remoteHost=************
scheme=http
host=*******************
serverPort=8080
--------------------------RESPONSE--------------------------
contentLength=74
contentType=text/html
header=Connection=keep-alive
header=X-Powered-By=Undertow/1
header=Server=JBoss-EAP/7
header=Content-Length=74
header=Content-Type=text/html
header=Date=Fri, 31 Mar 2017 10:31:43 GMT
status=404
==============================================================
There are migration guide available, below are the two links where you can find the configuration how to migrate EJB application to JBoss EAP 7;
https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html-single/migration_guide/
https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html-single/developing_ejb_applications/

WildFly 9 Failed to parse service xml

jboss-service.xml:
<?xml version="1.0" encoding="UTF-8"?>
<server xmlns="urn:jboss:service:7.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd">
<mbean name="com.xxx.yyy:service=SomeClass"
code="com.xxx.yyy.SomeClassBean" xmbean-dd="META-INF/config-mbeans.xml" />
</server>
I have jboss-service.xml above and I'm getting this error:
Caused by: java.lang.IllegalStateException: Current state START_ELEMENT is not among the statesCHARACTERS, COMMENT, CDATA, SPACE, ENTITY_REFERENCE, DTD valid for getText()
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.getText(Unknown Source)
at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.getText(XMLExtendedStreamReaderImpl.java:275)
at org.jboss.as.service.descriptor.JBossServiceXmlDescriptorParser.unexpectedContent(JBossServiceXmlDescriptorParser.java:638)
at org.jboss.as.service.descriptor.JBossServiceXmlDescriptorParser.parseMBean(JBossServiceXmlDescriptorParser.java:221)
at org.jboss.as.service.descriptor.JBossServiceXmlDescriptorParser.readElement(JBossServiceXmlDescriptorParser.java:192)
at org.jboss.as.service.descriptor.JBossServiceXmlDescriptorParser.readElement(JBossServiceXmlDescriptorParser.java:48)
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
at org.jboss.as.service.ServiceDeploymentParsingProcessor.deploy(ServiceDeploymentParsingProcessor.java:96)
... 6 more
Any idea how to fix this? Tried other suggestions, but nothing seems to work.
According to the section 9.6.2 of the JBossAS docs, you need to define your mbean like this:
<?xml version="1.0" encoding="UTF-8"?>
<server xmlns="urn:jboss:service:7.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd">
<mbean code="..." name="...">
</mbean>
</server>
EDIT
After looking at the source code of JBossServiceXmlDescriptorParser.java:221, one understands that the element xmbean-dd is no longer expected on Wildfly 9. Only NAMEand CODE are expected.
Remove that element from your mbean tag and it will work.

jboss-esb fs-listener jbm message queue overflow

We have a jboss esb server which is reading files from the file system in a scheduled way (schedule frequency of 20sec) and convert them into the esb message then we parse the message.
There are some other providers/listeners (jms) and services configured on the esb servers. When there is an error in one of the services it effects the above process. File system provider (gateway) is working fine but the jms-listener who takes the gateway messages are not working and lots of messages are accumulated in the jbm queue (jbm_msg Oracle DB table).
Here is the problem, when my server is restarted messages in the jbm-queue is parsed in the esb for just 20 seconds which is the scheduled frequency of fs-provider, never process messages again and cpu usage goes up to 100% and stays there. We believe somehow fs-providers interrupts the jms-provider.
Is there any configuration we have been missing out.
Here are the configuration files that we have:
jboss-esb.xml
<?xml version = "1.0" encoding = "UTF-8"?>
<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
<providers>
<fs-provider name="SitaIstProvider">
<fs-bus busid="gw_sita_ist" >
<fs-message-filter
directory="/ikarussita/IST/IN"
input-suffix=".RCV"
work-suffix=".lck"
post-delete="false"
post-directory="/ikarussita/IST/OK"
post-suffix=".ok"
error-delete="false"
error-directory="/ikarussita/IST/ERR"
error-suffix=".err"/>
</fs-bus>
</fs-provider>
<jms-provider name="SitaESBQueue" connection-factory="ConnectionFactory">
<jms-bus busid="esb_sita_queue">
<jms-message-filter dest-type="QUEUE" dest-name="queue/esb_sita_queue"/>
</jms-bus>
</jms-provider>
</providers>
<services>
<service category="SITA" name="SITA_IST" description="SITA Daemon For ISTCOXH">
<listeners>
<fs-listener name="Sita_Ist_Gateway" busidref="gw_sita_ist" is-gateway="true" schedule-frequency="20" />
<jms-listener name="Jms_Sita_EsbAware" busidref="esb_sita_queue" />
</listeners>
<actions mep="OneWay">
<action name="parse_msg" class="com.celebi.integration.action.sita.inbound.SitaHandler" process="parseMessage" />
<action name="send_ikarus" class="com.celebi.integration.action.ikarus.outbound.fis.FlightJmsSender" />
</actions>
</service>
</services>
</jbossesb>
jbm-queue-service.xml
<?xml version="1.0" encoding="UTF-8"?>
<server>
<mbean code="org.jboss.jms.server.destination.QueueService"
name="jboss.messaging.destination:service=Queue,name=esb_sita_queue"
xmbean-dd="xmdesc/Queue-xmbean.xml">
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
<depends>jboss.messaging:service=PostOffice</depends>
</mbean>
<server>
deployment.xml
<jbossesb-deployment>
<depends>jboss.messaging.destination:service=Queue,name=esb_sita_queue</depends>
</jbossesb-deployment>
Thanx
Split the service into 2 separate services, one handling the JMS queue, the other the file poller. Specify the same action pipeline. That way you get the same functionality but without the threading issue. Also use max-threads attr on the listener to specify the number of reading threads.

How to configure startup sequence of JBoss services (JmsActivation)

When I deploy my application on JBoss 5 the EJBs are created before the QueueService is started. Creation of Message Driven beans now fails miserably because the queues are not yet available:
17:11:29,151 INFO [EJBContainer] STARTED EJB: .....
17:11:29,266 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
..
..
17:11:29,928 WARN [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec#11694c ...
javax.naming.NameNotFoundException: ... not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.jboss.util.naming.Util.lookup(Util.java:222)
at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupDestination(JmsActivation.java:464)
at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:352)
at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:729)
at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:213)
at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
17:11:30,027 INFO [QueueService] Queue[/queue/....] started, fullSize=200000, pageSize=2000, downCacheSize=2000
How can the deploy sequence be configured?
Found the answer myself. I added the following annotation to the message driven bean:
#Depends({"jboss.messaging.destination:service=Topic,name=XxxxTopic"})
<?xml version="1.0" encoding="UTF-8"?>
<!--
Null persistence config.
Use this if you don't actually want to persist anything
$Id$
-->
<server>
<!-- Persistence Manager MBean configuration
======================================== -->
<mbean code="org.jboss.messaging.core.jmx.NullPersistenceManagerService"
name="jboss.messaging:service=PersistenceManager"
xmbean-dd="xmdesc/NullPersistenceManager-xmbean.xml"/>
<!-- Messaging Post Office MBean configuration
========================================= -->
<mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
name="jboss.messaging:service=PostOffice"
xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
<depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
<!-- The name of the post office -->
<attribute name="PostOfficeName">JMS post office</attribute>
<!-- This post office is clustered. If you don't want a clustered post office then set to false -->
<attribute name="Clustered">false</attribute>
</mbean>
<!-- Messaging JMS User Manager MBean config
======================================= -->
<mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
name="jboss.messaging:service=JMSUserManager"
xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
<depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
</mbean>
</server>
save this as 'null-persistence-service.xml' and put this deploy/messaging/
Now it will works

Deploying a datasource w/ JAAS login module as a .sar in jboss

Does anyone have experience bundling a datasource (-ds.xml) definition + login-config.xml as a service archive in jboss? I've been fighting with this for awhile to no avail. I'm just looking for some pointers on how I should be laying the .sar out. I want the .sar to ultimately live in a .ear. Any pointers greatly appreciated!
This is relatively straightforward task.
Your EAR file needs to have following layout:
my-app.ear
|+ META-INF
|+ applications.xml and jboss-app.xml
|+ myapp.war
|+ myapp.jar
|+ lib
|+ my-ds.xml
|+ my-login-module-service.xml
where my-ds.xml contains datasource definition as usual. my-login-module-service.xml defines MBean based on the DynamicLoginConfig class. These modules are then referenced within jboss-app.xml (custom JBoss deployment descriptor) as demostrated here:
<jboss-app>
<module>
<service>my-login-module-service.xml</service>
</module>
<module>
<service>my-ds.xml</service>
</module>
</jboss-app>
Easiest way how to create Login Module definition is to use support for embedded XML documents as attributes values. Such a config (my-login-module-service.xml) will looks like this:
<server>
<mbean code="org.jboss.security.auth.login.DynamicLoginConfig"
name="jboss:service=DynamicLoginConfig">
<attribute name="PolicyConfig" serialDataType="jbxb">
<jaas:policy xsi:schemaLocation="urn:jboss:security-config:4.1 resource:security-config_4_1.xsd" xmlns:jaas="urn:jboss:security-config:4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<jaas:application-policy name="userinrole">
<jaas:authentication>
<jaas:login-module code="org.jboss.security.auth.spi.XMLLoginModule" flag="required">
<jaas:module-option name="my-policy-123">
<ur:users xsi:schemaLocation="urn:jboss:user-roles:1.0 resource:user-roles_1_0.xsd" xmlns:ur="urn:jboss:user-roles:1.0">
<ur:user name="admin" password="admin123">
<ur:role name="MyUserRole"></ur:role>
<ur:role name="AdminUser"></ur:role
</ur:user>
</ur:users>
</jaas:module-option>
<jaas:module-option name="unauthenticatedIdentity">guest</jaas:module-option>
</jaas:login-module>
</jaas:authentication>
</jaas:application-policy>
</jaas:policy>
</attribute>
<depends optional-attribute-name="LoginConfigService">jboss.security:service=XMLLoginConfig</depends>
<depends optional-attribute-name="SecurityManagerService">jboss.security:service=JaasSecurityManager</depends>
</mbean>
</server>
You can verify successful deployment using JNDIVIew bean (java:/jaas/my-policy-123 in this example).
For deployment including custom classes it's better to choose SAR archive deployment together with custom code. In such a case you can separate MBean definition and Login Module config (META-INF/jboss-service.xml) :
<server>
<mbean code="org.jboss.security.auth.login.DynamicLoginConfig" name="jboss:service=DynamicLoginConfig">
<attribute name="AuthConfig">META-INF/login-config.xml</attribute>
<depends optional-attribute-name="LoginConfigService">jboss.security:service=XMLLoginConfig</depends>
<depends optional-attribute-name="SecurityManagerService">jboss.security:service=JaasSecurityManager</depends>
</mbean>
</server>
META-INF/login-config.xml will then contain your policy configuration.
I'm using this approach on JBoss AS 4.x.