Issue Details (XML | Word | Printable)

Key: JERSEY-1230
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Pavel Bucek
Reporter: mcarre
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
jersey

Troubles to replace generated XSD with a manually written one in automatically generated WADL

Created: 20/Jun/12 06:13 PM   Updated: 31/Jul/12 11:40 AM   Resolved: 31/Jul/12 11:40 AM
Component/s: None
Affects Version/s: 1.12
Fix Version/s: 1.14

Time Tracking:
Not Specified

Tags: xsd wadl contract-first
Participants: mcarre and Pavel Bucek


 Description  « Hide

Hi,

As exposed on this post and as per Pavel's reply, there may be a problem in the way the generated XSD is (or rather, is not) replaced by my manually written XSD in the automatically generated WADL.

To answer Pavel, the message I see in my logs is (full logs below):
INFO: The wadl application already contains a grammars element, we're adding elements of the provided grammars file.

Could you please advise?
(I would be happy to submit a patch/bugfix myself, provided I get some pointers on how things should work and the structure of the project).

Thanks in advance for your help.

M.

Full logs:

2012-06-20 18:39:48.606:INFO:oejs.Server:jetty-8.1.4.v20120524
2012-06-20 18:39:50.157:INFO:oejw.WebInfConfiguration:Extract jar:file:/path/to/rest-service/target/personService-1.0.war!/ to /path/to/rest-service/target/personService-1.0
2012-06-20 18:40:21.235:INFO:oejpw.PlusConfiguration:No Transaction manager found - if your webapp requires one, please configure one.
2012-06-20 18:40:26.220:INFO:oejsh.ContextHandler:started o.m.j.p.JettyWebAppContext{/,file:/path/to/rest-service/target/personService-1.0/},/path/to/rest-service/target/personService-1.0.war
2012-06-20 18:40:26.220:INFO:oejsh.ContextHandler:started o.m.j.p.JettyWebAppContext{/,file:/path/to/rest-service/target/personService-1.0/},/path/to/rest-service/target/personService-1.0.war
2012-06-20 18:40:26.220:INFO:oejsh.ContextHandler:started o.m.j.p.JettyWebAppContext{/,file:/path/to/rest-service/target/personService-1.0/},/path/to/rest-service/target/personService-1.0.war
20 juin 2012 18:40:26 com.sun.jersey.api.core.PackagesResourceConfig init
INFO: Scanning for root resource and provider classes in the packages:
com.mycompany.ws.rest.mapping
com.mycompany.ws.rest.service
20 juin 2012 18:40:26 com.sun.jersey.api.core.ScanningResourceConfig logClasses
INFO: Root resource classes found:
class com.mycompany.ws.rest.service.PersonService
20 juin 2012 18:40:26 com.sun.jersey.api.core.ScanningResourceConfig logClasses
INFO: Provider classes found:
class com.mycompany.ws.rest.mapping.ProtobufMapper$ProtobufMessageBodyWriter
class com.mycompany.ws.rest.mapping.ProtobufMapper$ProtobufMessageBodyReader
20 juin 2012 18:40:26 com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.12 02/15/2012 04:51 PM'
20 juin 2012 18:40:27 com.sun.jersey.api.wadl.config.WadlGeneratorLoader loadWadlGenerator
INFO: Loading wadlGenerator com.sun.jersey.server.wadl.generators.WadlGeneratorApplicationDoc
20 juin 2012 18:40:27 com.sun.jersey.api.wadl.config.WadlGeneratorLoader loadWadlGenerator
INFO: Loading wadlGenerator com.sun.jersey.server.wadl.generators.WadlGeneratorGrammarsSupport
2012-06-20 18:40:28.507:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080
[INFO] Started Jetty Server
20 juin 2012 18:46:09 com.sun.jersey.api.wadl.config.WadlGeneratorLoader loadWadlGenerator
INFO: Loading wadlGenerator com.sun.jersey.server.wadl.generators.WadlGeneratorApplicationDoc
20 juin 2012 18:46:09 com.sun.jersey.api.wadl.config.WadlGeneratorLoader loadWadlGenerator
INFO: Loading wadlGenerator com.sun.jersey.server.wadl.generators.WadlGeneratorGrammarsSupport
20 juin 2012 18:46:10 com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator attachTypes
INFO: Couldn't find JAX-B element for class com.mycompany.ws.rest.model.protobuf.PersonProto$PersonList
20 juin 2012 18:46:10 com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator attachTypes
INFO: Couldn't find JAX-B element for class javax.ws.rs.core.Response
20 juin 2012 18:46:10 com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator attachTypes
INFO: Couldn't find JAX-B element for class javax.ws.rs.core.Response
20 juin 2012 18:46:10 com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator attachTypes
INFO: Couldn't find JAX-B element for class com.mycompany.ws.rest.model.protobuf.PersonProto$Person
20 juin 2012 18:46:10 com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator attachTypes
INFO: Couldn't find JAX-B element for class javax.ws.rs.core.Response
20 juin 2012 18:46:10 com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator attachTypes
INFO: Couldn't find JAX-B element for class com.mycompany.ws.rest.model.protobuf.PersonProto$Person
20 juin 2012 18:46:10 com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator attachTypes
INFO: Couldn't find JAX-B element for class javax.ws.rs.core.Response
20 juin 2012 18:46:10 com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator attachTypes
INFO: Couldn't find JAX-B element for class javax.ws.rs.core.Response
20 juin 2012 18:46:10 com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator attachTypes
INFO: Couldn't find JAX-B element for class com.mycompany.ws.rest.model.protobuf.PersonProto$Person
20 juin 2012 18:46:10 com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator attachTypes
INFO: Couldn't find JAX-B element for class javax.ws.rs.core.Response
20 juin 2012 18:46:10 com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator attachTypes
INFO: Couldn't find JAX-B element for class javax.ws.rs.core.Response
20 juin 2012 18:46:10 com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator attachTypes
INFO: Couldn't find JAX-B element for class javax.ws.rs.core.Response
20 juin 2012 18:46:10 com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator attachTypes
INFO: Couldn't find JAX-B element for class javax.ws.rs.core.Response
20 juin 2012 18:46:10 com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl attachExternalGrammar
INFO: The wadl application already contains a grammars element, we're adding elements of the provided grammars file.



Pavel Bucek added a comment - 31/Jul/12 11:24 AM - edited

1.14-SNAPSHOT should allow you to do this:

public class SampleWadlGeneratorConfig extends WadlGeneratorConfig {

    @Override
    public List<WadlGeneratorDescription> configure() {
        return generator( WadlGeneratorApplicationDoc.class )
                .prop( "applicationDocsStream", "application-doc.xml" )
                .generator( WadlGeneratorGrammarsSupport.class )
                .prop( "grammarsStream", "application-grammars.xml" )
                .prop("overrideGrammars", true)                               // !!!
                .generator( WadlGeneratorResourceDocSupport.class )
                .prop( "resourceDocStream", "resourcedoc.xml" )
                .descriptions();
    }

}

when overrideGrammars is set to true, Jersey generated grammars won't be included in returned WADL.