Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors/Warning compiling a WSDL file - but the generated Java sources are ok #243

Closed
weberhofer opened this issue Apr 28, 2022 · 40 comments · Fixed by #500
Closed

Errors/Warning compiling a WSDL file - but the generated Java sources are ok #243

weberhofer opened this issue Apr 28, 2022 · 40 comments · Fixed by #500
Assignees
Labels
bug-external Issue concerns an external dependency
Milestone

Comments

@weberhofer
Copy link

First: Thanks for all the new contributions to the project!

I have tried to update a project which creates java sources from a WSDL. Unfortunately I see the following exception on invoking the compiler:

[INFO] Sources are not up-to-date, XJC will be executed.
[WARNING] Error while parsing schema(s).Location [].
org.xml.sax.SAXParseException; Versuchen Sie, WSDL zu kompilieren? Unterstützung für WSDL ist zu Testzwecken bestimmt. Eine Aktivierung ist mit der Option -wsdl möglich.
	at com.sun.tools.xjc.ErrorReceiver.warning(ErrorReceiver.java:76)
	at com.sun.tools.xjc.ModelLoader.sanityCheck(ModelLoader.java:176)
	at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:90)
	at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:76)
	at org.jvnet.mjiip.v_2_3.XJC23Mojo.loadModel(XJC23Mojo.java:50)
	at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute(XJC23Mojo.java:40)
	at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute(XJC23Mojo.java:28)
	at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute(RawXJC2Mojo.java:477)
	at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute(RawXJC2Mojo.java:319)
...

The exception asks something like "Do you try to compile WSDL? Support for WSDL is for test purposes. You can activate it with the option -wsdl.

With version 0.14.0 everything was working without that message. However, the tool creates the Java-Codes as expected!

The relevant section in my pom.xml is:

			<plugin>
				<groupId>org.jvnet.jaxb2.maven2</groupId>
				<artifactId>maven-jaxb2-plugin</artifactId>
				<version>0.15.1</version>
				<executions>
					<execution>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<schemaLanguage>WSDL</schemaLanguage>
					<schemaDirectory>${basedir}/src/main/resources</schemaDirectory>
					<schemaIncludes>*.wsdl</schemaIncludes>
					<args>
						<arg>-XtoString</arg>
					</args>
					<plugins>
						<!-- besseres toString() in generierten JAXB-Klassen -->
						<plugin>
							<groupId>org.jvnet.jaxb2_commons</groupId>
							<artifactId>jaxb2-basics</artifactId>
							<version>0.13.1</version>
						</plugin>
					</plugins>
				</configuration>
			</plugin>
@mattrpav
Copy link
Collaborator

Please try to add the WSDL option as the error message indicates

see this example: https://github.com/highsource/maven-jaxb2-plugin/tree/master/tests/wsdl

<plugin>
				<groupId>org.jvnet.jaxb2.maven2</groupId>
				<artifactId>maven-jaxb2-plugin</artifactId>
				<configuration>
					<schemas>
						<schema>
							<url>http://www.webservicex.net/globalweather.asmx?wsdl</url>
						</schema>
					</schemas>
					<schemaLanguage>WSDL</schemaLanguage>
				</configuration>
			</plugin>

@mattrpav mattrpav self-assigned this Apr 28, 2022
@mattrpav mattrpav added this to the 2.3.6 milestone Apr 28, 2022
@weberhofer
Copy link
Author

Thanks for your response. This has already been confgured in the first line of the section. Switching over to the way to configure does unfortunately not change anything. As in the other cases, the sources are correctly generated.

I have found older issue having the same warning noted: #96 (comment)

Maybe an additional parameter "-wsdl" must be set when invoking xjc for WSDL-files? As everything works, the issue is not that important but it is a little bit annoying.

@yanivnahoum
Copy link

I have the exact same issue, and my configuration is identical to that of @weberhofer.

@dhpalan
Copy link

dhpalan commented May 5, 2022

I have a similar error after upgrading from 0.14.0 to 0.15.1

Error message:

[INFO]
[INFO] --- maven-jaxb2-plugin:0.15.1:generate (default) @ my-project ---
[INFO] Sources are not up-to-date, XJC will be executed.
[WARNING] Error while parsing schema(s).Location [].
org.xml.sax.SAXParseException: Are you trying to compile WSDL? Support for WSDL is experimental. You may enable it by using the -wsdl option.
    at com.sun.tools.xjc.ErrorReceiver.warning (ErrorReceiver.java:76)
    at com.sun.tools.xjc.ModelLoader.sanityCheck (ModelLoader.java:176)
    at com.sun.tools.xjc.ModelLoader.load (ModelLoader.java:90)     
    at com.sun.tools.xjc.ModelLoader.load (ModelLoader.java:76)     
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.loadModel (XJC23Mojo.java:50)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute (XJC23Mojo.java:40)     
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute (XJC23Mojo.java:28)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute (RawXJC2Mojo.java:477)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute (RawXJC2Mojo.java:319)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[INFO] Episode file [C:\my-project\target\generated-sources\xjc\META-INF\sun-jaxb.episode] was augmented with if-exists="true" attributes.
[INFO]

pom.xml

<plugin>
        <groupId>org.jvnet.jaxb2.maven2</groupId>
        <artifactId>maven-jaxb2-plugin</artifactId>
        <version>0.15.1</version>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <schemaLanguage>WSDL</schemaLanguage>
          <generatePackage>com.example.generated</generatePackage>
          <schemaDirectory>src/main/resources/cas</schemaDirectory>
          <schemaIncludes>
            <include>*.wsdl</include>
          </schemaIncludes>
        </configuration>
      </plugin>

@mattrpav
Copy link
Collaborator

mattrpav commented May 6, 2022

I'll take a look at it this weekend. Seems odd since the root of the stack trace is the xjc layer.

com.sun.tools.xjc.ModelLoader.load

@lepus
Copy link

lepus commented Jun 24, 2022

Hi, any update here?

@DeepanshuRastogi1
Copy link

I'm facing the same issue when upgrading to version 0.15.1 with java 17 and spring boot 2.7.0

@funnybobde
Copy link

I'm facing the same issue when upgrading to version 0.15.1 with java 17 and spring boot 2.7.2

        <plugin>
            <groupId>org.jvnet.jaxb2.maven2</groupId>
            <artifactId>maven-jaxb2-plugin</artifactId>
            <version>0.15.1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <strict>false</strict>
                <catalog>src/main/resources/catalog.cat</catalog>
                <schemaLanguage>WSDL</schemaLanguage>
                <generatePackage>a.b.c.d.soap.ws.wsdl</generatePackage>
                <schemas>
                    <schema>
                        <url>http://localhost:8080/soap/v1/myoperations.wsdl</url>
                    </schema>
                </schemas>
            </configuration>
        </plugin>

@Grogdunn
Copy link

Any news with it? My configuration is similar to others on JDK 17

<plugin>
    <groupId>org.jvnet.jaxb2.maven2</groupId>
    <artifactId>maven-jaxb2-plugin</artifactId>
    <version>0.15.1</version>
    <executions>
        <execution>
            <id>asd</id>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <schemaDirectory>src/main/resources/asd/</schemaDirectory>
                <bindingDirectory>src/main/resources/asd/</bindingDirectory>
                <bindingIncludes>jaxb-bindings.xml</bindingIncludes>
                <schemaIncludes>asd.wsdl</schemaIncludes>
                <generateDirectory>target/generated-sources/asd</generateDirectory>
                <generatePackage>asd.client.model</generatePackage>
            </configuration>
        </execution>
    </executions>
</plugin>

@gadton
Copy link

gadton commented Aug 25, 2022

I've noticed the same exception but all the sources were generated on JDK 17.
I've noticed no change after adding

<args>
   <arg>-wsdl</arg>
</args>

@fabian-froehlich
Copy link

I am also experiencing this exception on JDK 17. But It looks like it has no effect.

@ielkhalloufi
Copy link

I am also experiencing this exception with JDK 17 and Spring boot 2.7:

[WARNING] Error while parsing schema(s).Location [].
org.xml.sax.SAXParseException: Are you trying to compile WSDL? Support for WSDL is experimental. You may enable it by using the -wsdl option.
    at com.sun.tools.xjc.ErrorReceiver.warning (ErrorReceiver.java:76)
    at com.sun.tools.xjc.ModelLoader.sanityCheck (ModelLoader.java:176)
    at com.sun.tools.xjc.ModelLoader.load (ModelLoader.java:90)
    at com.sun.tools.xjc.ModelLoader.load (ModelLoader.java:76)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.loadModel (XJC23Mojo.java:50)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute (XJC23Mojo.java:40)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute (XJC23Mojo.java:28)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute (RawXJC2Mojo.java:477)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute (RawXJC2Mojo.java:319)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

@atlib77
Copy link

atlib77 commented Dec 15, 2022

+1

@BA-lfgomez-dev
Copy link

I got the same issue, I've decided to use the 0.14.0 instead.....

@jbrechbuehl
Copy link

+1 with JDK17 and 0.15.2

<plugin>
  <groupId>org.jvnet.jaxb2.maven2</groupId>
  <artifactId>maven-jaxb2-plugin</artifactId>
  <version>0.15.2</version>
  <configuration>
	  <verbose>true</verbose>
	  <forceRegenerate>${maven-jaxb2-plugin.forceRegenerate}</forceRegenerate>  
	  <removeOldOutput>false</removeOldOutput>
  </configuration>
  <executions>
	  <execution>
		  <id>generate-wsdl</id>
		  <goals>
			  <goal>generate</goal>
		  </goals>
		  <configuration>
			  <schemaLanguage>WSDL</schemaLanguage>
			  <schemaDirectory>${project.basedir}/src/main/resources/wsdl</schemaDirectory>
			  <schemaIncludes>
				  <include>*.wsdl</include>
			  </schemaIncludes>
			  <generateDirectory>${project.build.directory}/generated-sources/</generateDirectory>  
			  <locale>en</locale>                  
		  </configuration>
	  </execution>
	  <execution>
		  <id>generate-camt-xsd</id>
		  <goals>
			  <goal>generate</goal>
		  </goals>
		  <configuration>
			  <schemaDirectory>${project.basedir}/src/main/resources/camt</schemaDirectory>
			  <schemaIncludes>
				  <include>*.xsd</include>
			  </schemaIncludes>
			  <generateDirectory>${project.build.directory}/generated-sources/</generateDirectory>  
			  <locale>en</locale>                  
		  </configuration>
	  </execution>
  </executions>
</plugin>

Error:

[WARNING] Error while parsing schema(s).Location [].
org.xml.sax.SAXParseException: Are you trying to compile WSDL? Support for WSDL is experimental. You may enable it by using the -wsdl option.
    at com.sun.tools.xjc.ErrorReceiver.warning (ErrorReceiver.java:76)
    at com.sun.tools.xjc.ModelLoader.sanityCheck (ModelLoader.java:176)
    at com.sun.tools.xjc.ModelLoader.load (ModelLoader.java:90)
    at com.sun.tools.xjc.ModelLoader.load (ModelLoader.java:76)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.loadModel (XJC23Mojo.java:50)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute (XJC23Mojo.java:40)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute (XJC23Mojo.java:28)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute (RawXJC2Mojo.java:477)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute (RawXJC2Mojo.java:319)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:210)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:195)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:539)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1136)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635)
    at java.lang.Thread.run (Thread.java:833)

I downgraded to 0.14.0 and specified the jaxb dependency to make it work:

<plugin>
  <groupId>org.jvnet.jaxb2.maven2</groupId>
  <artifactId>maven-jaxb2-plugin</artifactId>
  <version>0.14.0</version>
  <configuration>
	...
  </configuration>
  <executions>
	 ...
  </executions>
  <dependencies>
	<dependency>
		<groupId>org.glassfish.jaxb</groupId>
		<artifactId>jaxb-runtime</artifactId>
		<version>2.3.5</version>
	</dependency>
</dependencies>
</plugin>

@mattrpav mattrpav removed this from the 2.3.6 milestone May 9, 2023
@Ikrao
Copy link

Ikrao commented Jun 1, 2023

Any update on this? I am facing same issue with Java 19 Jaxb 3.0

@Ikrao
Copy link

Ikrao commented Jun 1, 2023

-XtoString

I am also experiencing this exception with JDK 17 and Spring boot 2.7:

[WARNING] Error while parsing schema(s).Location [].
org.xml.sax.SAXParseException: Are you trying to compile WSDL? Support for WSDL is experimental. You may enable it by using the -wsdl option.
    at com.sun.tools.xjc.ErrorReceiver.warning (ErrorReceiver.java:76)
    at com.sun.tools.xjc.ModelLoader.sanityCheck (ModelLoader.java:176)
    at com.sun.tools.xjc.ModelLoader.load (ModelLoader.java:90)
    at com.sun.tools.xjc.ModelLoader.load (ModelLoader.java:76)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.loadModel (XJC23Mojo.java:50)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute (XJC23Mojo.java:40)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute (XJC23Mojo.java:28)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute (RawXJC2Mojo.java:477)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute (RawXJC2Mojo.java:319)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

Do you find any solution for this issue?

@Ikrao
Copy link

Ikrao commented Jun 6, 2023

I've noticed the same exception but all the sources were generated on JDK 17. I've noticed no change after adding

<args>
   <arg>-wsdl</arg>
</args>

Any Solution do you find? I am also facing same issue

@laurentschoelens
Copy link
Collaborator

Hi everyone.
This issue is a duplicate of #247 which is the same as this one but for DTD schemaLanguage
Long story short :
A change has been made (maybe a typo in earlier version of xjc), that made schemaLanguage != XMLSCHEMA complains about DTD / WSDL generating code since it's "experimental".
See : eclipse-ee4j/jaxb-ri@94a5a1f

There's nothing (in my opinion) we can do to get rid of this message (it's just a warning for 'experimental' features that still exists in v4 of xjc, with more generation warning about rng / rnc files) and classes should be just generated fine.

@laurentschoelens
Copy link
Collaborator

laurentschoelens commented Jul 7, 2023

@weberhofer / @yanivnahoum / @dhpalan / @lepus / @DeepanshuRastogi1 / @funnybobde / @Grogdunn / @gadton / @Ikrao / @jbrechbuehl / @ielkhalloufi : do you confirm that classes are well generated ?

@lepus
Copy link

lepus commented Jul 7, 2023

@laurentschoelens I can confirm, classes are well generated.

@DeepanshuRastogi1
Copy link

@laurentschoelens I can also confirm that the classes are generated correctly.

@laurentschoelens
Copy link
Collaborator

Thanks @lepus and @DeepanshuRastogi1
Since it's xjc change, we'll discuss of this this @mattrpav but I think there's nothing we can do about it.
Maybe update documentation ?
Change has been introduced in xjc 2.3.6+ which is used by 0.15.X branch and 2.X branch of this plugin

@yanivnahoum
Copy link

@laurentschoelens I confirm that classes are well generated.

@laurentschoelens
Copy link
Collaborator

Found this issue in jaxb-ri impl that was treated in main : eclipse-ee4j/jaxb-ri#1701
Asked if any backport for 2.3.x branch will be done.

@aprevost
Copy link

Just wanted to +1 this - even though the classes are still generated successfully, having such an error message in our build logs is extremely alarming and is going to raise flags and have to be explained any time a new person joins our team and sees it for the first time. To the point that we're strongly considering reverting to 0.14.0 just to avoid this message.

I'll add a comment on the jaxb-ri issue as well, but if there's any way you can modify the library versions you're using under the hood in this plugin to eliminate this bogus message, it would be appreciated. :)

@laurentschoelens
Copy link
Collaborator

You can still override the dependency of jaxb-ri in the plugin used by adding the dependencies section but the result won't be guaranteed since untested and some bugs had been fixed with upgraded version of jaxb-ri
Hope there'll be a backport of the fix in 2.3.x branch (EE8) of jaxb-ri

@laurentschoelens
Copy link
Collaborator

@aprevost : Lukas is currenlty backporting some fixes into jaxb 2.3.X branch
We should be able to test and validate it with jaxb-tools 2.X branch and then release a fixed version based on latest jaxb-ri

@laurentschoelens laurentschoelens added the bug-external Issue concerns an external dependency label Oct 9, 2023
@aprevost
Copy link

aprevost commented Dec 7, 2023

Thanks for the update @laurentschoelens. As an FYI, we have in fact reverted to 0.14.0 to eliminate the logs, so we are waiting on this fix before we upgrade back to the latest again. :)

@laurentschoelens
Copy link
Collaborator

laurentschoelens commented Dec 8, 2023

@aprevost : if you want to go to the 2.0.9 version jaxb-tools without waiting for 2.0.10 (which will get the fix from jaxb-ri by upgrading to 2.3.9) you can do the following :

  • override the jaxb-xjc dependency in the plugin by setting it to 2.3.9
  • define the following property that will change default value in the next 2.x release of the plugin
    • <disableSystemIdResolution> (or systemn property : maven.xjc2.disableSystemIdResolution) : value = true (since bug is fixed in 2.3.9 of xjc)
    • <addIfExistsToEpisodeSchemaBindings> (or system property : maven.xjc2.addIfExistsToEpisodeSchemaBindings) : value = false (since this is now done natively by xjc in 2.3.9 too)

We are currently working on 4.0.1 version (it should be out by the end of the year) and then go back to 2.0.10 with backports.

@lenaalex
Copy link

lenaalex commented Feb 12, 2024

Hi, I have the same issue with this package maven-jaxb2-plugin:0.15.3 when I migrated to java 17. What was solution?

[INFO] 
[INFO] --- maven-jaxb2-plugin:0.15.3:generate (default) @ vegsok-fiks ---
[INFO] Sources are not up-to-date, XJC will be executed.
[WARNING] Error while parsing schema(s).Location [].
org.xml.sax.SAXParseException: Are you trying to compile WSDL? Support for WSDL is experimental. You may enable it by using the -wsdl option.
    at com.sun.tools.xjc.ErrorReceiver.warning (ErrorReceiver.java:76)
    at com.sun.tools.xjc.ModelLoader.sanityCheck (ModelLoader.java:176)
    at com.sun.tools.xjc.ModelLoader.load (ModelLoader.java:90)
    at com.sun.tools.xjc.ModelLoader.load (ModelLoader.java:76)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.loadModel (XJC23Mojo.java:50)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute (XJC23Mojo.java:40)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute (XJC23Mojo.java:28)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute (RawXJC2Mojo.java:477)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute (RawXJC2Mojo.java:319)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[INFO] Episode file [/home/eleale/Dokumenter/Vegsok/vegsok-felles/vegsok-fiks/target/generated-sources/xjc/META-INF/sun-jaxb.episode] was augmented with if-exists="true" attributes.

@laurentschoelens
Copy link
Collaborator

laurentschoelens commented Feb 12, 2024

Hi @lenaalex
This is due eclipse-ee4j/jaxb-ri#1701
It was fixed in 4.0.4 and 2.3.9 versions of jaxb-ri.
If targeting jaxb 2.3, you should wait for 2.0.10 release of jaxb-tools which will come soon.

This is only a warning (with stacktrace but still a warning) and can be safely ignored by the way.
You can also try to get the latest 2.x release of jaxb-tools and override the xjc dependency to 2.3.9 in the plugin configuration but that would need extra configuration since other things were fixed too in 2.3.9 : see this comment for follow up : #243 (comment)

Please also look at migration guide to get the latest 2.x version

@lenaalex
Copy link

@laurentschoelens I dont quite understand what do u mean? Do I have to upgrade here see photo? Which version of spring boot do I have to use with jaxb-tools and jdk17?
image

@laurentschoelens
Copy link
Collaborator

Are you targeting JAXB 2.3 ? Which version of SpringBoot do you want to use ? Depending of your answer, I'll help you the right way

@lenaalex
Copy link

I would like to use spring boot 3.x.x. with java 17 or 21. When I used maven-jaxb2-plugin.version 0.13.3, classes generated not quite correct and after increased to 0.15.3, I am getting this error. I am really need help from person who knows this package well :-)
image

@laurentschoelens
Copy link
Collaborator

Ok so for SB3, you'll need to go to jaxb-maven-plugin 4.x which already contains the fix.

This would be the plugin configuration :

<plugin>
  <groupId>org.jvnet.jaxb</groupId>
  <artifactId>jaxb-maven-plugin</artifactId>
  <version>4.0.3</version> <!-- latest current available version for JakartaEE10 -->
  <executions>
    <execution>
      <id>generate</id>
      <goals>
        <goal>generate</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <extension>true</extension>
    <args>
      <arg>-wsdl</arg>
      <arg>-Xfluent-api</arg> <!-- see https://github.com/highsource/jaxb-tools/wiki/JAXB2-Fluent-API-Plugin -->
    </args>
    <plugins>
      <plugin>
        <groupId>org.jvnet.jaxb</groupId>
        <artifactId>jaxb-plugins</artifactId>
        <version>4.0.3</version> <!-- same as maven-plugin version -->
      </plugin>
    </plugins>
    <schemaDirectory>${project.basedir}/src/main/resources/wsdl</schemaDirectory>
    <schemaIncludes>
      <include>*.wsdl</include>
    </schemaIncludes>
  </configuration>
</plugin>

@laurentschoelens
Copy link
Collaborator

laurentschoelens commented Feb 12, 2024

The plugin is compatible with JDK17 and JDK21 by the way 😉

@lenaalex
Copy link

Thanks a lot :-) It works now!

@laurentschoelens
Copy link
Collaborator

@weberhofer / @yanivnahoum / @dhpalan / @lepus / @DeepanshuRastogi1 / @funnybobde / @Grogdunn / @gadton / @Ikrao / @jbrechbuehl / @ielkhalloufi / @aprevost : sorry for the spam 😄 This was fixed in v4.0.2 of jaxb-tools

Will also be fixed in v2.0.10

@laurentschoelens laurentschoelens added this to the 2.0.10 milestone Feb 13, 2024
@laurentschoelens laurentschoelens self-assigned this Feb 13, 2024
@laurentschoelens laurentschoelens modified the milestones: 2.0.10, 4.0.2 Feb 13, 2024
@laurentschoelens laurentschoelens linked a pull request Feb 13, 2024 that will close this issue
@laurentschoelens
Copy link
Collaborator

Will be closed in next v2.x release. Fixed by #437

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-external Issue concerns an external dependency
Projects
None yet
Development

Successfully merging a pull request may close this issue.