Skip to main content

com.sdl.sts.MySTSService cannot be cast to javax.servlet.Servlet

38 replies [Last post]
Anonymous

I installed NetBeans7.1.1 and download JAX-WS2.6 and Metro 2.2. I copied
jaxb-api.jar, jaxws-api.jar webservices-api.jar file to jre/lib/endorsed
folder. GlassFish 3.1.2 came with NetBeans7.1.1. I am following Metro User
Guide(P144) to create a third-party STS. When I run my STS project, I am
getting following error message. What could be wrong here?

n-place deployment at C:\NetBeanWork\STSWebApplication\build\web
deploy?DEFAULT=C:\NetBeanWork\STSWebApplication\build\web&name=STSWebApplication&contextroot=/STSWebApplication&force=true
failed on GlassFish Server3.1.2
Error occurred during deployment: Exception while loading the app :
java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException:
org.apache.catalina.LifecycleException: java.lang.ClassCastException:
com.sdl.sts.MySTSService cannot be cast to javax.servlet.Servlet. Please see
server.log for more details.
C:\NetBeanWork\STSWebApplication\nbproject\build-impl.xml:722: The module
has not been deployed.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Glen Mazza

I think I got that problem before--I can't remember but *think* the
solution might be what I listed here under Step #4, "For Step #22"
section: http://www.jroller.com/gmazza/entry/metro_sts_tutorial

HTH,
Glen

On 04/09/2012 12:08 PM, gchoi wrote:
> I installed NetBeans7.1.1 and download JAX-WS2.6 and Metro 2.2. I copied
> jaxb-api.jar, jaxws-api.jar webservices-api.jar file to jre/lib/endorsed
> folder. GlassFish 3.1.2 came with NetBeans7.1.1. I am following Metro User
> Guide(P144) to create a third-party STS. When I run my STS project, I am
> getting following error message. What could be wrong here?
>
> n-place deployment at C:\NetBeanWork\STSWebApplication\build\web
> deploy?DEFAULT=C:\NetBeanWork\STSWebApplication\build\web&name=STSWebApplication&contextroot=/STSWebApplication&force=true
> failed on GlassFish Server3.1.2
> Error occurred during deployment: Exception while loading the app :
> java.lang.IllegalStateException: ContainerBase.addChild: start:
> org.apache.catalina.LifecycleException:
> org.apache.catalina.LifecycleException: java.lang.ClassCastException:
> com.sdl.sts.MySTSService cannot be cast to javax.servlet.Servlet. Please see
> server.log for more details.
> C:\NetBeanWork\STSWebApplication\nbproject\build-impl.xml:722: The module
> has not been deployed.
>
>
>

gchoi

Glen,

I went through your tutorial for
http://www.jroller.com/gmazza/entry/metro_sts_tutorial until step 5-5. That
was great! I was able to get to get away from NetBeans bug.

5.Copy the web.xml and sun-jaxws.xml files located in {user home
directory}/NetBeansProjects/DoubleItSTS/web/WEB-INF/ to the
sts-war/.../WEB-INF folder. In sun-jaxws.xml, remove the /DoubleItSTS/
subfolder from the wsdl attribute (it should just be
WEB-INF/wsdl/DoubleItSTSService.wsdl.)

After that, I continued step 5-6 and failed there. I am not sure how Metro
configured here. I know that metro comes with NetBeans installation, but I
have standlone Metro installed under C:\metro.

C:\gina\DoubleIt\sts-war>mvn clean install tomcat:deploy

Following is debug message. What could be wrong here?

[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project
org.gmazza.blog.metrosts-sample-metro:sts-war:1.0-SNAPSHOT
(C:\gina\DoubleIt\sts-war\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Could not find artifact
org.gmazza.blog.metrosts-sample-metro:metrosts-sample-metro:pom:1.0-SNAPSHOT
and 'parent.relativePath' points at wrong local POM @ line 6, column 12 ->
[Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please
read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2]
http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
C:\gina\DoubleIt\sts-war>mvn -X clean install tomcat:deploy
Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: C:\apache-maven-3.0.4
Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
Java home: C:\Program Files (x86)\Java\jdk1.6.0_24\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from C:\apache-maven-3.0.4\conf\settings.xml
[DEBUG] Reading user settings from C:\Users\gchoi\.m2\settings.xml
[DEBUG] Using local repository at C:\Users\gchoi\.m2\repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for
C:\Users\gchoi\.m2\repository
[INFO] Scanning for projects...
[DEBUG] Could not find metadata
org.gmazza.blog.metrosts-sample-metro:metrosts-sample-metro:1.0-SNAPSHOT/maven-metadata.xml
in local (C:\Users\gchoi\.m2\repository)
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were
encountered while processing the POMs:
[WARNING] 'parent.relativePath' points at
org.gmazza.blog.basic-doubleit:basic-doubleit instead of
org.gmazza.blog.metrosts-sample-metro:metrosts-sample-metro, please verify
your project structure @ line 6, column 12
[FATAL] Non-resolvable parent POM: Could not find artifact
org.gmazza.blog.metrosts-sample-metro:metrosts-sample-metro:pom:1.0-SNAPSHOT
and 'parent.relativePath' points at wrong local POM @ line 6, column 12

at
org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:363)
at
org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:636)
at
org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:585)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:234)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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:597)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[ERROR]
[ERROR] The project
org.gmazza.blog.metrosts-sample-metro:sts-war:1.0-SNAPSHOT
(C:\gina\DoubleIt\sts-war\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Could not find artifact
org.gmazza.blog.metrosts-sample-metro:metrosts-sample-metro:pom:1.0-SNAPSHOT
and 'parent.relativePath' points at wrong local POM @ line 6, column 12 ->
[Help 2]
org.apache.maven.model.resolution.UnresolvableModelException: Could not find
artifact
org.gmazza.blog.metrosts-sample-metro:metrosts-sample-metro:pom:1.0-SNAPSHOT
at
org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:159)
at
org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:813)
at
org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:664)
at
org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:310)
at
org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:232)
at
org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:410)
at
org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:379)
at
org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:343)
at
org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:636)
at
org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:585)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:234)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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:597)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could
not find artifact
org.gmazza.blog.metrosts-sample-metro:metrosts-sample-metro:pom:1.0-SNAPSHOT
at
org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
at
org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
at
org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
at
org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:286)
at
org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:155)
... 22 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not
find artifact
org.gmazza.blog.metrosts-sample-metro:metrosts-sample-metro:pom:1.0-SNAPSHOT
at
org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:528)
... 26 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please
read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2]
http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

Glen Mazza

Hi, you say you have "standlone Metro installed under C:\metro", but if
you're using Maven you don't need to download software packages (nice to
though to get to the samples if you wish), Maven will download the
necessary dependencies for you and store them in the local repository it
creates on your machine.

The Maven error is indicating that the sts-war's pom.xml file (in a
subdirectory under the root project) is not pointing correctly to the
parent pom.xml file (in the base directory of the sample). At the top
of this tutorial I wrote: "For this example, I've changed the Maven
groupId and artifactId of the top-level pom to
|org.gmazza.blog.metrosts-sample-metro| and |metrosts-sample-metro|,
respectively." (I did that so it doesn't conflict with the basic
WSDL-first tutorial in case you wish to have both projects running
separately and loaded in your IDE.)

I'll clarify step #2 of the Metro STS tutorial. In the meantime, you'll
need to change the groupId and artifactId in the pom.xml files of the
original DoubleIt tutorial in all the poms for the sample to work.
I.e., in the sts-war (which is good as-is):

org.gmazza.blog.metrosts-sample-metro
metrosts-sample-metro
1.0-SNAPSHOT

That groupId and artifactId you see above is the one that needs to be in
all the other pom.xml files.

Regards,
Glen

On 04/10/2012 07:17 PM, gchoi wrote:
> Glen,
>
> I went through your tutorial for
> http://www.jroller.com/gmazza/entry/metro_sts_tutorial until step 5-5. That
> was great! I was able to get to get away from NetBeans bug.
>
> 5.Copy the web.xml and sun-jaxws.xml files located in {user home
> directory}/NetBeansProjects/DoubleItSTS/web/WEB-INF/ to the
> sts-war/.../WEB-INF folder. In sun-jaxws.xml, remove the /DoubleItSTS/
> subfolder from the wsdl attribute (it should just be
> WEB-INF/wsdl/DoubleItSTSService.wsdl.)
>
> After that, I continued step 5-6 and failed there. I am not sure how Metro
> configured here. I know that metro comes with NetBeans installation, but I
> have standlone Metro installed under C:\metro.
>
> C:\gina\DoubleIt\sts-war>mvn clean install tomcat:deploy
>
> Following is debug message. What could be wrong here?
>
> [INFO] Scanning for projects...
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]
> [ERROR] The project
> org.gmazza.blog.metrosts-sample-metro:sts-war:1.0-SNAPSHOT
> (C:\gina\DoubleIt\sts-war\pom.xml) has 1 error
> [ERROR] Non-resolvable parent POM: Could not find artifact
> org.gmazza.blog.metrosts-sample-metro:metrosts-sample-metro:pom:1.0-SNAPSHOT
> and 'parent.relativePath' points at wrong local POM @ line 6, column 12 ->
> [Help 2]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
> switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions, please
> read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
> [ERROR] [Help 2]
> http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
> C:\gina\DoubleIt\sts-war>mvn -X clean install tomcat:deploy
> Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
> Maven home: C:\apache-maven-3.0.4
> Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
> Java home: C:\Program Files (x86)\Java\jdk1.6.0_24\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
> [INFO] Error stacktraces are turned on.
> [DEBUG] Reading global settings from C:\apache-maven-3.0.4\conf\settings.xml
> [DEBUG] Reading user settings from C:\Users\gchoi\.m2\settings.xml
> [DEBUG] Using local repository at C:\Users\gchoi\.m2\repository
> [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for
> C:\Users\gchoi\.m2\repository
> [INFO] Scanning for projects...
> [DEBUG] Could not find metadata
> org.gmazza.blog.metrosts-sample-metro:metrosts-sample-metro:1.0-SNAPSHOT/maven-metadata.xml
> in local (C:\Users\gchoi\.m2\repository)
> [ERROR] The build could not read 1 project -> [Help 1]
> org.apache.maven.project.ProjectBuildingException: Some problems were
> encountered while processing the POMs:
> [WARNING] 'parent.relativePath' points at
> org.gmazza.blog.basic-doubleit:basic-doubleit instead of
> org.gmazza.blog.metrosts-sample-metro:metrosts-sample-metro, please verify
> your project structure @ line 6, column 12
> [FATAL] Non-resolvable parent POM: Could not find artifact
> org.gmazza.blog.metrosts-sample-metro:metrosts-sample-metro:pom:1.0-SNAPSHOT
> and 'parent.relativePath' points at wrong local POM @ line 6, column 12
>
> at
> org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:363)
> at
> org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:636)
> at
> org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:585)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:234)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
> 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:597)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
> [ERROR]
> [ERROR] The project
> org.gmazza.blog.metrosts-sample-metro:sts-war:1.0-SNAPSHOT
> (C:\gina\DoubleIt\sts-war\pom.xml) has 1 error
> [ERROR] Non-resolvable parent POM: Could not find artifact
> org.gmazza.blog.metrosts-sample-metro:metrosts-sample-metro:pom:1.0-SNAPSHOT
> and 'parent.relativePath' points at wrong local POM @ line 6, column 12 ->
> [Help 2]
> org.apache.maven.model.resolution.UnresolvableModelException: Could not find
> artifact
> org.gmazza.blog.metrosts-sample-metro:metrosts-sample-metro:pom:1.0-SNAPSHOT
> at
> org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:159)
> at
> org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:813)
> at
> org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:664)
> at
> org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:310)
> at
> org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:232)
> at
> org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:410)
> at
> org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:379)
> at
> org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:343)
> at
> org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:636)
> at
> org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:585)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:234)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
> 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:597)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
> at
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
> Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could
> not find artifact
> org.gmazza.blog.metrosts-sample-metro:metrosts-sample-metro:pom:1.0-SNAPSHOT
> at
> org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
> at
> org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
> at
> org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
> at
> org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:286)
> at
> org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:155)
> ... 22 more
> Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not
> find artifact
> org.gmazza.blog.metrosts-sample-metro:metrosts-sample-metro:pom:1.0-SNAPSHOT
> at
> org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:528)
> ... 26 more
> [ERROR]
> [ERROR]
> [ERROR] For more information about the errors and possible solutions, please
> read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
> [ERROR] [Help 2]
> http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
>

gchoi

>Hi, you say you have "standlone Metro installed under C:\metro", but if
you're using Maven you don't >need to download software packages (nice to
though to get to the samples if you wish), Maven will >download the
necessary dependencies for you and store them in the local repository it
creates on your >machine.

Personally I downloaded JAXWS2.2.6 and copied jaxb-api.jar and jaxws-api
into C:\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\endorsed directory. I
also dowload metro2.2 and copied webservices-api.jar to java endored
directory as well. I read some articles from Internet and it says that I
should download most recent version.

In pom.xml under DoubleIt directory I have following conentent. Because of
version 2.1.1 is refernced in pom.xml file, it looks like I am using Metro
2.1.1. Is that correct? If I want to use Metro 2.2, should I change this
version to 2.2?

Metro

true

org.glassfish.metro
webservices-rt
2.1.1

Anyway when I start Tomcat 7.0.27, I am getting following error message. It
looks like that I have version conflict between 2.1 and 2.2. By the way, I
don't have Tomcat endorsed directory.

SEVERE: WSSERVLET11: failed to parse runtime descriptor: [failed to
localize] JAX-WS 2.1 API is loaded from
file:/C:/Program%20Files%20(x86)/Java/jdk1.6.0_24/jre/lib/rt.jar, But JAX-WS
runtime requires JAX-WS 2.2 API. Use the endorsed standards override
mechanism to load JAX-WS 2.2 API ()
com.sun.xml.ws.model.RuntimeModelerException: [failed to localize] JAX-WS
2.1 API is loaded from
file:/C:/Program%20Files%20(x86)/Java/jdk1.6.0_24/jre/lib/rt.jar, But JAX-WS
runtime requires JAX-WS 2.2 API. Use the endorsed standards override
mechanism to load JAX-WS 2.2 API ()
at
com.sun.xml.ws.binding.WebServiceFeatureList.getFeature(WebServiceFeatureList.java:135)
at
com.sun.xml.ws.binding.WebServiceFeatureList.parseAnnotations(WebServiceFeatureList.java:157)
at
com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:182)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:513)
at
com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:257)
at
com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:151)
at
com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:131)
at
com.sun.xml.ws.transport.http.servlet.WSServletContainerInitializer.onStartup(WSServletContainerInitializer.java:65)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)

Gina

Glen Mazza

On 04/11/2012 12:34 PM, gchoi wrote:
>> Hi, you say you have "standlone Metro installed under C:\metro", but if
> you're using Maven you don't>need to download software packages (nice to
> though to get to the samples if you wish), Maven will>download the
> necessary dependencies for you and store them in the local repository it
> creates on your>machine.
>
> Personally I downloaded JAXWS2.2.6 and copied jaxb-api.jar and jaxws-api
> into C:\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\endorsed directory. I
> also dowload metro2.2 and copied webservices-api.jar to java endored
> directory as well. I read some articles from Internet and it says that I
> should download most recent version.

I wouldn't place webservices-api.jar there, it duplicates and would
potentially conflict with the other two jars you have there.

> In pom.xml under DoubleIt directory I have following conentent. Because of
> version 2.1.1 is refernced in pom.xml file, it looks like I am using Metro
> 2.1.1. Is that correct? If I want to use Metro 2.2, should I change this
> version to 2.2?
>

Yes, absolutely.

>
> Metro
>
> true
>
>
>
> org.glassfish.metro
> webservices-rt
> 2.1.1
>
>
>
> Anyway when I start Tomcat 7.0.27, I am getting following error message. It
> looks like that I have version conflict between 2.1 and 2.2. By the way, I
> don't have Tomcat endorsed directory.

I would go ahead and create one: {Tomcat home folder}/endorsed, and
place jaxb-api.jar and jaxws-api.jar there. (That's what I have on my
local machine, and the Metro STS is working there.)

Glen

gchoi

Hi Glen,

Thanks for your prompt response.

>I wouldn't place webservices-api.jar there, it duplicates and would
>potentially conflict with the other two jars you have there.
>I would go ahead and create one: {Tomcat home folder}/endorsed, and
>place jaxb-api.jar and jaxws-api.jar there. (That's what I have on my
>local machine, and the Metro STS is working there.)

After I placed jaxb-api.jar and jaxws-api.jar under {Tomcat home
folder}/endorsed, the problem was resolved. So, currently I have
jaxb-api.jar and jaxws-api.jar under both jre\lib\endorsed and {Tomcat home
folder}/endorsed directory. The reason that we place jaxb-api.jar and
jaxws-api.jar under jre endorsed directory is that we want to most recent
version take effect during run time. But why do we need to place it under
Tomcat endorsed directory as well since application is already compiled and
deloyed. I couldn't think of it is because of compile time needs. Just
curious.

Thanks.
Gina

Glen Mazza

Not compilation, but runtime classloading for the STS and the web
service provider.

You'll need it in jre\lib\endorsed probably just for the web service client.

Glen

On 04/11/2012 02:08 PM, gchoi wrote:
> Hi Glen,
>
> Thanks for your prompt response.
>
>> I wouldn't place webservices-api.jar there, it duplicates and would
>> potentially conflict with the other two jars you have there.
>> I would go ahead and create one: {Tomcat home folder}/endorsed, and
>> place jaxb-api.jar and jaxws-api.jar there. (That's what I have on my
>> local machine, and the Metro STS is working there.)
> After I placed jaxb-api.jar and jaxws-api.jar under {Tomcat home
> folder}/endorsed, the problem was resolved. So, currently I have
> jaxb-api.jar and jaxws-api.jar under both jre\lib\endorsed and {Tomcat home
> folder}/endorsed directory. The reason that we place jaxb-api.jar and
> jaxws-api.jar under jre endorsed directory is that we want to most recent
> version take effect during run time. But why do we need to place it under
> Tomcat endorsed directory as well since application is already compiled and
> deloyed. I couldn't think of it is because of compile time needs. Just
> curious.
>
> Thanks.
> Gina
>

Gina Choi

Glen,

Thanks for your clarification.

I am following your link
http://www.jroller.com/gmazza/entry/metro_usernametoken_profile#MetroUT5
(almost at the end of Step5, sub-step 3), you have following statement. The
xml configuration file still seems from dynamic. I think that you meant to
list from static configuration.

Note if during the client-side login configuration you chose "static" (i.e.,
hardcoded username and password) instead of "dynamic", the ending Policy
section of the above file will be as below. It can be useful to temporarily
switch to static configuration for troubleshooting authentication problems.
...

Glen Mazza

Are you sure? I don't think so--the only difference between dynamic and
static is that the former uses "classname" attribute while the latter
"default".

Glen

On 04/11/2012 03:08 PM, Gina Choi wrote:
> Glen,
>
> Thanks for your clarification.
>
> I am following your link
> http://www.jroller.com/gmazza/entry/metro_usernametoken_profile#MetroUT5
> (almost at the end of Step5, sub-step 3), you have following statement. The
> xml configuration file still seems from dynamic. I think that you meant to
> list from static configuration.
>
>
> Note if during the client-side login configuration you chose "static" (i.e.,
> hardcoded username and password) instead of "dynamic", the ending Policy
> section of the above file will be as below. It can be useful to temporarily
> switch to static configuration for troubleshooting authentication problems.
> ...
>
>
>
>
>
>
> />
>
>
>
>
>

gchoi

Glen,

I am looking at your post
http://www.jroller.com/gmazza/entry/metro_sts_tutorial , but I don't
understand why we have to select myservicekey here since there is no direct
trust relationship between client and service. Shouldn’t we leave this
field blank? By the way, I am using UsernameToken authentication.

Step7 #substep3

◦Select the Truststore button and choose the same clientstore.jks and
keystore password as well as the service provider certificate within the
truststore (myservicekey in this example). You will see the updated
configuration information in Source the Packages/META-INF/DoubleIt.xml file
created by NetBeans.

Thanks.

Gina

Glen Mazza

Click on the hyperlink on this sentence within my tutorial: "Also, the
client will need to have the STS' and WSP's certificates added to its
truststore, as it relies on symmetric binding

to encrypt the SOAP requests it makes to both".

In WS-Trust, the service (WSP) doesn't directly trust the client, but
the client still needs to trust the service (i.e., have its public key
in its truststore).

Glen

On 04/12/2012 04:43 PM, gchoi wrote:
> Glen,
>
> I am looking at your post
> http://www.jroller.com/gmazza/entry/metro_sts_tutorial , but I don't
> understand why we have to select myservicekey here since there is no direct
> trust relationship between client and service. Shouldn’t we leave this
> field blank? By the way, I am using UsernameToken authentication.
>
> Step7 #substep3
>
> ◦Select the Truststore button and choose the same clientstore.jks and
> keystore password as well as the service provider certificate within the
> truststore (myservicekey in this example). You will see the updated
> configuration information in Source the Packages/META-INF/DoubleIt.xml file
> created by NetBeans.
>
> Thanks.
>
> Gina
>
>
>

Gina Choi

Glen,

I would like to confirm one more thing with you. In your
http://www.jroller.com/gmazza/entry/metro_sts_tutorial step3, you have
the following statement. It looks like that when I use UsernameToken with
symmetric binding, the STS struststore doesn’t need client certificate
correct? I will remove client certificate from STS and add service
certificate to the client truststore tomorrow and try again.

If you plan on using X.509 authentication of the WSC to the STS (instead of
UsernameToken), the former's public key will need to be in the latter's
truststore. This can be done with the following commands:

Thanks.

Gina

From: Glen Mazza [mailto:gmazza@talend.com]
Sent: Thursday, April 12, 2012 6:29 PM
To: users@metro.java.net
Subject: Re: com.sdl.sts.MySTSService cannot be cast to javax.servlet.Servlet

Click on the hyperlink on this sentence within my tutorial: "Also, the client
will need to have the STS' and WSP's certificates added to its truststore, as
it relies on symmetric binding
to encrypt the SOAP requests it makes to both".

In WS-Trust, the service (WSP) doesn't directly trust the client, but the
client still needs to trust the service (i.e., have its public key in its
truststore).

Glen

On 04/12/2012 04:43 PM, gchoi wrote:

Glen,

I am looking at your post
http://www.jroller.com/gmazza/entry/metro_sts_tutorial , but I don't
understand why we have to select myservicekey here since there is no direct
trust relationship between client and service. Shouldn’t we leave this
field blank? By the way, I am using UsernameToken authentication.

Step7 #substep3

◦Select the Truststore button and choose the same clientstore.jks and
keystore password as well as the service provider certificate within the
truststore (myservicekey in this example). You will see the updated
configuration information in Source the Packages/META-INF/DoubleIt.xml file
created by NetBeans.

Thanks.

Gina

Glen Mazza

Yes, the STS shouldn't need the client's key if the client is
authenticating via UsernameToken.

Glen

On 04/12/2012 10:04 PM, Gina Choi wrote:
>
> Glen,
>
> I would like to confirm one more thing with you. In your
> http://www.jroller.com/gmazza/entry/metro_sts_tutorial step3, you
> have the following statement. It looks like that when I use
> UsernameToken with symmetric binding, the STS struststore doesn’t need
> client certificate correct? I will remove client certificate from STS
> and add service certificate to the client truststore tomorrow and try
> again.
>
> If you plan on using X.509 authentication of the WSC to the STS
> (instead of UsernameToken), the former's public key will need to be in
> the latter's truststore. This can be done with the following commands:
>
> Thanks.
>
> Gina
>
> *From:*Glen Mazza [mailto:gmazza@talend.com]
> *Sent:* Thursday, April 12, 2012 6:29 PM
> *To:* users@metro.java.net
> *Subject:* Re: com.sdl.sts.MySTSService cannot be cast to
> javax.servlet.Servlet
>
> Click on the hyperlink on this sentence within my tutorial: "Also, the
> client will need to have the STS' and WSP's certificates added to its
> truststore, as it relies on symmetric binding
>
> to encrypt the SOAP requests it makes to both".
>
> In WS-Trust, the service (WSP) doesn't directly trust the client, but
> the client still needs to trust the service (i.e., have its public key
> in its truststore).
>
> Glen
>
> On 04/12/2012 04:43 PM, gchoi wrote:
>
> Glen,
>
> I am looking at your post
> http://www.jroller.com/gmazza/entry/metro_sts_tutorial , but I don't
> understand why we have to select myservicekey here since there is no direct
> trust relationship between client and service. Shouldn’t we leave this
> field blank? By the way, I am using UsernameToken authentication.
>
> Step7 #substep3
>
> ◦Select the Truststore button and choose the same clientstore.jks and
> keystore password as well as the service provider certificate within the
> truststore (myservicekey in this example). You will see the updated
> configuration information in Source the Packages/META-INF/DoubleIt.xml file
> created by NetBeans.
>
> Thanks.
>
> Gina
>
>
>

Gina Choi

Hi Glen,

I was able to run your sts tutorial for both UserNameToken and Mutual
Certificate authentication. It is a very complete tutorial and has all
information that needed. The Only part that I got lost is that the link you
referenced to Metro User Guild was broken. So, if you say follow step 9 -15
of the Metro User Guide, I had to spend some time to find the information
referenced. If you could reference title of that step that would very helpful
for next person. But no matter what it was a great tutorial.

By the way do you have a tutorial for ActAs? Have you ever tried Metro with
ADFS2.0? Do you know if Metro support passive profile? Like SP initiated POST
bindings(it uses browser)? I used OpenSAML implemented that part.

Thanks a lot.

Gina

From: Glen Mazza [mailto:gmazza@talend.com]
Sent: Thursday, April 12, 2012 10:26 PM
To: users@metro.java.net
Subject: Re: com.sdl.sts.MySTSService cannot be cast to javax.servlet.Servlet

Yes, the STS shouldn't need the client's key if the client is authenticating
via UsernameToken.

Glen

On 04/12/2012 10:04 PM, Gina Choi wrote:

Glen,

I would like to confirm one more thing with you. In your
http://www.jroller.com/gmazza/entry/metro_sts_tutorial step3, you have
the following statement. It looks like that when I use UsernameToken with
symmetric binding, the STS struststore doesn’t need client certificate
correct? I will remove client certificate from STS and add service
certificate to the client truststore tomorrow and try again.

If you plan on using X.509 authentication of the WSC to the STS (instead of
UsernameToken), the former's public key will need to be in the latter's
truststore. This can be done with the following commands:

Thanks.

Gina

From: Glen Mazza [mailto:gmazza@talend.com]
Sent: Thursday, April 12, 2012 6:29 PM
To: users@metro.java.net
Subject: Re: com.sdl.sts.MySTSService cannot be cast to javax.servlet.Servlet
Click on the hyperlink on this sentence within my tutorial: "Also, the client
will need to have the STS' and WSP's certificates added to its truststore, as
it relies on symmetric binding
to encrypt the SOAP requests it makes to both".

In WS-Trust, the service (WSP) doesn't directly trust the client, but the
client still needs to trust the service (i.e., have its public key in its
truststore).

Glen

On 04/12/2012 04:43 PM, gchoi wrote:

Glen,

I am looking at your post
http://www.jroller.com/gmazza/entry/metro_sts_tutorial , but I don't
understand why we have to select myservicekey here since there is no direct
trust relationship between client and service. Shouldn’t we leave this
field blank? By the way, I am using UsernameToken authentication.

Step7 #substep3

◦Select the Truststore button and choose the same clientstore.jks and
keystore password as well as the service provider certificate within the
truststore (myservicekey in this example). You will see the updated
configuration information in Source the Packages/META-INF/DoubleIt.xml file
created by NetBeans.

Thanks.

Gina

Glen Mazza

Thanks Gina, I didn't realize there were so many dead links (the Metro
team recently re-did the URLs for their guide.) I fixed them all now.

All I know is on my blog already. :)

Glen

On 04/18/2012 08:32 AM, Gina Choi wrote:
>
> Hi Glen,
>
> I was able to run your sts tutorial for both UserNameToken and Mutual
> Certificate authentication. It is a very complete tutorial and has all
> information that needed. The Only part that I got lost is that the
> link you referenced to Metro User Guild was broken. So, if you say
> follow step 9 -15 of the Metro User Guide, I had to spend some time to
> find the information referenced. If you could reference title of that
> step that would very helpful for next person. But no matter what it
> was a great tutorial.
>
> By the way do you have a tutorial for ActAs? Have you ever tried Metro
> with ADFS2.0? Do you know if Metro support passive profile? Like SP
> initiated POST bindings(it uses browser)? I used OpenSAML implemented
> that part.
>
> Thanks a lot.
>
> Gina
>
> *From:*Glen Mazza [mailto:gmazza@talend.com]
> *Sent:* Thursday, April 12, 2012 10:26 PM
> *To:* users@metro.java.net
> *Subject:* Re: com.sdl.sts.MySTSService cannot be cast to
> javax.servlet.Servlet
>
> Yes, the STS shouldn't need the client's key if the client is
> authenticating via UsernameToken.
>
> Glen
>
> On 04/12/2012 10:04 PM, Gina Choi wrote:
>
> Glen,
>
> I would like to confirm one more thing with you. In your
> http://www.jroller.com/gmazza/entry/metro_sts_tutorial step3, you
> have the following statement. It looks like that when I use
> UsernameToken with symmetric binding, the STS struststore doesn’t need
> client certificate correct? I will remove client certificate from STS
> and add service certificate to the client truststore tomorrow and try
> again.
>
> If you plan on using X.509 authentication of the WSC to the STS
> (instead of UsernameToken), the former's public key will need to be in
> the latter's truststore. This can be done with the following commands:
>
> Thanks.
>
> Gina
>
> *From:* Glen Mazza [mailto:gmazza@talend.com]
> *Sent:* Thursday, April 12, 2012 6:29 PM
> *To:* users@metro.java.net
> *Subject:* Re: com.sdl.sts.MySTSService cannot be cast to
> javax.servlet.Servlet
>
> Click on the hyperlink on this sentence within my tutorial: "Also, the
> client will need to have the STS' and WSP's certificates added to its
> truststore, as it relies on symmetric binding
>
> to encrypt the SOAP requests it makes to both".
>
> In WS-Trust, the service (WSP) doesn't directly trust the client, but
> the client still needs to trust the service (i.e., have its public key
> in its truststore).
>
> Glen
>
> On 04/12/2012 04:43 PM, gchoi wrote:
>
> Glen,
>
> I am looking at your post
> http://www.jroller.com/gmazza/entry/metro_sts_tutorial , but I don't
> understand why we have to select myservicekey here since there is no direct
> trust relationship between client and service. Shouldn’t we leave this
> field blank? By the way, I am using UsernameToken authentication.
>
> Step7 #substep3
>
> ◦Select the Truststore button and choose the same clientstore.jks and
> keystore password as well as the service provider certificate within the
> truststore (myservicekey in this example). You will see the updated
> configuration information in Source the Packages/META-INF/DoubleIt.xml file
> created by NetBeans.
>
> Thanks.
>
> Gina
>
>
>

Gina Choi

Forgot to mention to you. When run for UT and Certificate authentication, I
am seeing following exceptions from Tomcat logs.

Apr 18, 2012 8:06:16 AM com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit
handle

SEVERE: Unsupported Content-Type: application/soap+xml Supported ones are:
[text/xml]

com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type:
application/soap+xml Supported ones are: [text/xml]

at
com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:315)

at
com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:149)

at
com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:361)

at
com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:343)

at
com.sun.xml.ws.transport.http.HttpAdapter.access$400(HttpAdapter.java:99)

at
com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java
:623)

at
com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:263)

at
com.sun.xml.ws.transport.http.servlet.ServletAdapter.invokeAsync(ServletAdapt
er.java:218)

at
com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelega
te.java:159)

at
com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDeleg
ate.java:194)

at
com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:80)

at
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)

at
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationF
ilterChain.java:305)

at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCha
in.java:210)

at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.jav
a:225)

at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.jav
a:169)

at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.
java:472)

at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)

at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)

at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)

at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
118)

at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)

at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Proces
sor.java:999)

at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Abstract
Protocol.java:565)

at
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1
812)

at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.jav
a:886)

at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:90
8)

at java.lang.Thread.run(Thread.java:662)

Apr 18, 2012 8:06:16 AM com.sun.xml.ws.api.message.Packet
populateAddressingHeaders

From: Gina Choi [mailto:gchoi@sdl.com]
Sent: Wednesday, April 18, 2012 8:32 AM
To: users@metro.java.net
Subject: RE: com.sdl.sts.MySTSService cannot be cast to javax.servlet.Servlet

Hi Glen,

I was able to run your sts tutorial for both UserNameToken and Mutual
Certificate authentication. It is a very complete tutorial and has all
information that needed. The Only part that I got lost is that the link you
referenced to Metro User Guild was broken. So, if you say follow step 9 -15
of the Metro User Guide, I had to spend some time to find the information
referenced. If you could reference title of that step that would very helpful
for next person. But no matter what it was a great tutorial.

By the way do you have a tutorial for ActAs? Have you ever tried Metro with
ADFS2.0? Do you know if Metro support passive profile? Like SP initiated POST
bindings(it uses browser)? I used OpenSAML implemented that part.

Thanks a lot.

Gina

From: Glen Mazza [mailto:gmazza@talend.com]
Sent: Thursday, April 12, 2012 10:26 PM
To: users@metro.java.net
Subject: Re: com.sdl.sts.MySTSService cannot be cast to javax.servlet.Servlet

Yes, the STS shouldn't need the client's key if the client is authenticating
via UsernameToken.

Glen

On 04/12/2012 10:04 PM, Gina Choi wrote:

Glen,

I would like to confirm one more thing with you. In your
http://www.jroller.com/gmazza/entry/metro_sts_tutorial step3, you have
the following statement. It looks like that when I use UsernameToken with
symmetric binding, the STS struststore doesn’t need client certificate
correct? I will remove client certificate from STS and add service
certificate to the client truststore tomorrow and try again.

If you plan on using X.509 authentication of the WSC to the STS (instead of
UsernameToken), the former's public key will need to be in the latter's
truststore. This can be done with the following commands:

Thanks.

Gina

From: Glen Mazza [mailto:gmazza@talend.com]
Sent: Thursday, April 12, 2012 6:29 PM
To: users@metro.java.net
Subject: Re: com.sdl.sts.MySTSService cannot be cast to javax.servlet.Servlet
Click on the hyperlink on this sentence within my tutorial: "Also, the client
will need to have the STS' and WSP's certificates added to its truststore, as
it relies on symmetric binding
to encrypt the SOAP requests it makes to both".

In WS-Trust, the service (WSP) doesn't directly trust the client, but the
client still needs to trust the service (i.e., have its public key in its
truststore).

Glen

On 04/12/2012 04:43 PM, gchoi wrote:

Glen,

I am looking at your post
http://www.jroller.com/gmazza/entry/metro_sts_tutorial , but I don't
understand why we have to select myservicekey here since there is no direct
trust relationship between client and service. Shouldn’t we leave this
field blank? By the way, I am using UsernameToken authentication.

Step7 #substep3

◦Select the Truststore button and choose the same clientstore.jks and
keystore password as well as the service provider certificate within the
truststore (myservicekey in this example). You will see the updated
configuration information in Source the Packages/META-INF/DoubleIt.xml file
created by NetBeans.

Thanks.

Gina

Gina Choi

Glen Mazza

Gina Choi

Glen Mazza

Gina Choi

Gina Choi

Glen Mazza

"First I tried debugging the client, but that didn't work, so I tried
debugging the WSP" doesn't seem to make sense though. First determine
precisely what you need to debug (where is your problem) -- else you're
probably going to waste a lot of time and effort.

Are you running Tomcat 6 or 7? The CATALINA_OPTS are for the former, I
haven't looked into the latter yet (may be the same, maybe not).

For your client, did you properly import it into your Eclipse IDE using
mvn eclipse:eclipse (see my WSDL-first tutorial for that -- bottom of
Step #5:
http://www.jroller.com/gmazza/entry/web_service_tutorial#WFstep5, with
the config info in the pom.xml changed to make sure you get the
dependency source code) -- that's needed to make sure the libraries are
properly configured when you run the client.

Also, for debugging, I'd recommend running Tomcat as a standalone
application (not as a Windows service if you're doing that).

Glen

On 04/18/2012 03:03 PM, Gina Choi wrote:
>
> First I did “Debug the client”, but somehow I always receive
> URLClassLoader$1.run() line: 202 [local variables unavailable].
>
> So, I tried Debug the WSP.
>
> In your link
> http://www.jroller.com/gmazza/entry/eclipse_debug_web_services, it
> seems to need to make following changes in step3, sub-step1.
>
> From:
>
> export CATALINA_OPTS="-Xdebug
> -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000”
>
> To:
>
> export CATALINA_OPTS="-Xdebug
> -Xrunjdwp:transport=dt_socket,server=y,suspend=n,jpda_address=8000"
>
> After that, when I go through step3:sub-step3, I was getting “failed
> to connect to remote vm. connection refused. connection refused
> connect”. So did following. Of course
>
> I am in Windows environment.
>
>
>
> 1)Open startup.bat(inside the bin folder of tomcat) and search for
> call "%EXECUTABLE%" start %CMD_LINE_ARGS%. It’s at the end of the
> file. Replace this with call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%
> (mind the spaces, better copy and paste).
>
> 2)Save the changes and start the tomcat server using its startup.bat
> file. The first line appearing on the server window should be
> "Listening for transport dt_socket at address: 8000. This indicates
> that all is well.
>
> I verified “Listening for transport dt_socket at address: 8000” and
> executed Client to debug the WSP, but I still get following message
> when debug. What local variables does it try to read?
>
> URLClassLoader$1.run() line: 202 [local variables unavailable]
>
> Gina
>
> *From:*Glen Mazza [mailto:gmazza@talend.com]
> *Sent:* Wednesday, April 18, 2012 12:59 PM
> *To:* users@metro.java.net
> *Subject:* Re: com.sdl.sts.MySTSService cannot be cast to
> javax.servlet.Servlet
>
> Be sure you know what you want to debug first -- the WSC, WSP, or STS

ss400

If you dig through the source code by default Metro tries to use 1.2 and then
1.1 for MEX calls

You can use ?wsdl to prevent MEX calls until it's fixed

DefaultSTSIssuedTokenConfiguration config = new
DefaultSTSIssuedTokenConfiguration(
STSIssuedTokenConfiguration.PROTOCOL_13,
stsEndpoint,
stsWSDLLocation,
stsServiceName,
stsPortName,
stsNamespace);

or through client config file:

Gina Choi

Hi SS400,

Content of my PreconfiguredSTS is as follow. If I take your first option
using DefaultSTSIssuedTokenConfiguration, can I comment out whole
element?

I comment out tag from my client configuration file and
added following code in my client.

public class WSClient {

private static final String stsEndpoint =
"http://localhost:8088/DoubleItSTS/DoubleItSTSService";
private static final String stsWSDLLocation =
"http://localhost:8088/DoubleItSTS/DoubleItSTSService?wsdl";
private static final String stsServiceName ="DoubleItSTSService";
private static final String stsPortName = "IDoubleItSTSService_Port";
private static final String stsNamespace = "http://tempuri.org/";

public static void main (String[] args) {

DefaultSTSIssuedTokenConfiguration stsConfig = new
DefaultSTSIssuedTokenConfiguration(
STSIssuedTokenConfiguration.PROTOCOL_13,
stsEndpoint,
stsWSDLLocation,
stsServiceName,
stsPortName,
stsNamespace);

Then I am getting following error message when I run client. Why does it
complain even I set both stsEndpoint and stsWSDLLocation through
DefaultSTSIssuedTokenConfiguration?

SEVERE: WST0029:STS location could not be obtained from either IssuedToken or
from client configuration for accessing the service
http://localhost:8088/doubleit/services/doubleit.
Exception in thread "main" javax.xml.ws.WebServiceException: WST0029:STS
location could not be obtained from either IssuedToken or from client
configuration for accessing the service
http://localhost:8088/doubleit/services/doubleit.
at
com.sun.xml.ws.security.trust.impl.TrustPluginImpl.process(TrustPluginImpl.ja
va:166)

Thanks.

Gina

Gina Choi

Glen,

>Click on the hyperlink on this sentence within my tutorial: "Also, the
client will need to have the STS' and WSP's certificates added to its
truststore, as it relies on symmetric binding
to encrypt the SOAP >requests it makes to both".

>In WS-Trust, the service (WSP) doesn't directly trust the client, but the
client still needs to trust the service (i.e., have its public key in its
truststore).

Thanks for clarification. The link that you referenced was very helpful. I
read your blog http://www.jroller.com/gmazza/entry/metro_sts_tutorial again.
The following line at the end of step#3 kind of not clear. It sounds like
that we need to add client certificate in the service’s(Service Provider?)
truststore to do message-layer encryption. Shouldn’t be opposite here?

Since the service does not directly trust the client (the purpose for our use
of the STS to begin with), we will not add the client's public certificate to
the service's truststore as normally done
with message-layer
encryption.

Thanks.

Gina

From: Glen Mazza [mailto:gmazza@talend.com]
Sent: Thursday, April 12, 2012 6:29 PM
To: users@metro.java.net
Subject: Re: com.sdl.sts.MySTSService cannot be cast to javax.servlet.Servlet

Click on the hyperlink on this sentence within my tutorial: "Also, the client
will need to have the STS' and WSP's certificates added to its truststore, as
it relies on symmetric binding
to encrypt the SOAP requests it makes to both".

In WS-Trust, the service (WSP) doesn't directly trust the client, but the
client still needs to trust the service (i.e., have its public key in its
truststore).

Glen

On 04/12/2012 04:43 PM, gchoi wrote:

Glen,

I am looking at your post
http://www.jroller.com/gmazza/entry/metro_sts_tutorial , but I don't
understand why we have to select myservicekey here since there is no direct
trust relationship between client and service. Shouldn’t we leave this
field blank? By the way, I am using UsernameToken authentication.

Step7 #substep3

◦Select the Truststore button and choose the same clientstore.jks and
keystore password as well as the service provider certificate within the
truststore (myservicekey in this example). You will see the updated
configuration information in Source the Packages/META-INF/DoubleIt.xml file
created by NetBeans.

Thanks.

Gina

Glen Mazza

As I used the term, "Message-layer encryption" refers to the X.509 Token
Profile of WS-Security (separate blog entry that "normally done" pointed
to), a much simpler use case where the client and service have a mutual
trust relationship with no STS or WS-Trust in use. Since you're using
WS-Trust, the service does not need the client's key in its truststore,
as it's relying on the STS instead to validate the client.

Glen

On 04/12/2012 07:11 PM, Gina Choi wrote:
>
> Glen,
>
> >Click on the hyperlink on this sentence within my tutorial: "Also,
> the client will need to have the STS' and WSP's certificates added to
> its truststore, as it relies on symmetric binding
>
> to encrypt the SOAP >requests it makes to both".
>
> >In WS-Trust, the service (WSP) doesn't directly trust the client, but
> the client still needs to trust the service (i.e., have its public key
> in its truststore).
>
> Thanks for clarification. The link that you referenced was very
> helpful. I read your blog
> http://www.jroller.com/gmazza/entry/metro_sts_tutorial again. The
> following line at the end of step#3 kind of not clear. It sounds like
> that we need to add client certificate in the service’s(Service
> Provider?) truststore to do message-layer encryption. Shouldn’t be
> opposite here?
>
> Since the service does not directly trust the client (the purpose for
> our use of the STS to begin with), we will not add the client's public
> certificate to the service's truststore as normally done
> with
> message-layer encryption.
>
> Thanks.
>
> Gina
>
> *From:*Glen Mazza [mailto:gmazza@talend.com]
> *Sent:* Thursday, April 12, 2012 6:29 PM
> *To:* users@metro.java.net
> *Subject:* Re: com.sdl.sts.MySTSService cannot be cast to
> javax.servlet.Servlet
>
> Click on the hyperlink on this sentence within my tutorial: "Also, the
> client will need to have the STS' and WSP's certificates added to its
> truststore, as it relies on symmetric binding
>
> to encrypt the SOAP requests it makes to both".
>
> In WS-Trust, the service (WSP) doesn't directly trust the client, but
> the client still needs to trust the service (i.e., have its public key
> in its truststore).
>
> Glen
>
> On 04/12/2012 04:43 PM, gchoi wrote:
>
> Glen,
>
> I am looking at your post
> http://www.jroller.com/gmazza/entry/metro_sts_tutorial , but I don't
> understand why we have to select myservicekey here since there is no direct
> trust relationship between client and service. Shouldn’t we leave this
> field blank? By the way, I am using UsernameToken authentication.
>
> Step7 #substep3
>
> ◦Select the Truststore button and choose the same clientstore.jks and
> keystore password as well as the service provider certificate within the
> truststore (myservicekey in this example). You will see the updated
> configuration information in Source the Packages/META-INF/DoubleIt.xml file
> created by NetBeans.
>
> Thanks.
>
> Gina
>
>
>

Gina Choi

You are right. They looked same to me in the browser, but when I compare both
using NotePad, I see the differences. Sorry for confusion.

Gina

gchoi

I am answering to my previous post. Glassfish metro is being refernced in
Maven project.

The issue with build was artifact difference. Artificat in current project
is org.gmazza.blog.metrosts-sample-metro:metrosts-sample-metro while parents
is org.gmazza.blog.basic-doubleit:basic-doubleit. After I made it same as
parents, I passed build. So, it was pointing parents who do not exist.

gchoi

Hi Glen,

I am following your blog -
http://www.jroller.com/gmazza/entry/web_service_tutorial and I am getting
following error messages when I ran mvn -e clean install tomcat:deploy. I am
using Tomcat 7.0.27. I think that I carefully followed your instructions.

[INFO] BUILD FAILURE
[INFO]

gchoi

I also found this.

[DEBUG] Could not find metadata
org.gmazza.blog.basic-doubleit:service-bundle:1.0-SNAPSHOT/maven-metadata.xml
in local (C:\Users\gchoi\.m2\repository)
[DEBUG] Could not find metadata
org.gmazza.blog.basic-doubleit:service-bundle:1.0-SNAPSHOT/maven-metadata.xml
in local (C:\Users\gchoi\.m2\repository)
[WARNING] The POM for
org.gmazza.blog.basic-doubleit:service-bundle:jar:1.0-SNAPSHOT is missing,
no dependency information available
[DEBUG] org.gmazza.blog.basic-doubleit:service-war:war:1.0-SNAPSHOT
[DEBUG]
org.gmazza.blog.basic-doubleit:service-bundle:jar:1.0-SNAPSHOT:compile
[DEBUG] org.glassfish.metro:webservices-rt:jar:2.1.1:compile
[DEBUG] org.glassfish.metro:webservices-api:jar:2.1.1:compile
[DEBUG] javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO]

gchoi

I am not familair with Maven(just started to use it) to fix this issue. So,
if someone could help me out that would be great. I am using NetBean(7.1.1)
Maven plugin. I removed cache for maven and run mvn clean install
tomcat:deploy on the command line, but I am still getting following errors.

[INFO] BUILD FAILURE
[INFO]

Glen Mazza

In my view, you defeat the purpose of Maven when you use an IDE plugin
for it; Maven should be run from a separate command-line terminal
window, with the IDE purely used for code development, not project building.

If you need initial practice with Maven I'd recommend my intro web
service tutorial:
http://www.jroller.com/gmazza/entry/web_service_tutorial

Glen

On 04/10/2012 03:33 PM, gchoi wrote:
> I am not familair with Maven(just started to use it) to fix this issue. So,
> if someone could help me out that would be great. I am using NetBean(7.1.1)
> Maven plugin. I removed cache for maven and run mvn clean install
> tomcat:deploy on the command line, but I am still getting following errors.
>
>
> [INFO] BUILD FAILURE
> [INFO]

gchoi

My goal running your http://www.jroller.com/gmazza/entry/metro_sts_tutorial,
but prerequisite for metro_sts_tutorial was running
http://www.jroller.com/gmazza/entry/web_service_tutorial first. So, I did
start with http://www.jroller.com/gmazza/entry/web_service_tutorial.

I had two maven installations. One is installed under
C:\apache-maven-3.0.4 and NetBeans plugin was installed under C:\Program
Files (x86)\NetBeans 7.1.1\java\maven. I switched around M2 path for both,
but didn't work.
After your response, I changed M2 path to C:\apache-maven-3.0.4 and
cleaned up cache run it again and this time build for
http://www.jroller.com/gmazza/entry/web_service_tutorial was successful. I
think that you have a magic touch. Thanks. By the way, your posts are well
organized and are very helpful especially for beginners like me. I really
liked the part that generating keystores. I used Cygwin and it does good job
so far.

Gina

Glen Mazza

Glad to be of assistance. :) Starting off on Maven, having IDE
independence in the process, I think is the right way to go.

Glen

On 04/10/2012 04:24 PM, gchoi wrote:
> My goal running your http://www.jroller.com/gmazza/entry/metro_sts_tutorial,
> but prerequisite for metro_sts_tutorial was running
> http://www.jroller.com/gmazza/entry/web_service_tutorial first. So, I did
> start with http://www.jroller.com/gmazza/entry/web_service_tutorial.
>
> I had two maven installations. One is installed under
> C:\apache-maven-3.0.4 and NetBeans plugin was installed under C:\Program
> Files (x86)\NetBeans 7.1.1\java\maven. I switched around M2 path for both,
> but didn't work.
> After your response, I changed M2 path to C:\apache-maven-3.0.4 and
> cleaned up cache run it again and this time build for
> http://www.jroller.com/gmazza/entry/web_service_tutorial was successful. I
> think that you have a magic touch. Thanks. By the way, your posts are well
> organized and are very helpful especially for beginners like me. I really
> liked the part that generating keystores. I used Cygwin and it does good job
> so far.
>
> Gina
>
>

gchoi

I see that this reported as NetBeans P2 bug recently.
https://netbeans.org/bugzilla/show_bug.cgi?id=210144(This is quite important
issue as it makes the metro feature useless. Bumping
priority to P2.). Do we have any alternatives?

Gina

jdg6688
Offline
Joined: 2005-11-02
Points: 0

While this is being fixed, Can you try with stand alone Metro STS as in
the Metro trust samples?
If you down load Metro source (http://java.net/projects/metro/sources).
They are in /samples/ws-trust.
There are multiple samples for different use scenarios. You can check
out basic and the sts built out for it.

On 4/9/2012 10:38 AM, gchoi wrote:
> I see that this reported as NetBeans P2 bug recently.
> https://netbeans.org/bugzilla/show_bug.cgi?id=210144(This is quite important
> issue as it makes the metro feature useless. Bumping
> priority to P2.). Do we have any alternatives?
>
> Gina
>

snajper
Offline
Joined: 2004-10-01
Points: 0

Also, fyi we're working on getting this fixed in NetBeans patch. So stay
tuned,
MartiNG

On 4/9/12 8:38 PM, Jiandong Guo wrote:
> While this is being fixed, Can you try with stand alone Metro STS as
> in the Metro trust samples?
> If you down load Metro source
> (http://java.net/projects/metro/sources). They are in /samples/ws-trust.
> There are multiple samples for different use scenarios. You can check
> out basic and the sts built out for it.
>
>
> On 4/9/2012 10:38 AM, gchoi wrote:
>> I see that this reported as NetBeans P2 bug recently.
>> https://netbeans.org/bugzilla/show_bug.cgi?id=210144(This is quite
>> important
>> issue as it makes the metro feature useless. Bumping
>> priority to P2.). Do we have any alternatives?
>>
>> Gina
>>