You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by paulbrickell <pa...@evolvedintelligence.com> on 2008/04/22 15:02:28 UTC

Re: Eclipse XSD validation for jaxws.xsd

This is quite painful, but having followed the steps described above eclipse
is now happy that my XML files are valid. But what happens when I deploy my
project?

Hard coded paths are not gonna do it really.

Is there a 'real' solution for this?

Cheers,
Paul B.



kruzty wrote:
> 
> Here is the syntax for reading from a jar file (this would go in the
> Location field of the XML Catalog entry):
> "jar:file:C:/java/apache-cxf-2.0.4-incubator/lib/cxf-2.0.4-incubator.jar!/schemas/configuration/cxf-beans.xsd"
> 
> For this example, Key Type is: Schema Location
> and Key is: http://cxf.apache.org/schemas/configuration/cxf-beans.xsd
> 
> You need to make sure other cxf schemas referenced in your entries are
> entered in the eclipse catalog as well.
> 
> 
> 
> blacksheep wrote:
>> 
>>> >
>>> > gdprao wrote:
>>> >
>>> >> Thanks for the reply.  I have tried the following as this jaxws.xsd
>>> >> is contained in the cxf-2.0-incubator.jar.
>>> >>
>>> >> Window-->Preferences-->Web and XML-->XML Catalog-->User specified
>>> >> Window-->Preferences-->entries
>>> >> -->Add
>>> >>
>>> >> Location: C:\apache-cxf-2.0-incubator\lib\cxf-2.0-incubator.jar
>>> >> Key Type: URI
>>> >> Key: http://cxf.apache.org/schemas/jaxws.xsd
>>> >>
>>> >> It produced the following details:
>>> >>
>>> >> Location:    C:\apache-cxf-2.0-incubator\lib\cxf-2.0-incubator.jar
>>> >> URI:                 file:///C:/apache-cxf-2.0-incubator/lib/cxf-
>>> 2.0-incubator.jar
>>> >> Key Type:    URI
>>> >> Key:         http://cxf.apache.org/schemas/jaxws.xsd
>>> >>
>>> >> Still after this I have the following error:
>>> >>
>>> >> Referenced file contains errors
>>> >> (file:/C:/apache-cxf-2.0-incubator/lib/cxf-2.0-incubator.jar).  For
>>> >> more information, right click on the message and select "Show
>>> Details...
>>> >>
>>> >> My applicationContext file:
>>> >>
>>> >> <beans xmlns="http://www.springframework.org/schema/beans"
>>> >>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> >>       xmlns:jaxws="http://cxf.apache.org/jaxws"
>>> >>       xmlns:soap="http://cxf.apache.org/bindings/soap"
>>> >>       xsi:schemaLocation="
>>> >> http://www.springframework.org/schema/beans
>>> >> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>> >> http://cxf.apache.org/bindings/soap
>>> >> http://cxf.apache.org/schemas/configuration/soap.xsd
>>> >> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
>>> >>
>>> >>     <jaxws:endpoint
>>> >>         id="hello_world_xml_bare"
>>> >>         implementor="demo.hw.server.GreeterImpl"
>>> >>         wsdlLocation="WEB-INF/wsdl/hello_world.wsdl"
>>> >>         address="/hello_world">
>>> >>                 <jaxws:features>
>>> >>                  <bean
>>> class="org.apache.cxf.feature.LoggingFeature"/>
>>> >>                 </jaxws:features>
>>> >>     </jaxws:endpoint>
>>> >>
>>> >> </beans>
>>> >>
>>> >> I am not sure as to how to load the XSD from jar file into the
>>> Eclipse.
>>> >> Please help.
>>> >>
>>> >> Thanks,
>>> >> Durga
>>> >>
>>> >>
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Eclipse-XSD-validation-for-jaxws.xsd-tp11691580p16824053.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Eclipse XSD validation for jaxws.xsd

Posted by Daniel Kulp <dk...@apache.org>.
On Tuesday 22 April 2008, Benson Margulies wrote:
> Dan,
>
> Don't we automatically provide a catalog for this stuff at runtime?
>
> --benson

Yea.  Spring picks them up fine from the spring schemas stuff in 
META-INF.  However, if you load your beans.xml file into eclipse editor 
to edit it as XML and have it set to validate, eclipse needs to find it 
and eclipse doesn't know about the spring stuff in META-INF.   Thus, a 
separate catalog is needed for eclipse if they aren't resolvable online.  
This is the same for any XML editor.


-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: Eclipse XSD validation for jaxws.xsd

Posted by Benson Margulies <bi...@gmail.com>.
Dan,

Don't we automatically provide a catalog for this stuff at runtime?

--benson

Re: Eclipse XSD validation for jaxws.xsd

Posted by Daniel Kulp <dk...@apache.org>.
Well, the other thing that should make it better in the upcoming week or 
two (providing infrastructure actually gets around to it) is that 
cxf.apache.org should actually go live at which point we can add the 
schemas there.  

Dan



On Tuesday 22 April 2008, Ian Roberts wrote:
> paulbrickell wrote:
> > This is quite painful, but having followed the steps described above
> > eclipse is now happy that my XML files are valid. But what happens
> > when I deploy my project?
> >
> > Hard coded paths are not gonna do it really.
> >
> > Is there a 'real' solution for this?
>
> Using a catalog *is* the real solution.  Spring has its own internal
> catalog built from all the META-INF/spring.schemas files it finds on
> the classpath that does the same job at runtime that it uses to
> resolve the http://cxf.apache.org/schemas/... URIs to
> Class.getResource locations (i.e. inside the JAR files).
>
> Ian



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: Eclipse XSD validation for jaxws.xsd

Posted by Brad <br...@javawork.co.uk>.
Paul,

sorry to jump in here but this caught me out originally.

Basically if you leave the schema locations alone everything is fine
in the container as the Spring stuff is already set up to intercept
the scema lookups.

The key thing is to have the catalogue entry set up correctly in
Eclipse so you don't get problems reported. The trick is to match the
Eclipse catalogue entries to the Spring catalogue entries.

For example, taking spring-beans.xsd you want an Eclipse XML catalogue entry of

location:      <path_to_local_copy>
Key type:    Schema Location
Key:           http://www.springframework.org/schema/beans/spring-beans.xsd

This will cause Eclipse to map the key value to your local copy. For
proof of the magic, look at
http://www.springframework.org/schema/beans/spring-beans.xsd. It
doesn't actually exist.

If you look in META-INF/spring.schemas you can see all the required mappings.

Hopefully I got all that right so it will make some sense.

Brad.

On Wed, Apr 23, 2008 at 10:28 AM, paulbrickell
<pa...@evolvedintelligence.com> wrote:
>
>  Ah I see. Thanks for that. I guess it's just a bit of a joining up problem.
>
>  What I still do not understand is how I am going to make this work in all
>  cases.
>
>  To set up the catalog and convince Eclipse that the xml files are valid I
>  have to make a local copy of the schema files, modify them so that they are
>  consistent and then modify my own xml files to point to the local schema
>  files.
>
>  Now Eclipse is happy and I can build my application, but (and this is
>  troubling me) when I deploy my application to Tomcat, for example, the xml
>  files now contain reference to local schema files. Am I going to have to
>  'rewrite' them as I build my war file? That doesn't seem particularly clever
>  to me.
>
>  Most likely I am just missing a point here.
>
>  Cheers,
>  Paul B.
>
>
>
>
>  ianroberts wrote:
>  >
>  > paulbrickell wrote:
>  >> This is quite painful, but having followed the steps described above
>  >> eclipse
>  >> is now happy that my XML files are valid. But what happens when I deploy
>  >> my
>  >> project?
>  >>
>  >> Hard coded paths are not gonna do it really.
>  >>
>  >> Is there a 'real' solution for this?
>  >
>  > Using a catalog *is* the real solution.  Spring has its own internal
>  > catalog built from all the META-INF/spring.schemas files it finds on the
>  > classpath that does the same job at runtime that it uses to resolve the
>  > http://cxf.apache.org/schemas/... URIs to Class.getResource locations
>  > (i.e. inside the JAR files).
>  >
>  > Ian
>  >
>  > --
>  > Ian Roberts               | Department of Computer Science
>  > i.roberts@dcs.shef.ac.uk  | University of Sheffield, UK
>  >
>  >
>
>  --
>  View this message in context: http://www.nabble.com/Eclipse-XSD-validation-for-jaxws.xsd-tp11691580p16833564.html
>
>
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Re: Eclipse XSD validation for jaxws.xsd

Posted by paulbrickell <pa...@evolvedintelligence.com>.
Ah I see. Thanks for that. I guess it's just a bit of a joining up problem.

What I still do not understand is how I am going to make this work in all
cases.

To set up the catalog and convince Eclipse that the xml files are valid I
have to make a local copy of the schema files, modify them so that they are
consistent and then modify my own xml files to point to the local schema
files.

Now Eclipse is happy and I can build my application, but (and this is
troubling me) when I deploy my application to Tomcat, for example, the xml
files now contain reference to local schema files. Am I going to have to
'rewrite' them as I build my war file? That doesn't seem particularly clever
to me.

Most likely I am just missing a point here.

Cheers,
Paul B.


ianroberts wrote:
> 
> paulbrickell wrote:
>> This is quite painful, but having followed the steps described above
>> eclipse
>> is now happy that my XML files are valid. But what happens when I deploy
>> my
>> project?
>> 
>> Hard coded paths are not gonna do it really.
>> 
>> Is there a 'real' solution for this?
> 
> Using a catalog *is* the real solution.  Spring has its own internal 
> catalog built from all the META-INF/spring.schemas files it finds on the 
> classpath that does the same job at runtime that it uses to resolve the 
> http://cxf.apache.org/schemas/... URIs to Class.getResource locations 
> (i.e. inside the JAR files).
> 
> Ian
> 
> -- 
> Ian Roberts               | Department of Computer Science
> i.roberts@dcs.shef.ac.uk  | University of Sheffield, UK
> 
> 

-- 
View this message in context: http://www.nabble.com/Eclipse-XSD-validation-for-jaxws.xsd-tp11691580p16833564.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Eclipse XSD validation for jaxws.xsd

Posted by Ian Roberts <i....@dcs.shef.ac.uk>.
paulbrickell wrote:
> This is quite painful, but having followed the steps described above eclipse
> is now happy that my XML files are valid. But what happens when I deploy my
> project?
> 
> Hard coded paths are not gonna do it really.
> 
> Is there a 'real' solution for this?

Using a catalog *is* the real solution.  Spring has its own internal 
catalog built from all the META-INF/spring.schemas files it finds on the 
classpath that does the same job at runtime that it uses to resolve the 
http://cxf.apache.org/schemas/... URIs to Class.getResource locations 
(i.e. inside the JAR files).

Ian

-- 
Ian Roberts               | Department of Computer Science
i.roberts@dcs.shef.ac.uk  | University of Sheffield, UK