Here's an EJB3 MDB that used to work for me in JBoss 5.1:
#TransactionAttribute( TransactionAttributeType.NOT_SUPPORTED )
#org.jboss.ejb3.annotation.Depends("jboss.messaging.destination:service=Topic,name=IncomingArticleNotifications")
#MessageDriven(
activationConfig = {
#ActivationConfigProperty( propertyName="destinationType", propertyValue="javax.jms.Topic"),
#ActivationConfigProperty( propertyName="destination", propertyValue="topic/IncomingArticleNotificationsDest"),
#ActivationConfigProperty( propertyName="subscriptionDurability", propertyValue="Durable"),
#ActivationConfigProperty( propertyName="messageSelector", propertyValue ="type='IncomingArticleNotification'")
}
)
public class IncomingArticleHandler implements MessageListener
{
[...]
}
Try as I might, I can't migrate this to JBoss 7.0.1. JMS is set up OK, and I can publish to the destination OK (from my main JAR), but my EJB listener just isn't listening. I get no deploy or runtime errors for my EJB / WAR / EAR:
01:02:40,600 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) Starting deployment of "product-ear-1.0-SNAPSHOT.ear"
01:02:41,752 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "product-ejb-1.0-SNAPSHOT.jar"
01:02:41,753 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "product.war"
I've also fixed the JNDI names, as per instructions, so here's what I have now:
// Ignore for now: #TransactionAttribute( TransactionAttributeType.NOT_SUPPORTED )
#ResourceAdapter("ejb3-rar.rar") // ??? As per docs. No idea what this should be, an attempt to get something working.
#MessageDriven(
activationConfig = {
#ActivationConfigProperty( propertyName="destinationType", propertyValue="javax.jms.Topic"),
#ActivationConfigProperty( propertyName="destination", propertyValue="java:/topic/IncomingArticleNotificationsDest"), // updated
#ActivationConfigProperty( propertyName="subscriptionDurability", propertyValue="Durable")
// Ignore for now: #ActivationConfigProperty( propertyName="messageSelector", propertyValue ="type='IncomingArticleNotification'")
}
)
public class IncomingArticleHandler implements MessageListener
{
[...]
}
Setting all loggers to ALL before deploying reveals that the only time my MDB classes are mentioned is when the org.jboss.vfs.util.SuffixMatchFilter sees them - that can't be good.
I've been following the issue of MDB support since 7.0.0 and have read through dozens of JIRAs, not to mention the migration guide, EJB3 docs and so on, but I'm left confused. I know MDBs should work in 7.0.1, but is the above doable? I think mine is quite a simple case, so does anyone have a simple working example, a single document that states exactly what does / doesn't work in 7.0.1, or a migration guide?
Edit: just thought I'd add that this is my only EJB, so this is probably as much an EJB problem as a JMS/MDB one.
Updates:
I can deploy a dummy #Stateless with no problems, but no combination of #MessageDriven/#ActivationConfigProperty has had any effect at all (bodging the destinationType to javax.jms.XXX produces no errors!). I've tried setting the destination property to all possible JNDI combinations.
I've checked my standalone.xml against standalone-preview.xml and there are no substantial differences.
The nearest I get to any kind of error is this:
00:53:25,886 DEBUG [org.hornetq.ra.Util] (MSC service thread 1-4) org.jboss.as.messaging.jms.TransactionManagerLocator from [Module "org.hornetq.ra:main" from local module loader #15a62c31 (roots: /Users/andrewregan/Desktop/jboss-as-7.0.1.Final/modules)]: java.lang.ClassNotFoundException: org.jboss.as.messaging.jms.TransactionManagerLocator from [Module "org.hornetq.ra:main" from local module loader #15a62c31 (roots: /Users/andrewregan/Desktop/jboss-as-7.0.1.Final/modules)]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)
at org.hornetq.ra.Util.locateTM(Util.java:261) [hornetq-ra-2.2.7.Final.jar:]
at org.hornetq.ra.HornetQResourceAdapter.locateTM(HornetQResourceAdapter.java:1555) [hornetq-ra-2.2.7.Final.jar:]
at org.hornetq.ra.HornetQResourceAdapter.start(HornetQResourceAdapter.java:210) [hornetq-ra-2.2.7.Final.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_26]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_26]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_26]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_26]
at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.startContext(AbstractResourceAdapterDeployer.java:339) [ironjacamar-deployers-common-1.0.3.Final.jar:1.0.3.Final]
at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1883) [ironjacamar-deployers-common-1.0.3.Final.jar:1.0.3.Final]
at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:825) [ironjacamar-deployers-common-1.0.3.Final.jar:1.0.3.Final]
at org.jboss.as.connector.services.ResourceAdapterActivatorService$ResourceAdapterActivator.doDeploy(ResourceAdapterActivatorService.java:140) [jboss-as-connector-7.0.1.Final.jar:7.0.1.Final]
at org.jboss.as.connector.services.ResourceAdapterActivatorService.start(ResourceAdapterActivatorService.java:93) [jboss-as-connector-7.0.1.Final.jar:7.0.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765) [jboss-msc-1.0.0.GA.jar:1.0.0.GA]
at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291) [jboss-msc-1.0.0.GA.jar:1.0.0.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]
at java.lang.Thread.run(Thread.java:680) [:1.6.0_26]
Might that be a problem? I get that by adding #ResourceAdapter(value="hornetq-ra.rar") as I've seen suggested elsewhere.
I finally managed to solve this myself. JNDI was a red-herring. I didn't need to upgrade to JBoss 7.1.0alpha, nor did I need to change my project to use Java EE 6 deployment (moving my EJBs into the WAR).
In the end, all I needed to do was turn off JBoss's EJB3 "lite" mode (this was set to true in the standalone-preview.xml I copied from). Presumably MDBs are not supported in that mode. As soon as I did this, my MDBs became visible.
<subsystem xmlns="urn:jboss:domain:ejb3:1.1" lite="false">
[...]
</subsystem>
My working MDB now looks like this:
#TransactionAttribute( TransactionAttributeType.NOT_SUPPORTED )
#MessageDriven(
activationConfig = {
#ActivationConfigProperty( propertyName="destinationType", propertyValue="javax.jms.Topic"),
#ActivationConfigProperty( propertyName="destination", propertyValue="java:/topic/IncomingArticleNotificationsDest"),
#ActivationConfigProperty( propertyName="subscriptionDurability", propertyValue="Durable"),
#ActivationConfigProperty( propertyName="messageSelector", propertyValue ="type='IncomingArticleNotification'"),
#ActivationConfigProperty( propertyName="clientID", propertyValue="myValue") // See: http://jgurukulam.blogspot.com/2011/09/jboss-7.html
}
)
public class IncomingArticleHandler implements MessageListener
{
[...]
}
UPDATE:
"EJB lite" mode has been removed !
Related
I have a bean:
import javax.faces.context.FacesContext;
import javax.faces.view.ViewScoped;
...
#Named
#ViewScoped
public class SimpleBean implements Serializable
{
private static final long serialVersionUID = 1L;
#Inject
protected FacesContext facesContext;
...
}
According to
https://arjan-tijms.omnifaces.org/p/jsf-23.html#1316
this should work with 2.3 ...
When deploying to Wildfly 14, this results in:
13:02:33,516 INFO [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 72) HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
13:02:33,563 INFO [org.hibernate.envers.boot.internal.EnversServiceImpl] (ServerService Thread Pool -- 72) Envers integration enabled? : true
13:02:34,344 INFO [org.hibernate.hql.internal.QueryTranslatorFactoryInitiator] (ServerService Thread Pool -- 72) HHH000397: Using ASTQueryTranslatorFactory
13:02:34,531 WARN [org.jboss.weld.Bootstrap] (MSC service thread 1-1) WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class com.sun.faces.flow.FlowDiscoveryCDIHelper is deprecated from CDI 1.1!
13:02:34,918 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."auth-portal.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."auth-portal.war".WeldStartService: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1728)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type FacesContext with qualifiers #Default
at injection point [BackedAnnotatedField] #Inject protected com.company.project.view.SimpleBean.facesContext
at com.company.project.view.SimpleBean.facesContext(SimpleBean.java:0)
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:378)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:290)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:143)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:164)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:526)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:64)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:62)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:485)
13:02:34,918 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "auth-portal.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"auth-portal.war\".WeldStartService" => "Failed to start service
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type FacesContext with qualifiers #Default
at injection point [BackedAnnotatedField] #Inject protected com.company.project.view.SimpleBean.facesContext
at com.company.project.view.SimpleBean.facesContext(SimpleBean.java:0)
"}}
My faces-config.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd"
version="2.3">
...
QUESTION:
What's wrong here and how do you solve this?
BTW the answer here didn't solve it: How to inject FacesContext with JSF 2.3 and TomEE?
According to
https://github.com/javaserverfaces/mojarra#activating-cdi-in-jsf-23
this is the answer:
By default, JSF 2.3 will run in JSF 2.2 modus as to CDI support. Even
when you use a JSF 2.3 compatible faces-config.xml. In other words,
the new JSF 2.3 feature of injection and EL resolving of JSF artifacts
(spec issue 1316) won't work until you explicitly activate this.
In other words, #Inject FacesContext doesn't work by default. This
is necessary in order for JSF 2.3 to be fully backwards compatible.
There is currently only one way to activate CDI in JSF 2.3 and
herewith make JSF 2.3 to run in full JSF 2.3 modus. Put the
#FacesConfig annotation on an arbitrary CDI managed bean. For
example, a general startup/configuration bean.
#FacesConfig
#ApplicationScoped
public class YourApplicationConfig {
// ...
}
Full example:
import javax.enterprise.context.ApplicationScoped;
import javax.faces.annotation.FacesConfig;
#FacesConfig
#ApplicationScoped
public class Jsf23Activator {
// ...
}
You need the #ApplicationScoped annotation or it will not work. After that in my startup the console finally displays:
14:23:28,805 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 82) Initializing Mojarra 2.3.5.SP2 for context '/blah'
14:23:30,415 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 82) Monitoring file:/C:/dev/servers/wildfly-14.0.1.Final/standalone/deployments/blah.war/WEB-INF/faces-config.xml for modifications
I'm trying to deploy a very simple application on Openshift. It's an EAR project with a single WAR and EJB module. Inside the WAR there's a REST service that calls an EJB defined in EJB module. Locally and on Openshift I'm using Wildfly 9.0.0 CR2 and PostgreSQL 9.2. When deploying locally everything works fine. When the same code is deployed on Openshift I'm getting following errors in logs:
2015-06-28 18:23:04,574 WARN [org.jboss.as.clustering.jgroups] (MSC service thread 1-1) WFLYCLJG0006: property bind_addr for protocol org.jgroups.protocols.TCP attempting to override socket binding value 127.12.77.1 : property value 127.12.77.1 will be ignored
2015-06-28 18:23:04,574 WARN [org.jboss.as.clustering.jgroups] (MSC service thread 1-1) WFLYCLJG0006: property bind_port for protocol org.jgroups.protocols.TCP attempting to override socket binding value 7600 : property value 7600 will be ignored
2015-06-28 18:23:06,252 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 70) WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'cooking.ear/cooking-ejb-1.0-SNAPSHOT.jar#cookingPU'
2015-06-28 18:23:08,165 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.jgroups.channel.ee: org.jboss.msc.service.StartException in service jboss.jgroups.channel.ee: java.security.PrivilegedActionException: java.net.BindException: [TCP] /127.12.77.1 is not a valid address on any local network interface
at org.wildfly.clustering.jgroups.spi.service.ChannelBuilder.start(ChannelBuilder.java:79)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.security.PrivilegedActionException: java.net.BindException: [TCP] /127.12.77.1 is not a valid address on any local network interface
at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:638)
at org.jboss.as.clustering.jgroups.JChannelFactory.createChannel(JChannelFactory.java:99)
at org.wildfly.clustering.jgroups.spi.service.ChannelBuilder.start(ChannelBuilder.java:77)
... 5 more
Caused by: java.net.BindException: [TCP] /127.12.77.1 is not a valid address on any local network interface
at org.jgroups.util.Util.checkIfValidAddress(Util.java:3480)
at org.jgroups.stack.Configurator.ensureValidBindAddresses(Configurator.java:902)
at org.jgroups.stack.Configurator.setupProtocolStack(Configurator.java:118)
at org.jgroups.stack.Configurator.setupProtocolStack(Configurator.java:57)
at org.jgroups.stack.ProtocolStack.setup(ProtocolStack.java:477)
at org.jgroups.JChannel.init(JChannel.java:854)
at org.jgroups.JChannel.<init>(JChannel.java:159)
at org.jboss.as.clustering.jgroups.JChannelFactory$1.run(JChannelFactory.java:96)
at org.jboss.as.clustering.jgroups.JChannelFactory$1.run(JChannelFactory.java:93)
at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:634)
... 7 more
The address mentioned - 127.12.77.1 is $OPENSHIFT_WILDFLY_IP.
I have no idea what is causing this issue. First I thought it's a database connectivity issue because it happens when 2nd phase of starting persistence unit happens. I connected to DB on Openshift and saw that it was created successfully so maybe that's not it, but here's the persistence.xml I'm using:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="cookingPU">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>java:jboss/datasources/PostgreSQLDS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL9Dialect" />
</properties>
</persistence-unit>
</persistence>
The datasource used is the default one. I didn't change anything in standalone.xml.
Another thing I noticed is that the deploy problem happens when I add any EJB to the project.
This is a simple one I tried to use:
#Stateless
public class AnyEjb {
public String hello() {
return "Hi there!";
}
}
This is defined in EJB module. Then in web module I have this class calling it:
#Path("anything")
#Consumes(MediaType.APPLICATION_JSON)
#Produces(MediaType.APPLICATION_JSON)
public class AnyEndpoint {
#EJB
private AnyEjb anyEjb;
#GET
public String sayHi() {
return anyEjb.hello();
}
}
I'm not sure if and how it can be connected with this BindException.
I've tried running this application locally with both standalone and standalone-full-ha profile and it works in both cases. I just feel it has to be some issue with Openshift configuration but I have no idea where to look anymore. I'm very new to Openshift and Java EE. Please point me in a right direction. Any help will be much appreciated.
Might be https://issues.jboss.org/browse/JGRP-1928. Talk to Rado Husar to see how to resolve this.
It looks like the problem is (as #Bela Ban suggested) connected with the version of JGroups shipped with WildFly 9.0.0CR2. I will be waiting for the fix coming with the Final version of WildFly.
Meanwhile as a workaround to be able to deploy an application on WildFly 9.0.0CR2 on Openshift, I decided to disable clustering capabilities for my server.
In standalone.xml available in .openshift I have removed org.jboss.as.clustering.jgroups module and changed infinispan cache settings from distributed to local.
I have been basing on this solution (for WildFly 8): https://gist.github.com/fjuma/3df7f64fbaebd5506ef5#file-standalone-xml
But I had to modify it so that it works on Wildfly 9. Full standalone.xml that's been working for me is available here for reference http://pastebin.com/aANkPUWk
I deployed successfully kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war on jboss-as-7.1.1.Final, running with jdk1.7.0_10.
But this configuration ...
kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war
wildfly-8.1.0.Final
jdk1.7.0_10
.. fails to deploy with this error :
14:58:06,531 WARN [org.jboss.weld.deployer] (MSC service thread 1-5) JBAS016011: Warning while parsing vfs:/C:/java/too
ls/wildfly-8.1.0.Final-guvnor/bin/content/kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war/WEB-INF/beans.xml:
1 cvc-elt.1 : DÚclaration de l'ÚlÚment 'beans' introuvable.
14:58:07,500 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.module
.service."deployment.kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war".main: org.jboss.msc.service.StartExcep
tion in service jboss.module.service."deployment.kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war".main: JBAS
018759: Failed to load module: deployment.kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war:main
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91) [wildfly-server-8.1.0.Fi
nal.jar:8.1.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-ms
c-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.F
inal.jar:1.2.2.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_10]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_10]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_10]
Caused by: org.jboss.modules.ModuleNotFoundException: org.jboss.netty:main
at org.jboss.modules.Module.addPaths(Module.java:1050) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.Module.link(Module.java:1406) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.Module.relinkIfNecessary(Module.java:1434) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:242) [jboss-modules.jar:1.3.3.Final]
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:70) [wildfly-server-8.1.0.Fi
nal.jar:8.1.0.Final]
... 5 more
The drools-wb documentation here :
http://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/wb.Workbench.html#wb.Installation
jboss-as7: tailored for JBoss AS 7 (which is being renamed to WildFly
in version 8)
So the doc, let me think that this 6.0.1.Final release of the workbench should work well with wildfly. I might be wrong ?
I managed to figured out.
Thanks to this blog entry :
https://mswiderski.blogspot.ch/2014/06/lets-wildfly-with-jbpm6.html
So, obviously a kie-drools-wb-distribution-wars-6.0.1.Final-jboss-as7.0.war cannot be deployed to wildfly. But the documentation was confused.
Starting from version 6.1.0, there is a kie-drools-wb-distribution-wars-6.1.0.CR1-wildfly.war - I found it here :
http://central.maven.org/maven2/org/kie/kie-drools-wb-distribution-wars/6.1.0.CR1/
Finally, wildfly can be started with the default standalone.xml profile
(the standalone-full.xml profile is required for the kie-wb)
Hope that will be helpful for someone.
I am trying to get a simple JMS "Hello world" application to run. I would like to try it out on JBoss Application Server 7 but i am not able to run it. Jboss as HornetQ embedden in it and i started it using the following command:
standalone.bat --server-config=standalone-preview.xml
I think the problem is most likely to the way i have configured the queue within JBoss. Here are the steps i did.
Configure queue
Quene name: testQueue
JNDI name: queue/test
The queue configuration has an option for "Selector". Can this be left blank and if not, what goes in this field?
Code
Here is the code i am using as the Sender. I am not worried of the receiver for now as i just want to start sending a message first.
package jms.ex3;
import javax.naming.InitialContext;
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.QueueSender;
import javax.jms.DeliveryMode;
import javax.jms.QueueSession;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
public class Sender
{
public static void main(String[] args) throws Exception
{
// get the initial context
InitialContext ctx = new InitialContext();
// lookup the queue object
Queue queue = (Queue) ctx.lookup("queue/test");
// lookup the queue connection factory
QueueConnectionFactory connFactory = (QueueConnectionFactory) ctx.
lookup("queue/connectionFactory");
// create a queue connection
QueueConnection queueConn = connFactory.createQueueConnection();
// create a queue session
QueueSession queueSession = queueConn.createQueueSession(false,
Session.DUPS_OK_ACKNOWLEDGE);
// create a queue sender
QueueSender queueSender = queueSession.createSender(queue);
queueSender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
// create a simple message to say "Hello"
TextMessage message = queueSession.createTextMessage("Hello");
// send the message
queueSender.send(message);
// print what we did
System.out.println("sent: " + message.getText());
// close the queue connection
queueConn.close();
}
}
When i run the above class i get the following error:
java -classpath C:\Users\702723344\Downloads\glassfish-3.1.1\glassfish3\glassfish\lib\javaee.jar;. jms.ex3.Sender
Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at jms.ex3.Sender.main(Sender.java:22)
How exactly does the above class know that the Provider(JBoss) is running on the localhost machine? Dont i need to specify an IP address somewhere? Any ideas?
Edit
Most of the documentation seem to refer to JBoss AS 6. I have updated the code snippet to include the following:
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory" );
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
env.put(Context.PROVIDER_URL, "jnp://localhost:1199");
ctx = new InitialContext(env);
I am now getting classNotFound exception. I think it needs an additional jar file to be added to the classpath but which one???
java -classpath C:\Users\702723344\Downloads\glassfish-3.1.1\glassfish3\glassfish\lib\javaee.jar;. jms.ex3.Sender
Exception in thread "main" javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at jms.ex3.Sender.main(Sender.java:27)
Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
... 5 more
Answering on ClassNotFoundException.
org.jnp.interfaces.NamingContextFactory can be located in jboss-as-7.0.0.Final\modules\org\jboss\as\naming\main\jboss-as-naming-7.0.0.Final.jar.
Also noticed glassfish\lib\javaee.jar in your classpath and wanted to give an advice on how to easily include in classpath multiple jars from jboss/client folder.
But oups - there's no such folder in JBoss AS 7.0.
It appears that JBoss AS 7.0 doesn't support remote clients at all (at least for EJB).
Take a look at this thread: http://community.jboss.org/message/613171. It's very interesting.
There is a chance you'll further get some ClassCastExceptions with using glassfish\lib\javaee.jar.
I do not agree with the last answer from Vadzim
I know I am answering a very old question but this info miss-led me for a day, It was the first time I was trying to setup JMS remote queue on JBOSS 7 , hence had to answer, which got me working.
It appears that JBoss AS 7.0 doesn't support remote clients at all (at least for EJB)...??
It is possible to call remote queue. below are the following steps ..
Make sure to add the queues in standalone.xml or (full.xml) , in below I have got myRemoteStatusQueue set up , if you observe, exported option is must, so that the jboss knows it will consumed by the external jms client
<jms-destinations>
<jms-queue name="testQueue">
<entry name="queue/test"/>
<entry name="java:jboss/exported/jms/queue/test"/>
</jms-queue>
<jms-queue name="ddsStatusQueue">
<entry name="java:jboss/exported/jms/queue/myRemoteStatusQueue"/><!--Exported key necessary -->
</jms-queue>
<jms-topic name="testTopic">
<entry name="topic/test"/>
<entry name="java:jboss/exported/jms/topic/test"/>
</jms-topic>
</jms-destinations>
Make sure to add a role to an application user : such as remote-role , after adding the role make sure to include them in the Jboss's standalone.xml.
<jms-destinations>
<jms-queue name="testQueue">
<entry name="queue/test"/>
<entry name="java:jboss/exported/jms/queue/test"/>
</jms-queue>
<jms-queue name="ddsStatusQueue">
<entry name="java:jboss/exported/jms/queue/myRemoteStatusQueue"/> <!--Exported key necessary -->
</jms-queue>
<jms-topic name="testTopic">
<entry name="topic/test"/>
<entry name="java:jboss/exported/jms/topic/test"/>
</jms-topic>
</jms-destinations>
<security-settings>
<security-setting match="#">
<permission type="send" roles="remote-role guest"/>
<permission type="consume" roles="remote-role guest"/>
<permission type="createNonDurableQueue" roles="guest"/>
<permission type="deleteNonDurableQueue" roles="guest"/>
</security-setting>
</security-settings>
Make sure to use below code ,you can see I have used remote:/ as part of URL for remoting
private static final String DEFAULT_MESSAGE = " Dummy message local Client Message At"+new Date();
private static final String DEFAULT_CONNECTION_FACTORY = "/jms/ConnectionFactory";
private static final String DEFAULT_DESTINATION = "jms/queue/myRemoteStatusQueue";
private static final String DEFAULT_MESSAGE_COUNT = "1";
private static final String DEFAULT_USERNAME = "abhijith";
private static final String DEFAULT_PASSWORD = "password";
private static final String INITIAL_CONTEXT_FACTORY = "org.jboss.naming.remote.client.InitialContextFactory";
private static final String PROVIDER_URL = "remote://localhost:4447";
Make sure to use the right jars, for the Above example , I used hornetq-core-2.2.14.Final.jar and the usage of correct JBOSS client jar , go to the client folder of the bin directory of JBOSS, you will have readme.txt, there you will have reference for Maven version to use, if you are using as a standalone application then you can reference the given jar in the directory.
Deploy your app on JBOSS , During the start up you should see the configured Queue without any error. You can see for example in my server startup log, java:jboss/exported/jms/queue/myRemoteStatusQueue. If the above entry has come up with out error, now you are good to go ...
16:24:46,527 INFO [org.jboss.as.messaging] (MSC service thread 1-2) JBAS011601: Bound messaging object to jndi name java:/queue/test
16:24:46,533 INFO [org.jboss.as.messaging] (MSC service thread 1-2) JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/queue/test
16:24:46,545 INFO [org.jboss.as.messaging] (MSC service thread 1-8) JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/RemoteConnectionFactory
16:24:46,548 INFO [org.jboss.as.messaging] (MSC service thread 1-8) JBAS011601: Bound messaging object to jndi name java:/RemoteConnectionFactory
16:24:46,551 INFO [org.jboss.as.messaging] (MSC service thread 1-3) JBAS011601: Bound messaging object to jndi name java:/ConnectionFactory
16:24:46,552 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-4) trying to deploy queue jms.topic.testTopic
16:24:46,569 INFO [org.jboss.as.deployment.connector] (MSC service thread 1-6) JBAS010406: Registered connection factory java:/JmsXA
16:24:46,607 INFO [org.hornetq.ra.HornetQResourceAdapter] (MSC service thread 1-6) HornetQ resource adaptor started
16:24:46,609 INFO [org.jboss.as.connector.services.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-6) IJ020002: Deployed: file://RaActivatorhornetq-ra
16:24:46,612 INFO [org.jboss.as.deployment.connector] (MSC service thread 1-6) JBAS010401: Bound JCA ConnectionFactory [java:/JmsXA]
16:24:46,638 INFO [org.jboss.as.messaging] (MSC service thread 1-4) JBAS011601: Bound messaging object to jndi name java:/topic/test
16:24:46,641 INFO [org.jboss.as.messaging] (MSC service thread 1-4) JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/topic/test
16:24:46,642 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-7) trying to deploy queue jms.queue.myRemoteStatusQueue
16:24:46,645 INFO [org.jboss.as.messaging] (MSC service thread 1-7) JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/queue/myRemoteStatusQueue
16:24:47,211 INFO [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-1) JBoss Web Services - Stack CXF Server 4.0.2.GA
(-1 / -1) (org/jboss/as/network/ManagedBinding$Factory/org/jboss/as/network/ManagedBinding$Factory)
Happy coding,
Regards,
Abhijith
We are trying to deploy Orbeon Forms 3.9 on JBoss AS 7 and getting the following errors:
15:34:36,621 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/adg-xforms]] (MSC service thread 1-2) Exception sending context initialized event to listener instance of class org.orbeon.oxf.webapp.OrbeonServletContextListenerDelegate: org.orbeon.oxf.common.OXFException: no implementation of regexp was found.
at org.orbeon.oxf.webapp.OrbeonServletContextListenerDelegate.contextInitialized(OrbeonServletContextListenerDelegate.java:43) [orbeon.jar:]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_25]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]
15:34:36,670 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Error listenerStart
15:34:36,670 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Context [/adg-xforms] startup failed due to previous errors
15:34:36,682 ERROR [stderr] (MSC service thread 1-2) Starting Orbeon Forms 3.8.0.201005141856 CE
15:34:36,693 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/adg-xforms]] (MSC service thread 1-2) Exception sending context destroyed event to listener instance of class org.orbeon.oxf.webapp.OrbeonServletContextListenerDelegate: org.orbeon.oxf.common.OXFException: Could not initialize class com.sun.msv.datatype.xsd.AnyURIType
at org.orbeon.oxf.webapp.OrbeonServletContextListenerDelegate.contextDestroyed(OrbeonServletContextListenerDelegate.java:52) [orbeon.jar:]
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3465) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3970) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3888) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_25]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]
Do you support JBoss AS 7 or anyone tried deploying orbeon on this app server.
I just added xsdlib-20030225.jar to lib directory (It's just one I had to hand ;-O). This is a HACK, I don't know what it affects and don't know if there are any side effects...but it works so far ;-)
This was tested with JBoss AS 7.1.1.Final "Brontes".
Follow the following steps:
for Orbeon Forms PE
unzip orbeon.war
place your license.xml file under WEB-INF/resources/config/license.xml
re-zip orbeon.war
start a standalone server with bin/standalone.sh
drop orbeon.war into the JBoss standalone/deployments folder
(source)
The joy of class loaders. Some code in MSV tries to load com.sun.msv.datatype.xsd.AnyURIType, which shouldn't fail as this class is in WEB-INF/lib/msv-xsdlib-20070407_orbeon_20100309.jar. I suspect that because of the way the class loaders is structured in JBoss, Orbeon ends up using a version of MSV coming from JBoss which is unable to load AnyURIType which is a jar that only comes with Orbeon. But I might be wrong on this.
This type of application-server specific question can be rather time consuming to resolve. So I would recommend you to use Tomcat or to get Orbeon to resolve this for you under a Development Support subscription.