WF 18 to WF 26 Migration

461 views
Skip to first unread message

roger tech

unread,
Oct 20, 2022, 9:00:06 AM10/20/22
to WildFly
Hello,
  Firstly, I have been unable to get the migration tool to build and run on Windows.

Secondly and more importantly at this time, I have to keep toggling my jboss-ejb3.xml root element and namespaces to get a clean boot. When it fails it reports
`"Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[166,9]
Message: found: CHARACTERS, expected START_ELEMENT or END_ELEMENT
    at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.nextTag(XMLStreamReaderImpl.java:1257)
    at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElements(AbstractMetaDataParser.java:64)
    at org.jboss.metadata.ejb.parser.spec.SessionBeanMetaDataParser.parse(SessionBeanMetaDataParser.java:81)
    at org.jboss.metadata.ejb.parser.spec.EnterpriseBeansMetaDataParser.processElement(EnterpriseBeansMetaDataParser.java:87)
    at org.jboss.metadata.ejb.parser.spec.EnterpriseBeansMetaDataParser.processElement(EnterpriseBeansMetaDataParser.java:39)
    at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElements(AbstractMetaDataParser.java:65)
    at org.jboss.metadata.ejb.parser.spec.EnterpriseBeansMetaDataParser.parse(EnterpriseBeansMetaDataParser.java:72)
    at org.jboss.metadata.ejb.parser.spec.EnterpriseBeansMetaDataParser.parse(EnterpriseBeansMetaDataParser.java:65)
    at org.jboss.metadata.ejb.parser.spec.AbstractEjbJarMetaDataParser.processElement(AbstractEjbJarMetaDataParser.java:98)
    at org.jboss.metadata.ejb.parser.jboss.ejb3.JBossEjb3MetaDataParser.processElement(JBossEjb3MetaDataParser.java:151)
    at org.jboss.metadata.ejb.parser.jboss.ejb3.JBossEjb3MetaDataParser.processElement(JBossEjb3MetaDataParser.java:42)
    at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElements(AbstractMetaDataParser.java:65)
    at org.jboss.metadata.ejb.parser.jboss.ejb3.JBossEjb3MetaDataParser.parse(JBossEjb3MetaDataParser.java:102)
    at org.jboss.as.ejb3.deployment.processors.EjbJarParsingDeploymentUnitProcessor.parseJBossEjb3Xml(EjbJarParsingDeploymentUnitProcessor.java:291)"`

166 is </session> this is the surrounding blocks:
`<session>
                <ejb-name>MyCopy</ejb-name>
                <home>com.mydomain.session.MyCopyHome</home>
                <remote>com.mydomain.session.MyCopy</remote>
                <ejb-class>com.mydomain.session.MyCopyBean</ejb-class>
                <session-type>Stateless</session-type>
                <transaction-type>Container</transaction-type>
        </session>
       
       
         <session>
                <ejb-name>MyDelete</ejb-name>
                <home>com.mydomain.session.MyDeleteHome</home>
                <remote>com.mydomain.session.MyDelete</remote>
                <ejb-class>com.mydomain.session.MyDeleteBean</ejb-class>
                <session-type>Stateless</session-type>
                <transaction-type>Container</transaction-type>
        </session>`

I'm not clear what the cause of this is or what I'm missing. I assume there is either a namespace and schema issue where the remote resources are changing or I'm missing a critical step in the migration for my Java EE application. The application is already coded for 3.2 spec.

Thanks

roger tech

unread,
Oct 20, 2022, 9:46:59 AM10/20/22
to WildFly
Is there a bug in the XML parser? I had a working boot and simply changed
`<?xml version="1.1" encoding="UTF-8"?>`
to 
`<?xml version="1.1" encoding="UTF-8"?>
<!--
a multilinecomment -->`
and I'm now getting:
`Caused by javax.xml.stream.XMLStreamException: ParseError at [row,col]:[503,17]`
Line 503 is `<method-name>*</method-name>`

I'm using Java 8.

roger tech

unread,
Oct 20, 2022, 7:53:39 PM10/20/22
to WildFly
Another odd thing. I switched the Xerces Impl to the version before which broke the maven enforcer so I placed it back to the current version as packaged with 26.1.3.Final but now no exclusion "*" wildcards are honored and I'm having to go through every pom.xml and list these one by one. Maven version: 3.6.1. 

Even a local repo purge and fresh download and install still breaks with the enforcer rules. Out of curiosity I tried to build WF v25 but still breaking with the enforcer rules about the banned dependencies despite not changing anything.

Am I barking up the wrong tree here? Based on the random behavior and seemingly random output from the xml parser it appears to be a bug. I would think that if I was doing something wrong it would tell me. I don't believe my jboss-ejb3.xml has unsupported definitions?

serg.k...@gmail.com

unread,
Oct 21, 2022, 2:30:06 PM10/21/22
to WildFly
which migration tool are you talking about ? as far as i know - https://github.com/wildfly/wildfly-server-migration/releases does not support migration to  WFLY 26


пʼятниця, 21 жовтня 2022 р. о 00:53:39 UTC+1 techr...@gmail.com пише:

roger tech

unread,
Oct 21, 2022, 2:30:10 PM10/21/22
to WildFly
I fixed maven by updating to latest version and the exclusions are now honored.

However, I'm still stuck on the Xml Parsing error. I have a clean boot. 
Simply press the enter key inserting a newline in jboss-ejb3.xml, save, publish and boot and that error comes back. I did adjust my Xms and Xmx and not finding any indication of memory errors. When I add newlines to the quickstarts doc to exceed the line count from my project it does not produce this error. I can't add anymore classes to my project which I need due to this error. Same error on WF v25 too.

Any ideas? I'm stuck!

roger tech

unread,
Oct 21, 2022, 2:40:39 PM10/21/22
to WildFly
@serg.k, Yes that's the one. I just tried again and it produces this error:
`[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0-jboss-2:compile (default-compile) on project jboss-server-migration-core: Compilation failure
[ERROR] /Downloads/wildfly-server-migration-master/wildfly-server-migration-master/core/src/main/java/org/jboss/migration/core/jboss/ResolvablePath.java:[21,45] cannot access org.jboss.as.domain.management.ModelDescriptionConstants
[ERROR]   bad class file: \.m2\repository\org\wildfly\core\wildfly-domain-management\19.0.0.Beta18\wildfly-domain-management-19.0.0.Beta18.jar(org/jboss/as/domain/management/ModelDescriptionConstants.class)
[ERROR]     class file has wrong version 55.0, should be 52.0
[ERROR]     Please remove or make sure it appears in the correct subdirectory of the classpath.`

roger tech

unread,
Nov 3, 2022, 8:26:35 AM11/3/22
to WildFly
After extracting the xerces module it doesn't appear to be part of the package causing the error. My only hint is within the JDK itself so I assume the problem lies in its com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl. Assuming this part isn't a WildFly issue, I will try the JDK. If this is incorrect please inform. I don't believe it's possible to get the jboss metadata to use a different version of xerces without changing the source.

Alexey Makhmutov

unread,
Nov 3, 2022, 11:01:09 AM11/3/22
to WildFly
Hi,

This error is most likely caused by the migration of JBoss Modules to native JDK parsing in WildFly 26 (MODULES-407/WFCORE-5595/WFCORE-5596/WFLY-15350), which in its turn allows manifestation of JDK 8 bug JDK-8167340 in bundled XML 1.1 parser (it's fixed in later Java versions, but not in Java 8). 

Just try to change the first line from the:
`<?xml version="1.1" encoding="UTF-8"?>`
to:
`<?xml version="1.0" encoding="UTF-8"?>`

Thanks,
Alexey

четверг, 20 октября 2022 г. в 16:00:06 UTC+3, techr...@gmail.com:

roger tech

unread,
Nov 4, 2022, 4:13:17 PM11/4/22
to WildFly
Thank you Alexey for this tip!
Reply all
Reply to author
Forward
0 new messages