Re: How to generate episode file using wadl2java ?
2016-01-21 14:29 GMT+04:00 Sergey Beryozkin: > I see there it checks "OASISCatalogManager.catalog.debug.level" system > property - which is set, if not null, on > org.apache.xml.resolver.CatalogManager, apparently CatalogManager can also > check Catalog.properties file > Should note, for OASISCatalogManager.catalog.debug.level should be valid integer value, or else catalogManager.debug.setDebug(Integer.parseInt(DEBUG_LEVEL)); will simple throw Exception which will not be logged
Re: How to generate episode file using wadl2java ?
2016-01-21 14:29 GMT+04:00 Sergey Beryozkin: > Hi > > Sure, have a look please at > org.apache.cxf.catalog.OASISCatalogManager, this is in the cxf-core module. > > I see there it checks "OASISCatalogManager.catalog.debug.level" system > property - which is set, if not null, on > org.apache.xml.resolver.CatalogManager, apparently CatalogManager can also > check Catalog.properties file > > Perhaps OASISCatalogManager can also be enhanced... > > Re the episodes files - have a look at CustomizationParser in > wadlto/jaxrs, I copied some code there from the wsdl processor, you can see > jaxb bindings are modified with the target namespaces. Perhaps the similar > approach can help with episodes ? > > Cheers, Sergey > -xjc-b is not complete workaround, becouse I cannot reference .episode file located in jar. the only thing i could do is to call maven-dependency-plugin / unpack jar and point to episode file inside it. I have tried different options to -xjc-b to point to episode file, like -xjc-b with -xjcclasspath:/schemas/w3c/w3c.episode or -xjcschemas/w3c/w3c.episode, etc, but no one of them does xjc to resolve file on classpath Btw, classpath:/schemas/w3c/w3c.episode resolves ok, but unfortunately I cannot fix wadl plugin to work with episode files (Error compiling schema from WADL : "file:" is not a part of this compilation.) I have created pom project to address this issue https://github.com/slavb18/test-episodes/blob/master/pom.xml, in case you sometime could address episodes issue
Re: How to generate episode file using wadl2java ?
Hi Sure, have a look please at org.apache.cxf.catalog.OASISCatalogManager, this is in the cxf-core module. I see there it checks "OASISCatalogManager.catalog.debug.level" system property - which is set, if not null, on org.apache.xml.resolver.CatalogManager, apparently CatalogManager can also check Catalog.properties file Perhaps OASISCatalogManager can also be enhanced... Re the episodes files - have a look at CustomizationParser in wadlto/jaxrs, I copied some code there from the wsdl processor, you can see jaxb bindings are modified with the target namespaces. Perhaps the similar approach can help with episodes ? Cheers, Sergey On 21/01/16 05:00, Vjacheslav V. Borisov wrote: I am talking about my progress is slow :) Where can I find xml catalog resolution code in cxf wadl2java ? May be i can patch it to enable debugging info 2016-01-20 18:24 GMT+04:00 Sergey Beryozkin: Well, this is one of those issues which I can not prioritize upon - I've never worked with episodes before, and given that workarounds exists it is hard to prioritize on this arguably minor issue. In many case we can temp stop working on our current commitments (which all of us have) and react fast enough when the issues are easy to tackle or when the issues are indeed critical or patches exist. I'd like to encourage you to look at providing a patch whenever you feel like the progress is slow, you obviously understand what is needed as far as episodes are concerned, so how about looking at JAXRSContainerTest in wadlto/jaxrs, look for the tests which end with "Binding" and see how CXF manages the custom jaxb binding perhaps that can give you an idea how episodes can also be handled nicely Cheers, Sergey
Re: How to generate episode file using wadl2java ?
I am talking about my progress is slow :) Where can I find xml catalog resolution code in cxf wadl2java ? May be i can patch it to enable debugging info 2016-01-20 18:24 GMT+04:00 Sergey Beryozkin: > Well, this is one of those issues which I can not prioritize upon - I've > never worked with episodes before, and given that workarounds exists it is > hard to prioritize on this arguably minor issue. > > In many case we can temp stop working on our current commitments (which > all of us have) and react fast enough when the issues are easy to tackle or > when the issues are indeed critical or patches exist. > > I'd like to encourage you to look at providing a patch whenever you feel > like the progress is slow, you obviously understand what is needed as far > as episodes are concerned, so how about looking at JAXRSContainerTest in > wadlto/jaxrs, look for the tests which end with "Binding" and see how CXF > manages the custom jaxb binding perhaps that can give you an idea how > episodes can also be handled nicely > > Cheers, Sergey >
Re: How to generate episode file using wadl2java ?
2015-11-24 19:48 GMT+04:00 Sergey Beryozkin: > I'll look in detail at one of the existing tests where an external binding > is applied (I recall copying some JAXWS tooling code which modifies the > binding files), and will let you know, a bit later though > > Found temporal workaround to recoginze geenerated episode files (binding files for multiple schemas), i need to supply them to xjc directly, like -xjc-b -xjc${basedir}/src/main/resources/schemas/dictionary/dictionary.episode Altough i cannot refer to classpath for episode file here, still waitng for CXF realization with these bindings. P.S. And playing with oasis catalog file (eg to resolve schemas located in jars), I cannot enable any debug info about applying catalog.xml transformations, this really slows work > >>> Still not sure what to do about WADLToJava actually recognizing those >>> episodes >>> >>> >> I know that maven-jaxb2-plugin works with this generated binding (with >> many >> schemas attached to generation) >> How can I help to investigate the problem? >> >> > > -- > Sergey Beryozkin > > Talend Community Coders > http://coders.talend.com/ >
Re: How to generate episode file using wadl2java ?
Well, this is one of those issues which I can not prioritize upon - I've never worked with episodes before, and given that workarounds exists it is hard to prioritize on this arguably minor issue. In many case we can temp stop working on our current commitments (which all of us have) and react fast enough when the issues are easy to tackle or when the issues are indeed critical or patches exist. I'd like to encourage you to look at providing a patch whenever you feel like the progress is slow, you obviously understand what is needed as far as episodes are concerned, so how about looking at JAXRSContainerTest in wadlto/jaxrs, look for the tests which end with "Binding" and see how CXF manages the custom jaxb binding perhaps that can give you an idea how episodes can also be handled nicely Cheers, Sergey On 20/01/16 13:20, Vjacheslav V. Borisov wrote: 2015-11-24 19:48 GMT+04:00 Sergey Beryozkin: I'll look in detail at one of the existing tests where an external binding is applied (I recall copying some JAXWS tooling code which modifies the binding files), and will let you know, a bit later though Found temporal workaround to recoginze geenerated episode files (binding files for multiple schemas), i need to supply them to xjc directly, like -xjc-b -xjc${basedir}/src/main/resources/schemas/dictionary/dictionary.episode Altough i cannot refer to classpath for episode file here, still waitng for CXF realization with these bindings. P.S. And playing with oasis catalog file (eg to resolve schemas located in jars), I cannot enable any debug info about applying catalog.xml transformations, this really slows work Still not sure what to do about WADLToJava actually recognizing those episodes I know that maven-jaxb2-plugin works with this generated binding (with many schemas attached to generation) How can I help to investigate the problem? -- Sergey Beryozkin Talend Community Coders http://coders.talend.com/ -- Sergey Beryozkin Talend Community Coders http://coders.talend.com/
Re: How to generate episode file using wadl2java ?
Hi I suspect it can be tricky to do, the tool parser manages to group multiple -xjc args together and we can manage it later on, while passing something like "-tMap aaa" to the parser will probably fail the parser validation check (similar to the way passing an episode arg with the file property as a single value confuses XJC). I think the proper fix here is to add the dedicated options to the Maven plugin, I did not have time to keep it up-to-date with all the options which were added to a wadl to java tool, knowing that 'extraarg' can help, but you are right it is worth improving the experience I've opened https://issues.apache.org/jira/browse/CXF-6691 to keep this improvement request tracked, but I've really no time to address it in the short term, but we will get it addressed, please consider creating a patch if it is urgent... Cheers, Sergey On 24/11/15 06:01, Vjacheslav V. Borisov wrote: 2015-11-23 16:32 GMT+04:00 Sergey Beryozkin: I've still decided to do a minor update, so that users can use a single extraarg: https://issues.apache.org/jira/browse/CXF-6690 May be not only XJC compiler argumens, but also wadl2java arguments, like -tMap should be treated equally? -- Sergey Beryozkin Talend Community Coders http://coders.talend.com/
Re: How to generate episode file using wadl2java ?
I'll look in detail at one of the existing tests where an external binding is applied (I recall copying some JAXWS tooling code which modifies the binding files), and will let you know, a bit later though Thanks, Sergey On 24/11/15 05:59, Vjacheslav V. Borisov wrote: 2015-11-23 16:32 GMT+04:00 Sergey Beryozkin: Well, knowing that "-episode sun-jaxb.episode" is expected to be provided to XJC as 2 params, it also becomes obvious how to do it without even changing CXF, -xjc-episode -xjcsun-jaxb.episode Thanks for the solution! Working (with extra plugin to create ${project.build.directory}/classes/META-INF) -xjc-episode -xjc${project.build.directory}/classes/META-INF/sun-jaxb.episode I've still decided to do a minor update, so that users can use a single extraarg: https://issues.apache.org/jira/browse/CXF-6690 Still not sure what to do about WADLToJava actually recognizing those episodes I know that maven-jaxb2-plugin works with this generated binding (with many schemas attached to generation) How can I help to investigate the problem? -- Sergey Beryozkin Talend Community Coders http://coders.talend.com/
Re: How to generate episode file using wadl2java ?
I've really no idea how 'episode' needs to be passed to the XJC compiler, as a single value or as two values, I've never even heard about such an XJC parameter before you started talking about it. Can you tell me what is the proper way to pass it to XJC ? And it is still the case that a -verbose issue you brought in as part of talking about the 'episode' is another issue, so it is up to you if you'd like to pursue that issue further. On 23/11/15 11:25, Vjacheslav V. Borisov wrote: 2015-11-20 14:55 GMT+04:00 Sergey Beryozkin: -xjc-episode sun-jaxb.episode -verbose to systests/jaxrs/pom.xml wadl resource build and I'm seeing [INFO] [INFO] --- cxf-wadl2java-plugin:3.2.0-SNAPSHOT:wadl2java (generate-sources) @ cxf-systests-jaxrs --- wadl2java -d /home/sberyozkin/work/apache/cxf/master/systests/jaxrs/target/generated/src/main/java -p org.apache.cxf.systest.jaxrs.codegen.service -sp http://superbooks=org.apache.cxf.systest.jaxrs.codegen.schema -impl -xjc-episode sun-jaxb.episode -verbose file:/home/sberyozkin/work/apache/cxf/master/systests/jaxrs/src/test/resources/wadl/bookstoreImport.xml and then Caused by: com.sun.tools.xjc.BadCommandLineException: unrecognized parameter -episode sun-jaxb.episode at com.sun.tools.xjc.Options.parseArguments(Options.java:814) The exception is coming from com.sun.tools.xjc. Also extended the test locally and seeing in a debug mode that "-episode sun-jaxb.episode" is passed to XJC. I'm really not sure why '-verbose' (or rather the next etraarg) is not recognized in your case, it may be something to do with some extra space/etc characters confusing the options parser. If you can create a Maven test project reproducing this failure then I will have another look into it But doesn't you already have reproduced this failure? -xjc-episode sun-jaxb.episode - this style is not working. Looks like "-episode sun-jaxb.episode" is passed to XJC as single parameter, and XJC does not recognizes it. P.S. Actually with tMap I also need to place parameter and argument in separate extraargs Like -tMap {namaspace}xsdType=some.java.Clazz But in case of episode paramter "two extraarg" form is not working, for some reason If this is not enough, i will create maven project. -- Sergey Beryozkin Talend Community Coders http://coders.talend.com/
Re: How to generate episode file using wadl2java ?
Well, knowing that "-episode sun-jaxb.episode" is expected to be provided to XJC as 2 params, it also becomes obvious how to do it without even changing CXF, -xjc-episode -xjcsun-jaxb.episode I've still decided to do a minor update, so that users can use a single extraarg: https://issues.apache.org/jira/browse/CXF-6690 Still not sure what to do about WADLToJava actually recognizing those episodes Sergey On 23/11/15 11:56, Sergey Beryozkin wrote: Well looks like I got it fixed after all, something like "-episode sun-jaxb.episode" needs to be further split into two parameters. I'll send a JIRA issue link once I'm done with it Sergey On 23/11/15 11:34, Sergey Beryozkin wrote: I've really no idea how 'episode' needs to be passed to the XJC compiler, as a single value or as two values, I've never even heard about such an XJC parameter before you started talking about it. Can you tell me what is the proper way to pass it to XJC ? And it is still the case that a -verbose issue you brought in as part of talking about the 'episode' is another issue, so it is up to you if you'd like to pursue that issue further. On 23/11/15 11:25, Vjacheslav V. Borisov wrote: 2015-11-20 14:55 GMT+04:00 Sergey Beryozkin: -xjc-episode sun-jaxb.episode -verbose to systests/jaxrs/pom.xml wadl resource build and I'm seeing [INFO] [INFO] --- cxf-wadl2java-plugin:3.2.0-SNAPSHOT:wadl2java (generate-sources) @ cxf-systests-jaxrs --- wadl2java -d /home/sberyozkin/work/apache/cxf/master/systests/jaxrs/target/generated/src/main/java -p org.apache.cxf.systest.jaxrs.codegen.service -sp http://superbooks=org.apache.cxf.systest.jaxrs.codegen.schema -impl -xjc-episode sun-jaxb.episode -verbose file:/home/sberyozkin/work/apache/cxf/master/systests/jaxrs/src/test/resources/wadl/bookstoreImport.xml and then Caused by: com.sun.tools.xjc.BadCommandLineException: unrecognized parameter -episode sun-jaxb.episode at com.sun.tools.xjc.Options.parseArguments(Options.java:814) The exception is coming from com.sun.tools.xjc. Also extended the test locally and seeing in a debug mode that "-episode sun-jaxb.episode" is passed to XJC. I'm really not sure why '-verbose' (or rather the next etraarg) is not recognized in your case, it may be something to do with some extra space/etc characters confusing the options parser. If you can create a Maven test project reproducing this failure then I will have another look into it But doesn't you already have reproduced this failure? -xjc-episode sun-jaxb.episode - this style is not working. Looks like "-episode sun-jaxb.episode" is passed to XJC as single parameter, and XJC does not recognizes it. P.S. Actually with tMap I also need to place parameter and argument in separate extraargs Like -tMap {namaspace}xsdType=some.java.Clazz But in case of episode paramter "two extraarg" form is not working, for some reason If this is not enough, i will create maven project. -- Sergey Beryozkin Talend Community Coders http://coders.talend.com/
Re: How to generate episode file using wadl2java ?
Well looks like I got it fixed after all, something like "-episode sun-jaxb.episode" needs to be further split into two parameters. I'll send a JIRA issue link once I'm done with it Sergey On 23/11/15 11:34, Sergey Beryozkin wrote: I've really no idea how 'episode' needs to be passed to the XJC compiler, as a single value or as two values, I've never even heard about such an XJC parameter before you started talking about it. Can you tell me what is the proper way to pass it to XJC ? And it is still the case that a -verbose issue you brought in as part of talking about the 'episode' is another issue, so it is up to you if you'd like to pursue that issue further. On 23/11/15 11:25, Vjacheslav V. Borisov wrote: 2015-11-20 14:55 GMT+04:00 Sergey Beryozkin: -xjc-episode sun-jaxb.episode -verbose to systests/jaxrs/pom.xml wadl resource build and I'm seeing [INFO] [INFO] --- cxf-wadl2java-plugin:3.2.0-SNAPSHOT:wadl2java (generate-sources) @ cxf-systests-jaxrs --- wadl2java -d /home/sberyozkin/work/apache/cxf/master/systests/jaxrs/target/generated/src/main/java -p org.apache.cxf.systest.jaxrs.codegen.service -sp http://superbooks=org.apache.cxf.systest.jaxrs.codegen.schema -impl -xjc-episode sun-jaxb.episode -verbose file:/home/sberyozkin/work/apache/cxf/master/systests/jaxrs/src/test/resources/wadl/bookstoreImport.xml and then Caused by: com.sun.tools.xjc.BadCommandLineException: unrecognized parameter -episode sun-jaxb.episode at com.sun.tools.xjc.Options.parseArguments(Options.java:814) The exception is coming from com.sun.tools.xjc. Also extended the test locally and seeing in a debug mode that "-episode sun-jaxb.episode" is passed to XJC. I'm really not sure why '-verbose' (or rather the next etraarg) is not recognized in your case, it may be something to do with some extra space/etc characters confusing the options parser. If you can create a Maven test project reproducing this failure then I will have another look into it But doesn't you already have reproduced this failure? -xjc-episode sun-jaxb.episode - this style is not working. Looks like "-episode sun-jaxb.episode" is passed to XJC as single parameter, and XJC does not recognizes it. P.S. Actually with tMap I also need to place parameter and argument in separate extraargs Like -tMap {namaspace}xsdType=some.java.Clazz But in case of episode paramter "two extraarg" form is not working, for some reason If this is not enough, i will create maven project. -- Sergey Beryozkin Talend Community Coders http://coders.talend.com/
Re: How to generate episode file using wadl2java ?
2015-11-23 16:32 GMT+04:00 Sergey Beryozkin: > Well, knowing that "-episode sun-jaxb.episode" is expected to be provided > to XJC as 2 params, it also becomes obvious how to do it without even > changing CXF, > > > -xjc-episode > -xjcsun-jaxb.episode > > > Thanks for the solution! Working (with extra plugin to create ${project.build.directory}/classes/META-INF) -xjc-episode -xjc${project.build.directory}/classes/META-INF/sun-jaxb.episode > I've still decided to do a minor update, so that users can use a single > extraarg: > https://issues.apache.org/jira/browse/CXF-6690 > > Still not sure what to do about WADLToJava actually recognizing those > episodes > I know that maven-jaxb2-plugin works with this generated binding (with many schemas attached to generation) How can I help to investigate the problem?
Re: How to generate episode file using wadl2java ?
2015-11-23 16:32 GMT+04:00 Sergey Beryozkin: > > I've still decided to do a minor update, so that users can use a single > extraarg: > https://issues.apache.org/jira/browse/CXF-6690 May be not only XJC compiler argumens, but also wadl2java arguments, like -tMap should be treated equally?
Re: How to generate episode file using wadl2java ?
Hi I've added -xjc-episode sun-jaxb.episode -verbose to systests/jaxrs/pom.xml wadl resource build and I'm seeing [INFO] [INFO] --- cxf-wadl2java-plugin:3.2.0-SNAPSHOT:wadl2java (generate-sources) @ cxf-systests-jaxrs --- wadl2java -d /home/sberyozkin/work/apache/cxf/master/systests/jaxrs/target/generated/src/main/java -p org.apache.cxf.systest.jaxrs.codegen.service -sp http://superbooks=org.apache.cxf.systest.jaxrs.codegen.schema -impl -xjc-episode sun-jaxb.episode -verbose file:/home/sberyozkin/work/apache/cxf/master/systests/jaxrs/src/test/resources/wadl/bookstoreImport.xml and then Caused by: com.sun.tools.xjc.BadCommandLineException: unrecognized parameter -episode sun-jaxb.episode at com.sun.tools.xjc.Options.parseArguments(Options.java:814) The exception is coming from com.sun.tools.xjc. Also extended the test locally and seeing in a debug mode that "-episode sun-jaxb.episode" is passed to XJC. I'm really not sure why '-verbose' (or rather the next etraarg) is not recognized in your case, it may be something to do with some extra space/etc characters confusing the options parser. If you can create a Maven test project reproducing this failure then I will have another look into it Re the episode containing no schema locations - have a look at the comment at CXF-5647, I pasted there a quote from Oracle docs where it is obvious having these missing attributes is a 'must'. I'm honestly not sure what WADLToJava can do to have those extra bindings applied properly if there's no link between such bindings and the schemas they are supposed to affect, given that WADL may have many schemas... Cheers, Sergey On 19/11/15 07:15, Vjacheslav V. Borisov wrote: i have tried all separators -xjc-episode sun-jaxb.episode -xjc-episode=sun-jaxb.episode -xjc-episode,sun-jaxb.episode -xjc-episode;sun-jaxb.episode all of them issues same error "unrecognized parameter" There is also another case, I have generated episode file by maven-jaxb2-plugin, but generated episode file is unacceptable by wadl2java, becouse it contains bindings from different schemas and not contain schemaLocation= node= attributes.. (same error as in bug https://issues.apache.org/jira/browse/CXF-5647 Error compiling schema from WADL ... is not a part of this compilation) As workaround I have created simple xslt file to convert generated eposide file to "tMap" options for wadl2 java and disabled schema generation (|-noTypes) | |this is not very nice, becouse it needs separate step to convert and alter pom in case of new types added. | | | |Should I create bug to address this issue with inability to generate / use episode file using wadl2java? | 2015-11-18 20:23 GMT+04:00 Sergey Beryozkin>: Hi I wonder if you should do -xjc-episode sun-jaxb.episode something like that, try it please Sergey On 18/11/15 13:52, Vjacheslav V. Borisov wrote: Hi, I am trying to generate episode file for modular schema creation. using this config: -xjc-episode sun-jaxb.episode -verbose However no matter where is place -xjc-episode sun-jaxb.episode I am getting error about next extraarg, in my case it is Caused by: org.apache.cxf.tools.common.toolspec.parser.BadUsageException: Unexpected option: -verbose -- Sergey Beryozkin Talend Community Coders http://coders.talend.com/ -- Sergey Beryozkin Talend Community Coders http://coders.talend.com/
Re: How to generate episode file using wadl2java ?
Hi I wonder if you should do -xjc-episode sun-jaxb.episode something like that, try it please Sergey On 18/11/15 13:52, Vjacheslav V. Borisov wrote: Hi, I am trying to generate episode file for modular schema creation. using this config: -xjc-episode sun-jaxb.episode -verbose However no matter where is place -xjc-episode sun-jaxb.episode I am getting error about next extraarg, in my case it is Caused by: org.apache.cxf.tools.common.toolspec.parser.BadUsageException: Unexpected option: -verbose -- Sergey Beryozkin Talend Community Coders http://coders.talend.com/
Re: How to generate episode file using wadl2java ?
i have tried all separators -xjc-episode sun-jaxb.episode -xjc-episode=sun-jaxb.episode -xjc-episode,sun-jaxb.episode -xjc-episode;sun-jaxb.episode all of them issues same error "unrecognized parameter" There is also another case, I have generated episode file by maven-jaxb2-plugin, but generated episode file is unacceptable by wadl2java, becouse it contains bindings from different schemas and not contain schemaLocation= node= attributes.. (same error as in bug https://issues.apache.org/jira/browse/CXF-5647 Error compiling schema from WADL ... is not a part of this compilation) As workaround I have created simple xslt file to convert generated eposide file to "tMap" options for wadl2 java and disabled schema generation ( -noTypes) this is not very nice, becouse it needs separate step to convert and alter pom in case of new types added. Should I create bug to address this issue with inability to generate / use episode file using wadl2java? 2015-11-18 20:23 GMT+04:00 Sergey Beryozkin: > Hi > > I wonder if you should do > > -xjc-episode sun-jaxb.episode > > > something like that, try it please > > > Sergey > > On 18/11/15 13:52, Vjacheslav V. Borisov wrote: > >> Hi, >> >> I am trying to generate episode file for modular schema creation. using >> this config: >> >> >> -xjc-episode >> >> sun-jaxb.episode >> -verbose >> >> >> >> >> However no matter where is place >> -xjc-episode >> >> sun-jaxb.episode >> >> I am getting error about next extraarg, in my case it is >> >> Caused by: org.apache.cxf.tools.common.toolspec.parser.BadUsageException: >> Unexpected option: -verbose >> >> > > -- > Sergey Beryozkin > > Talend Community Coders > http://coders.talend.com/ > http://www.w3.org/1999/XSL/Transform; version="1.0" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb; xmlns="http://maven.apache.org/POM/4.0.0; exclude-result-prefixes="xsl jaxb"> -tMap