JBOSS Migration AS6 to EAP 7 404 Error - jboss

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/

Related

Unable to register Kie Server with Kie Workbench

"I'm setting up Kie Workbench 7.5 and Kie Server 7.5 both into tomcat 8.
But "Remote Servers" is showing blank list.
For installation reference I used http://blog.athico.com/2015/10/installing-kie-server-and-workbench-on.html this blog.
Once I hit http://localhost:8080/kie-server/services/rest/server this URL I am getting expected output as below:
<response type="SUCCESS" msg="Kie Server info">
<kie-server-info>
<capabilities>KieServer</capabilities>
<capabilities>BRM</capabilities>
<capabilities>BPM</capabilities>
<capabilities>CaseMgmt</capabilities>
<capabilities>BPM-UI</capabilities>
<capabilities>BRP</capabilities>
<capabilities>DMN</capabilities>
<capabilities>Swagger</capabilities>
<location>
http://localhost:8080/kie-server/services/rest/server
</location>
<name>tomcat-kieserver</name>
<id>tomcat-kieserver</id>
<version>7.5.0.Final</version>
</kie-server-info>
</response>
Configuration which I proviced
1. setenv.bat
set CATALINA_OPTS=-Xmx512M -Djbpm.tsr.jndi.lookup=java:comp/env/TransactionSynchronizationRegistry -Dorg.kie.server.persistence.ds=java:comp/env/jdbc/jbpm -Djbpm.tm.jndi.lookup=java:comp/env/TransactionManager -Dorg.kie.server.persistence.tm=JBossTS -Dhibernate.connection.release_mode=after_transaction -Dorg.kie.server.id=tomcat-kieserver -Djava.security.auth.login.config=C:/softwares/apache-tomcat-8.5.43/webapps/kie-drools-wb/WEB-INF/classes/login.config -Dorg.kie.server.location=http://localhost:8080/kie-server/services/rest/server -Dorg.kie.server.controller=http://localhost:8080/kie-drools-wb/rest/controller -Dcom.arjuna.ats.jta.recovery.XAResourceRecovery1=com.arjuna.ats.internal.jdbc.recovery.BasicXARecovery;abs://C:/softwares/apache-tomcat-8.5.43/conf/xa-recovery-properties.xml
2. server.xml
<Valve className="org.kie.integration.tomcat.JACCValve" />
3. context.xml
<Resource name="sharedDataSource"
auth="Container"
type="org.h2.jdbcx.JdbcDataSource"
user="sa"
password="sa"
url="jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;MVCC=TRUE"
description="H2 Data Source"
loginTimeout="0"
testOnBorrow="false"
factory="org.h2.jdbcx.JdbcDataSourceFactory"/>
4. xa-recovery-properties.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key="DB_1_DatabaseUser">sa</entry>
<entry key="DB_1_DatabasePassword">sa</entry>
<entry key="DB_1_DatabaseDynamicClass"></entry>
<entry key="DB_1_DatabaseURL">java:comp/env/h2DataSource</entry>
</properties>
On Tomcat console I am getting below warning:
WARNING [KieServer-ControllerConnect] org.kie.server.services.impl.controller.DefaultRestControllerImpl.connectToSingleController Exception encountered while syncing with controller at http://localhost:8080/kie-drools-wb/rest/controller/server/tomcat-kieserver error Error while sending PUT request to http://localhost:8080/kie-drools-wb/rest/controller/server/tomcat-kieserver response code 401
Workbench 7.0+ is not support Tomcat any more. If you want to use Workbench (it is already renamed to Business Central and has latest version 7.24) it should run on Wildfly 14.
You can try this quick start (just unzip file and it is ready to try or copy configurations): https://www.jbpm.org/learn/gettingStarted.html
If you need to start Workbench on Tomcat, you should use 6.x (which is not supported any more).

tomcat conf/context.xml - Property 'factory' not supported

I'm trying to change the connection pool of my web app to use the Tomcat Connection pool (org.apache.tomcat.jdbc.pool.DataSourceFactory). So, I added the factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" line into the conf/context.xml file, like below:
<Context>
<Resource
type="javax.sql.DataSource"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
name="jdbc/mcbell"
auth="Application"
maxActive="50"
maxIdle="30"
maxWait="10000"
removeAbandoned="true"
removeAbandonedTimeout="1200"
logAbandoned="true"
driverClassName="com.ibm.as400.access.AS400JDBCDriver"
url="jdbc:as400://mcbell4;secure=true;naming=system;errors=full;prompt=false;libraries=*LIBL;timeFormat=iso;dateFormat=iso;dateSeparator=-"
username=""
password=""
validationQuery="select 1 from sysibm/sysdummy1"
alternateUsernameAllowed="true"
validationQueryTimeout="10"
validationInterval="30000"
testWhileIdle="true"
timeBetweenEvictionRunsMillis="30000"
minEvictableIdleTimeMillis="30000"
/>
</Context>
The reason for changing it to Tomcat connection pool is so that I can use this validationInterval property. But the validationInterval still does not seem to be working. In the log I see this warning below. Is that means that the Tomcat Connection Pool setting is not taking effect? Why is the factory property not supported?
INFO: Creating Resource(id=host-manager/jdbc/mcbell)
Nov 14, 2018 3:17:11 PM org.apache.openejb.assembler.classic.Assembler unusedProperty
WARNING: Property "factory" not supported by "host-manager/jdbc/mcbell"

JBoss Migration 5 EAP to 7 EAP Error with IllegalAnnotationsException XML Binding

I am currently working on JBoss migration from EAP 5.0.0 to EAP 7.1.0
My project structure is
AAA.ear
-- AAA-ejb.jar
-- AAA-soap.jar
-- /**-mapping.xml
-- lib
For now when I try to deploy AAA.ear with only AAA-ejb.jar dependency it doesn’t get any error.
But with both AAA-ejb.jar and AAA-soap.jar there is error log with the XML binding
2018-08-20 11:53:55,565 INFO [org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-2) Creating Service {http://www.abcd.co.com/wsdl/AImplementation/subscription/subscription-soap11http/v1}Subscription-SOAP11HTTP-v1 from WSDL: META-INF/wsdl/Subscription-SOAP11HTTP.wsdl
2018-08-20 11:53:55,672 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.subunit."AAA.ear"."AAA-soap.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."AAA.ear"."AAA-soap.jar".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of subdeployment "AAA-soap.jar" of deployment "AAA.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:172)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
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: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:375)
at org.jboss.wsf.stack.cxf.deployment.EndpointImpl.doPublish(EndpointImpl.java:79)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:255)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:543)
at org.jboss.wsf.stack.cxf.configuration.BusHolder.configure(BusHolder.java:235)
at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.startDeploymentBus(BusDeploymentAspect.java:97)
at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:59)
at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:73)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
... 5 more
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:329)
at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:426)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:528)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:263)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:199)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:103)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:168)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:460)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:338)
... 13 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 12 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{http://www.abcd.co.com/schema/bus/money/money/v1}InvestmentTypeType". Use #XmlType.name and #XmlType.namespace to assign different names to them.
this problem is related to the following location:
at com.co.abcd.subscriptionv1.schema.bus.money.money.InvestmentTypeType
at protected com.co.abcd.subscriptionv1.schema.bus.money.money.InvestmentTypeType com.co.abcd.subscriptionv1.schema.bus.subscription.subscription.SubscriptionByInvestmentTypeType.investmentType
at com.co.abcd.subscriptionv1.schema.bus.subscription.subscription.SubscriptionByInvestmentTypeType
at public com.co.abcd.subscriptionv1.schema.bus.subscription.subscription.SubscriptionByInvestmentTypeType com.co.abcd.subscriptionv1.schema.bus.subscription.subscription.ObjectFactory.createSubscriptionByInvestmentTypeType()
at com.co.abcd.subscriptionv1.schema.bus.subscription.subscription.ObjectFactory
this problem is related to the following location:
at com.co.abcd.schema.bus.money.money.v1.InvestmentTypeType
at protected com.co.abcd.schema.bus.money.money.v1.InvestmentTypeType com.co.abcd.schema.bus.account.account.v1.ValuationByMoneyType.investmentType
at com.co.abcd.schema.bus.account.account.v1.ValuationByMoneyType
at protected java.util.List com.co.abcd.schema.bus.account.account.v1.ValuationByMoneyListType.valuationByMoney
at com.co.abcd.schema.bus.account.account.v1.ValuationByMoneyListType
at protected com.co.abcd.schema.bus.account.account.v1.ValuationByMoneyListType com.co.abcd.schema.bus.account.account.v1.ProductHoldingInstanceType.valuationByMoneyList
at com.co.abcd.schema.bus.account.account.v1.ProductHoldingInstanceType
at protected java.util.List com.co.abcd.schema.bus.account.account.v1.ProductHoldingInstanceListType.productHoldingInstance
at com.co.abcd.schema.bus.account.account.v1.ProductHoldingInstanceListType
at public com.co.abcd.schema.bus.account.account.v1.ProductHoldingInstanceListType com.co.abcd.schema.bus.account.account.v1.ObjectFactory.createProductHoldingInstanceListType()
at com.co.abcd.schema.bus.account.account.v1.ObjectFactory
.
.
.
My currently jboss-deployment-structure.xml in AAA.ear is
<jboss-deployment-structure>
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<dependencies>
<module name="org.hibernate" export="true"/>
<module name="org.jboss.as.system-jmx" export="true"/>
<module name="org.dom4j" export="true"/>
<module name="deployment.AAA.ear.AAA-ejb.jar" export="true"/>
<module name="deployment.AAA.ear.AAA-soap.jar" export="true"/>
</dependencies>
</deployment>
<sub-deployment name="AAA-ejb.jar">
</sub-deployment>
<sub-deployment name="AAA-soap.jar">
<dependencies>
<module name="deployment.AAA.ear.AAA-ejb.jar" />
</dependencies>
And I recognized that my project can deploy and run successfullly in Jboss 5 with JBoss Web Services Native 3.1.2 SP3.
Does this error occured because of the JBoss Web services is changed to JBossWS 5.1.9 ? If yes, what should I do.
Can anyone please advice? Thanks in advance
I solved the issue now with the https://developer.jboss.org/thread/274491
It happened that because the subscription-wsimport.jar (Jar stub for generate the WSDL) is not working on EAP 7 anymore .
So I try to re-generate the Stub with the new generator and deploy again. It has no error and WSDL Service is run successfully.

How to configure commit option for ejbs in Wildfly 10

I'm in the process of upgrading jboss from 4.2 to Wildfly 10.
As part of the EJB configuration, in the META-INF folder we have a jboss.xml with container configuration. The configuration is as below.
<?xml version="1.0"?>
<jboss>
<container-configurations>
<container-configuration extends="Standard BMP EntityBean">
<container-name>Standard BMP EntityBean with commit option C</container-name>
<commit-option>C</commit-option>
</container-configuration>
<container-configuration extends="Instance Per Transaction BMP EntityBean">
<container-name>Instance Per Transaction BMP EntityBean with commit option C</container-name>
<commit-option>C</commit-option>
<sync-on-commit-only>true</sync-on-commit-only>
</container-configuration>
</container-configurations>
<enterprise-beans>
<entity>
<ejb-name>TestEjbEntity</ejb-name>
<configuration-name>Instance Per Transaction BMP EntityBean with commit option C</configuration-name>
</entity>
<message-driven>
<ejb-name>ASyncActionExecutor</ejb-name>
<configuration-name>Standard Message Driven Bean</configuration-name>
<destination-jndi-name>queue/ASyncAction</destination-jndi-name>
</message-driven>
</enterprise-beans>
</jboss>
How do I do this in Wildfly 10?
There is no way to configure it as EJB2 EntityBeans are marked as optional for EE7.
Wildfly does not support the use of EnttyBeans, you should also see a WARN or ERROR message if you try to deploy such appliation.
I recommed to migrate to JPA.

How do specify clientId and subscriptionName for EJB3 message driven bean durable subscription without hard coding the values?

I have a server running JBoss4.2.1 containing a JMS Topic. I also have multiple terminals, each running their own JBoss with an EJB3 message driven bean that need to subscribe to the topic using durable subscriptions. Since each subscription needs to specify a unique clientId and subscriptionName I can't hard code the values in the ActivationConfigProperty annotations and I can't specify the values in the deployment descriptor files.
So, the question is how do I specify these values? Do I do it in JBoss configuration files?
Please provide a complete sample configuration if possible.
Thanks.
This can be done by using a combination of entries in the ejb-jar.xml configuration file and supplying the values as parameters to the JBoss startup command.
META-INF/ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
version="3.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
<enterprise-beans>
<message-driven>
<ejb-name>MyMsgDrivenBeanMDB</ejb-name>
<ejb-class>com.mdb.MyMsgDrivenBeanMDB</ejb-class>
<activation-config>
<activation-config-property>
<activation-config-property-name>clientId</activation-config-property-name>
<activation-config-property-value>${client.id}</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>subscriptionName</activation-config-property-name>
<activation-config-property-value>${subscription.name}</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>reconnectInterval</activation-config-property-name>
<activation-config-property-value>60</activation-config-property-value>
</activation-config-property>
</activation-config>
</message-driven>
</enterprise-beans>
</ejb-jar>
By specifying the values using the ${variable} notation in the ejb-jar.xml file they can then be picked up from the JBoss start command as server options.
-Dclient.id=client-01 -Dsubscription.name=subscription-01