Quantcast
Channel: Metro and JAXB Related Items on Java.net
Viewing all 171 articles
Browse latest View live

wsimport optimization: Maven build can be made faster without wsimport at build time ?

$
0
0

Hi,
I have built a client for calling a webservice. I use the jaxws-maven-plugin to generate the client stubs.
I am able to do a jenkins build and run the client to invoke the web service successfully.

1) Is it possible that
a) I use wsimport and generate the stubs (by running a mvn command manually on my local machine)
b) It generates the source files that I manually checkin into my SVN.
c) When jenkins/hudson does a build, it does not call wsimport goal.
(This will help in having a shorter build time)
2) Is it a good approach ? Do you see any major drawbacks with using this approach?

i.e. the build process is a bit slow because the source stubs are generated during the build time.
Imagine if there are 15 such modules that are to be built in my multi-module project.
Also, it reduces the chances of having permgen (out of memory ) issue.

Any help in this regard is highly appreciated.

Attached is the relevant part of my pom.xml, just for reference

                               <groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>${iportal.jaxws-maven-plugin.version}</version>
<executions>
<execution>
<id>generate-sources-stub</id>
<phase>generate-sources</phase>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<bindingDirectory>src/main/resources</bindingDirectory>
<bindingFiles>
                        <bindingFile>MyBindingfile.xml</bindingFile>
                    </bindingFiles>
<verbose>true</verbose>
<wsdlDirectory>src/main/resources</wsdlDirectory>
<wsdlLocation>Mywsdl.wsdl</wsdlLocation>
<packageName>com.manoj.webservice.stubs</packageName>
</configuration>
 

Metro/WSIT error: SEVERE: WSSTUBE0025: Error in Verifying Security in the Inbound Message. com.sun.xml.wss.impl.WssSoapFaultExce

$
0
0

Getting Metro/WSIT specific error even after upgrade to Metro 2.2.1-1.

Can you do something here?

Detailed log is:
SEVERE: WSSTUBE0025: Error in Verifying Security in the Inbound Message.
com.sun.xml.wss.impl.WssSoapFaultException: Invalid Security Header
at com.sun.xml.wss.impl.SecurableSoapMessage.newSOAPFaultException(SecurableSoapMessage.java:349)
at com.sun.xml.ws.security.opt.impl.incoming.X509BinarySecurityToken.validate(X509BinarySecurityToken.java:187)
at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.handleSecurityHeader(SecurityRecipient.java:423)
at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.cacheHeaders(SecurityRecipient.java:296)
at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.validateMessage(SecurityRecipient.java:245)
at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.verifyInboundMessage(SecurityTubeBase.java:455)
at com.sun.xml.wss.jaxws.impl.SecurityServerTube.processRequest(SecurityServerTube.java:295)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1063)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:979)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:950)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:825)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:380)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:651)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:264)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.invokeAsync(ServletAdapter.java:218)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:159)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:194)
at com.sun.xml.ws.transport.http.servlet.WSSpringServlet.doPost(WSSpringServlet.java:52)
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(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
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(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

WS-Policy and message predicates

$
0
0

Hi,

I just found out that support for WS-Policy was integrated into JAX-WS 2.2. We run a few services that have policies integrated in their WSDL. Java clients never evaluated these up to JAX-WS 2.1. We're currently updating some clients to JAX-WS 2.2. I have a few questions now.

1.) Client-side: (How) can I turn off WS-Policy?
Unfortunately, clients crash with an exception, probably due to a bug in the policy implementation ( https://java.net/jira/browse/JAX_WS-1136 ). I'd like to avoid this by simply deactivating policy support (JAX-WS 2.1 behavior).

2.) Server-side: (How) can I implement a PolicyAssertionValidator that has access to incoming messages?
We use a custom policy assertion that restricts the content of the message body (in addition to the service schema). I tried to implement a custom validator for this, but it seems there's no way to route the message through the handler.

Kind regards,
Christian

JAXB marshal creates unwanted xml elements

$
0
0

I am using xjc from the java SDK to create my JAXB classes from the following xsd file:

<xs:complexType name="customer">
    <xs:sequence>
        <xs:element name="customerinfo" type="information"/>
    </xs:sequence>
</xs:complexType>

<xs:complexType name="information">
        <xs:choice minOccurs="1" maxOccurs="1">
            <xs:element name="infos" type="informations"/>
            <xs:element name="addressline" type="address"/>
            <xs:element name="string" type="xs:string"/>
        </xs:choice>
</xs:complexType>

<xs:complexType name="informations">
        <xs:choice minOccurs="1" maxOccurs="unbounded">
            <xs:element name="infos" type="informations"/>
            <xs:element name="addressline" type="address"/>
            <xs:element name="string" type="xs:string"/>
        </xs:choice>
</xs:complexType>

<xs:complexType name="address"/>

As you can see it has some recursion in it with the "infos" element. When i create my classes with xjc and make an instance of these classes as follows:

ObjectFactory objFact = new ObjectFactory();
    Customer customer = objFact.createCustomer();

    Information infoRoot = objFact.createInformation();
    Information infoInside = objFact.createInformation();
    Information infoInside2 = objFact.createInformation();
    Informations infos = objFact.createInformations();
    Address addressInside = objFact.createAddress();
    infos.getInfosOrAddresslineOrString().add(infoInside);
    infos.getInfosOrAddresslineOrString().add(addressInside);
    infos.getInfosOrAddresslineOrString().add("bla");
    Informations infosInside = objFact.createInformations();
    infosInside.getInfosOrAddresslineOrString().add(infoInside2);
    infoInside.setInfos(infosInside);
    infoRoot.setInfos(infos);

    customer.setCustomerinfo(infoRoot);

    JAXBElement<Customer> jaxbCustomer = objFact.createCustomer(customer);

    JAXBContext jc = JAXBContext.newInstance(Customer.class);
    Marshaller marshaller = jc.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
    marshaller.marshal(jaxbCustomer, System.out);

The output is not as i would expect it to be:

<customer>
<customerinfo>
    <infos>
        <addressline xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="information">
            <infos>
                <addressline xsi:type="information"/>
            </infos>
        </addressline>
        <addressline/>
        <string>bla</string>
    </infos>
</customerinfo>
</customer>

As you can see there is an extra element around the infos object that was never instantiated in the code.
Why is the addressline with type information element added to the marhsalled xml?

java online training

$
0
0

java consists of three types one is j2me,j2se,j2ee these editions is there in java . before that these concepts are the fundamental concepts in the java every programmer learn these concepts before that he cant do that job. java is a object oriented java so that it is platform independent and the robust language moreover people dnt know the complete java because its a ocean , so people know the little bit language and they dnt know the fundamental concepts in these language and moreover many mncs hire the people based on java because the projects on this java are more and the secure language keeps the good security in the software building.http://www.iqonlinetraining.com/core-java-online-training/. If we want to learn the java completely click that link so that we acquire good language in these language

[maven-jaxb2-plugin] can't generate the version internal xsd ?

$
0
0

Hello,

xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
version="3.3.0">

i can't see where generate the version="3.3.0" into generated source class, i want this attribut in comment java..it is possible with the plugin maven ?

example :

// xsd version data = 3.3.0

if attribut is present on the root XS:SCHEMA tag.

thks

Soap service with kerberos security enabled on netbeans 7.3.1

$
0
0

Hello
I've used these two resources to create a sample soap application which uses kerberos authentication.
https://metro.java.net/guide/ch12.html#gfzhh
https://blogs.oracle.com/ashutosh/entry/running_kerberos_token_profile_s...

However I'm facing some issue. In my client servlet when I invoke the method on the port it hangs in there and nothing happens after that. On the netbeans console output I see this line

SEVERE: Kerberos username [max] :

I can't even type my username here in the console. I'm not sure why this is happening.
Another thing to be noticed is max is my system login user and not the client_principle which I've registered on KDC.

Any clues on where I'm going wrong?
I'm using netbeans 7.3.1, with jdk 7.25 on linux redhat 5.5.

How to add copyright javadoc to all classes generated from XSD?

$
0
0

Hello,

I need to add a copyright comment at the top of every class generated by XJC from my XSD schema without adding to each complexType declaration. I tried to different ways without any success. My latest attempt was with a customer JAXB binding as follows:




/* Copyright */ ]]>
![cdata[


This, of course, complains that "name" attribute is missing on element.

Does anybody know if I can accomplish this by modifying either the XSD or the XJB files?

Thanks,

Alec


JAX-WS: xmlstreamreaderexception unexpected xml tag

$
0
0

Hello,

I try to run a JAX-WS Web Service. Therefore I created a Web Service from WSDL with NetBeans 7.3.1. If I run the Web Service I get this error:
Caused by: com.sun.xml.ws.streaming.XMLStreamReaderException: unexpected xml tag. expected {http://example.com/exmaple/example/}, but found {http://exmaple.com/schema/}

I have nowhere in my entire project the string "http://exmaple.com/schema/" also not in the WSDL file. Then I tried to implement a SOAPHandler like this guy recommended:
http://stackoverflow.com/questions/10235145/webservice-response-namespac...

I had to change the code otherwise I get:
Caused by: java.lang.ClassCastException: com.sun.xml.messaging.saaj.soap.impl.TextImpl cannot be cast to javax.xml.soap.SOAPElement

to:

Text textElement = (Text) soapBody.getFirstChild();
SOAPElement oldElement = textElement.getParentElement();

but I run into java.lang.StackOverflowError. Reason is the recursive method:

private void cloneToNewNamespace(Node nodeToRename, SOAPElement parentElement, String prefix) throws SOAPException {
        if (nodeToRename instanceof SOAPElement) {
            SOAPElement elementToRename = (SOAPElement) nodeToRename;
            SOAPElement newElement = parentElement.addChildElement(elementToRename.getElementName().getLocalName(), prefix);
            int tmp = elementToRename.getChildNodes().getLength();

            for (int index = 0; index < elementToRename.getChildNodes().getLength(); index++) {
                Node childNode = elementToRename.getChildNodes().item(index);
                cloneToNewNamespace(childNode, newElement, prefix);
            }
        } else {
            parentElement.addTextNode(nodeToRename.getNodeValue());
        }
    }

I also tried to intercept this issue by adding a javax.xml.ws.handler.LogicalHandler, but there was no chance to change anything.

Another guy posted also this issue in this forum:
https://www.java.net//forum/topic/glassfish/metro-and-jaxb/accessing-web...
but I don't use or have sun-jaxws.xml. So this workaround doesn't work for me.

In this blog somebody gave the advice to annotate bidirectional objects with @Transient:
http://extremejava.tpk.com.br/2010/04/23/mixing-jpa-with-jaxbjaxws/
But I have no bidirectional mapping. So this is also not the solution.

My pom.xml looks like this:

<dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <webResources>
                        <resource>
                            <directory>src</directory>
                            <targetPath>WEB-INF</targetPath>
                            <includes>
                                <include>jax-ws-catalog.xml</include>
                                <include>wsdl/**</include>
                            </includes>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.1</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${endorsed.dir}</outputDirectory>
                            <silent>true</silent>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>javax</groupId>
                                    <artifactId>javaee-endorsed-api</artifactId>
                                    <version>6.0</version>
                                    <type>jar</type>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jvnet.jax-ws-commons</groupId>
                <artifactId>jaxws-maven-plugin</artifactId>
                <version>2.2.1</version>

                <dependencies>
                    <dependency>
                        <groupId>javax.xml</groupId>
                        <artifactId>webservices-api</artifactId>
                        <version>1.4</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>
                    <xnocompile>true</xnocompile>
                    <verbose>true</verbose>
                    <extension>true</extension>
                    <catalog>${basedir}/src/jax-ws-catalog.xml</catalog>
                </configuration>
            </plugin>

I use the following versions:

Glassfish: 3.1.2.2
JAX-WS: JAX-WS RI 2.2.7-b01
JDK: 1.7.25

Can somebody give me a hint to solve this issue?
(I also posted this question on StackOverflow, but didn't get an answer)

Some of the jaxws-rt jars have "promoted" in their name. What does this mean?

$
0
0

In the maven central repo, there are several jaxws-rt jars listed as beta that have "promoted" in their name. What does promoted mean?

WS-MetadataExchange use in JAVA EE (Glassfish-Metro-WSIT) for bootstrapping & Configuration

$
0
0

I am looking for some concrete Java examples about how to use the WS-metadata exchange protocol. I've studied the standard but I do not know ho to actually use it with GlassFish and Metro 2.3

Image:
https://www.dropbox.com/s/sbjt4341hwo41tg/Screenshot%202013-10-11%2017.3...

Where can I find examples of how to use the classes in the com.sun.xml.WS.mex package to manage the initial bootstrapping configuration between client and server ?

Many thanks in advance

original post: http://stackoverflow.com/questions/19322181/ws-metadataexchange-use-in-j...

JAX-WS WSDL validation from client

$
0
0

When my WS client instantiates the generated Service class (MyWS_Service.java), it uses (by default) the URL used during wsimport to obtain the WSDL. Now we do not want to link to the original wsdl (development instance) from our production environment, so we use catalog to redirect the to WSDL stored within the war file. Now we are considering to use the Service constructor which accepts the url and pass a 'null' as this seems to be valid approach (e.g. http://stackoverflow.com/questions/15645154/jax-ws-port-from-wsdl). Now I have several questions to this:
- Is there some documentation regarding the WSDL validations?
- Is validation the only reason the Service class needs the WSDL?
- Does the validation happen only when Service constructor is called or will it happen later during getPort method (when actual url is already known)?
- If validation is really bypassed if to the Service constructor, does it mean that if the actual WS implementation removes some WebMethod from its interface, the client will still work (as long as it is not invoking the method)?

Thank you.

java.lang.IllegalArgumentException: Illegal pattern character 'g'

$
0
0

Hi guys,
i have those problems using and with target xjc but it generate the followuing error :

java.lang.IllegalArgumentException: Illegal pattern character 'g'

the target that I use in my build.xml is this :






















thanks

problem MEX protocol (WS-MetadataExchange implemented in Metro)

$
0
0

Hi, i have a big problem.
First: sorry for my bad english
I want to use the WS-Metadata Exchange for my web services to exchange information such as metadata (XML-Schema, XSD) whit the client.

PLEASE, if you do not see them, please see the attached file: https://dl.dropboxusercontent.com/u/257710/question.txt

I created the file sun-jaxws.xml that contains:

?xml version="1.0" encoding="UTF-8"?>
#
#

#
#

the web.xml contains:

# xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
#
#
com.sun.xml.ws.transport.http.servlet.WSServletContextListener #
#
# mex2.impl.ServerMexUmbGetMetadataResponse
#com.sun.xml.ws.transport.http.servlet.WSServlet
#1
#

#
# mex2.impl.ServerMexUmbGetMetadataResponse
#/ServerMexUmbGetMetadataResponse
#

#
#mex2.impl.ServerMexUmbGetMetadataResponse
#/ServerMexUmbGetMetadataResponse/mex
#

#
#
30
#

#

#

MEXEndpoint.java contained in the library "webservices-osgi.jar" of Glassfish/Metro implement WS-MetadataExchange v1.1
MEXEndpoint, in fragment of code below, accept the GET_REQUEST where GET_REQUEST=http://schemas.xmlsoap.org/ws/2004/09/transfer/Get (See MetadataConstantants.java)
the base implementation, in METRO, it returns only a WSDL file, as far as I understand.

[Note GetMetadata not supported in Metro implementation]

if (action == null) {
// TODO: Better error message
throw new WebServiceException("No wsa:Action specified");
}
else if (action.equals(GET_REQUEST)) {
final String toAddress = headers.getTo(wsaVersion, soapVersion);
return processGetRequest(requestMsg, toAddress, wsaVersion, soapVersion);
}
else if (action.equals(GET_MDATA_REQUEST)) {
String faultText = MessagesMessages.MEX_0017_GET_METADATA_NOT_IMPLEMENTED(GET_MDATA_REQUEST, GET_REQUEST);
logger.warning(faultText);
final Message faultMessage = createFaultMessage(faultText, GET_MDATA_REQUEST,
wsaVersion, soapVersion);
wsContext.getMessageContext().put(BindingProvider.SOAPACTION_URI_PROPERTY, wsaVersion.getDefaultFaultAction());
return faultMessage;
}
// If here, either action is unsupported
// TODO: Better error message
throw new UnsupportedOperationException(action);

but i receive always the same error:

SEVERE:
http://schemas.xmlsoap.org/ws/2004/09/transfer/Get

java.lang.UnsupportedOperationException:
http://schemas.xmlsoap.org/ws/2004/09/transfer/Get

at com.sun.xml.ws.mex.server.MEXEndpoint.invoke(MEXEndpoint.java:135)
at com.sun.xml.ws.mex.server.MEXEndpoint.invoke(MEXEndpoint.java:87)
at com.sun.xml.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:260)
at com.sun.xml.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:159)
at com.sun.xml.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:85)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1136)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1050)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:1019)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:877)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:420)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:687)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:266)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.invokeAsync(ServletAdapter.java:225)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:161)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:197)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:81)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:722)

What i wrong?

Validation of self signed certificate failed

$
0
0

Hi everybody

first i'm gonna explain my problem

i have Metro- WS(java) publish on a tomcat server, and in another project(java) i have the client that consume it, everything works fine..... the thing is, that i have to develop another client in C# to consume the same WS(java)...... i already achieve that the C# client make the call to the method, and i can see in the console of my eclipse that i´m receiving the call, but i get the next exception:

ADVERTENCIA: WSS1541: Could not locate TrustStore, check TrustStore assertion in WSIT configuration
oct 30, 2013 5:04:23 PM com.sun.xml.wss.impl.misc.DefaultCallbackHandler$X509CertificateValidatorImpl validate
GRAVE: WSS1533: fallo en la validación del certificado autofirmado.
oct 30, 2013 5:04:23 PM com.sun.xml.wss.jaxws.impl.SecurityServerTube processRequest
GRAVE: WSSTUBE0025: error al verificar la seguridad del mensaje entrante.
com.sun.xml.wss.impl.WssSoapFaultException: Validation of self signed certificate failed

on my client project in java i have the wsit.xml file taht contains the path to the truststore.jks....

location="c:\llaves5\wsTrustStore.jks" storepass="passstore"
peeralias="certificadoPub" />

but i don´t know how to tell the c# client where to find the truststore.jks

can you point me where to programmatically set the trustStore.jks path so the C# client can find it.

thanks in advance


Schemagen ant task ignoring schema element?

$
0
0

I haven't been involved in any JAXB-related development for many years (search the forum for my old-school posts), but I am now back on it. Everything has been going well, until I tried using the schemagen ant task. This appears to be completely ignoring the schema element. Whether it's in there or not, I get a file with the default name, containing no target namespace. This is JAXB RI 2.2.7. I assume that programmatic schemagen would work better than this, if I went there? TIA...







Generating JAXB classes

$
0
0

Hi,

My xml: http://www.javaexperience.com/catalog.xml

I have an xml for which I want to generate JAXB classes. Unfortunately I don't have access to xsd for this xml.

Could someone please share steps to generate JAXB classes for a xml. What I have tried is:

1) Generate the xsd from this xml using XML to XSD Generater Online - xmlGrid.net

2) Use the Maven JAXB plugin "org.jvnet.jaxb2_commons"

The problem I faced with my approach was that:

Since the xml has root element and one of the child element as same name, the JAXB processor fails on reaching the child "Catalog" tag. Even though it had successfully processed the root "Catalog" tag.

Any pointers would of great help.

How to get wsimport to generate code that validates schema?

$
0
0

We all come at this stuff from a different direction. I have a java server application that communicates via SOAP. Actually it has either web page output, or JSON output, or SOAP. It has a few WSDLs that I constructed myself. It uses some XMLSchema types and this is all working.

I use wsimport to generate sources for accessing the application. This is working.

I want, however, for the client to do some validation. It does not have to validate my custom types. But if a method expects an integer parameter and is given "hello", it seems that making the client smart enough to see the problem should not be impossible.

Is there a flag on wsimport? Do I need to put something in my WSDL? These are the only two inputs to my client generation process, so I am not sure how else to have this happen.

Any suggestions?

XWSSecurityException: WSS1616: The ValueType X509SubjectKeyIdentifier for BST is not supported

$
0
0

I use API Metro 2.3. Why in response to the processing of response I get this error message:

XWSSecurityException: WSS1616: The ValueType http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profi... for BST is not supported

Is this a bug in the API or the wrong answer?
Is Metro 2.3 API does not support ValueType = ".... #X509SubjectKeyIdentifier" ?

Small example of the response:
===============================

<S:Header>
    <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
      <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Id-0001384592114424-ffffffffe90d8474-1">
        <wsu:Created>2013-11-16T08:55:14Z</wsu:Created>
        <wsu:Expires>2013-11-16T09:05:14Z</wsu:Expires>
      </wsu:Timestamp>
      <dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="Id-0001384592114425-ffffffff8984c588-3">
        <dsig:SignedInfo>
          <dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
          <dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
          <dsig:Reference URI="#Id-0001384592114424-ffffffffe90d8474-1">
            <dsig:Transforms>
              <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
            </dsig:Transforms>
            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
            <dsig:DigestValue>weaLQrC ...... vj8=</dsig:DigestValue>
          </dsig:Reference>
          <dsig:Reference URI="#Id-0001384592114425-ffffffff8984c588-2">
            <dsig:Transforms>
              <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
            </dsig:Transforms>
            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
            <dsig:DigestValue>mEOf3 ...... sU+g5g=</dsig:DigestValue>
          </dsig:Reference>
        </dsig:SignedInfo>
        <dsig:SignatureValue>lUB4bl5fN0b8Uko0 .... 5OQDg==</dsig:SignatureValue>
        <dsig:KeyInfo Id="Id-0001384592114425-ffffffff8984c588-4">
          <wsse:SecurityTokenReference xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Id-0001384592114425-ffffffff8984c588-5">
            <wsse:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier"
                                EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">AR ... hF7I=</wsse:KeyIdentifier>
          </wsse:SecurityTokenReference>
        </dsig:KeyInfo>
      </dsig:Signature>
      <wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Id-0001384592114425-ffffffff8984c588-1"
                                ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier"
                                EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">MIIDvzC ... O1t7</wsse:BinarySecurityToken>
    </wsse:Security>
  </S:Header>

WS-Policy:
===========

<Policy Id="wss10_x509_certificates_sign_encrypt">
  <ExactlyOne>
    <All>
      <AsymmetricBinding>
        <Policy>
          <InitiatorToken>
            <Policy>
              <X509Token IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
                <Policy>
                  <WssX509V3Token10/>
                </Policy>
              </X509Token>
            </Policy>
          </InitiatorToken>
          <RecipientToken>
            <Policy>
              <X509Token IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
                <Policy>
                  <WssX509V3Token10/>
                </Policy>
              </X509Token>
            </Policy>
          </RecipientToken>
          <IncludeTimestamp/>
          <OnlySignEntireHeadersAndBody/>
        </Policy>
      </AsymmetricBinding>
      <SignedParts>
        <Body/>
      </SignedParts>
    </All>
  </ExactlyOne>
</Policy>

Erro:GlassFish Server 4.0, deploy, Connection refused: connect, false

$
0
0

Boa noite!

Estou desenvolvendo uma aplicação em java com o netbeans 7.4 e ao executar o projeto o erro acima é impresso na tela e o projeto não é executado.
O que devo fazer para resolver isso?

Good night!

I am developing an application in java with netbeans 7.4 and run the project the error above is printed on the fabric and the design is not executed.
What should I do to solve this?

Viewing all 171 articles
Browse latest View live


Latest Images