Open glassfishrobot opened 15 years ago
Reported by mattbishop
drampulla@java.net said: The file schema2.xsd is being written with some schema that is not in the namespace "http://bobj-rs.sap.com/2009/08". I have found that if I added an explicit configuration for all of the namespaces being generated, this error goes away.
This is still a bug in my opinion, but the above workaround may help for a while.
drampulla@java.net said: Just adding self to the CC list.
snajper said: Hi, would you please submit a full testcase project? That helps to get this clarified and fixed (and add to our testsuite so that we don't regress in the future). Thanks in advance.
basiliv said:
I've got the same issue. When I don't define
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
Was assigned to snajper
This issue was imported from java.net JIRA JAXB-676
I have a very simple starter app with one JAXB-annotated bean. I am using maven 2.2.0.
When I define the config section, I get an exception WRT the path to the parent XSD. When I
remove this config section, the schema is generated just fine.
The config section is below, followed by the exception stack trace.
Exception: Note: Writing /Users/mbishop/Projects/rest/bobj-rs/trunk/types/target/generated-schema/bobj- rs.xsd Note: Writing schema2.xsd Problem encountered during annotation processing; see stacktrace below for more information. java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1768) at com.sun.xml.bind.v2.schemagen.Util.getParentUriPath(Util.java:67) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator.calculateRelativePath(XmlSchemaGenerator.java: 1283) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator.calculateRelativePath(XmlSchemaGenerator.java: 1283) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator.calculateRelativePath(XmlSchemaGenerator.java: 1283) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator.calculateRelativePath(XmlSchemaGenerator.java: 1283) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator.calculateRelativePath(XmlSchemaGenerator.java: 1283) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator.calculateRelativePath(XmlSchemaGenerator.java: 1283) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator.calculateRelativePath(XmlSchemaGenerator.java: 1283) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator.calculateRelativePath(XmlSchemaGenerator.java: 1283) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator.calculateRelativePath(XmlSchemaGenerator.java: 1283) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator.calculateRelativePath(XmlSchemaGenerator.java: 1283) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator.relativize(XmlSchemaGenerator.java:1259) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace.writeTo(XmlSchemaGenerator.java: 482) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace.access$600(XmlSchemaGenerator.j ava:341) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator.write(XmlSchemaGenerator.java:322) at com.sun.tools.xjc.api.impl.j2s.JAXBModelImpl.generateSchema(JAXBModelImpl.java:153) at com.sun.tools.jxc.apt.SchemaGenerator$1.process(SchemaGenerator.java:78) at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessor s.java:60) at com.sun.tools.apt.comp.Apt.main(Apt.java:454) at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:448) at com.sun.tools.apt.main.Main.compile(Main.java:1075) at com.sun.tools.apt.main.Main.compile(Main.java:938) at com.sun.tools.apt.Main.processing(Main.java:95) at com.sun.tools.apt.Main.process(Main.java:85) at com.sun.tools.apt.Main.process(Main.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.tools.jxc.AptBasedTask$InternalAptAdapter.execute(AptBasedTask.java:61) at com.sun.tools.jxc.AptBasedTask.compile(AptBasedTask.java:108) at com.sun.tools.jxc.maven2.SchemaGenAdapter.execute(SchemaGenAdapter.java:111) at com.sun.tools.jxc.maven2.SchemaGenMojo.execute(SchemaGenMojo.java:161) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor. java:540) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExe cutor.java:371) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.jav a:332) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [INFO] ------------------------------------------------------------------------ [ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------
Environment
Operating System: All Platform: All
Affected Versions
[2.1.12]