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

Using JAXB to unmarshal xml to an existing prepopulated object

$
0
0

Is there a way to use JAXB to unmarshal source XML to an existing JAXB annotated object containing data (an object that i have previously instantiated and populated with data)? So when I call the unmarshal() method it merges the data in the existing pre-popluated object with data in the source XML? It effect, it updates the Java object with data in the source XML.

It appears I can only unmarshal to an new empty object that JAXB instantiates based on the class I pass in the newInstance() method.


JAXB dispatch client parses wsit-client.xml, but policies are not applied?

$
0
0

I'm using a fairly simple PAYLOAD level Dispatch client with some JAXB-generated objects:

Service service = Service.create(SERVICE_QNAME);
service.addPort(PORT_QNAME, SOAPBinding.SOAP11HTTP_BINDING, endpoint.toString());
JAXBContext context = JAXBContext.newInstance(HTNGPaymentCardProxyRQ.class, HTNGPaymentCardProxyRS.class);
Dispatch<Object> dispatch = service.createDispatch(PORT_QNAME, context, Service.Mode.PAYLOAD);
dispatch.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY, WSA_ACTION);
dispatch.getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
HTNGPaymentCardProxyRQ request = new HTNGPaymentCardProxyRQ();
HTNGPaymentCardProxyRS response = (HTNGPaymentCardProxyRS) dispatch.invoke(request);

I have also defined a minimal wsit-client.xml file, similar to the one described here:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
xmlns:wssc="http://schemas.sun.com/2006/03/wss/client"
xmlns:wspp="http://java.sun.com/xml/ns/wsit/policy"
xmlns:tns="http://htng.org/2009B"
targetNamespace="http://htng.org/2009B"&gt;
&lt;wsp:Policy wsu:Id="UsernameToken"&gt;
&lt;wsp:ExactlyOne&gt;
&lt;wsp:All&gt;
&lt;sp:SupportingTokens&gt;
&lt;wsp:Policy&gt;
&lt;sp:UsernameToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient" /&gt;
&lt;/wsp:Policy&gt;
&lt;/sp:SupportingTokens&gt;
&lt;wssc:CallbackHandlerConfiguration wspp:visibility="private"&gt;
&lt;wssc:CallbackHandler name="usernameHandler" classname="com.my.UserPassCallbackHandler" /&gt;
&lt;wssc:CallbackHandler name="passwordHandler" classname="com.my.UserPassCallbackHandler" /&gt;
&lt;/wssc:CallbackHandlerConfiguration&gt;
&lt;/wsp:All&gt;
&lt;/wsp:ExactlyOne&gt;
&lt;/wsp:Policy&gt;
&lt;wsdl:portType name="SecureDataServicePortType" /&gt;
&lt;wsdl:binding name="SecureDataServiceSoap11Binding" type="tns:SecureDataServicePortType"&gt;
&lt;wsp:PolicyReference URI="#UsernameToken" /&gt;
&lt;/wsdl:binding&gt;
&lt;wsdl:service name="SecureDataService"&gt;
&lt;wsdl:port name="SecureDataServiceHttpSoap11Endpoint" binding="tns:SecureDataServiceSoap11Binding" /&gt;
&lt;/wsdl:service&gt;
&lt;/wsdl:definitions&gt;

When my client is run, I can tell that the wsit-client.xml file is successfully parsed because I see the following in my Jetty console:

Nov 19, 2012 2:07:07 PM [com.sun.xml.ws.policy.parser.PolicyConfigParser]  parse
INFO: WSP5018: Loaded WSIT configuration from file: file:/C:/workspace/my-war/target/my-war-1.0.0-SNAPSHOT/WEB-INF/classes/wsit-client.xml.

Additionally, I have verified with a debugger that a com.sun.xml.ws.client.PortInfo object is created and seems to have the proper assertions. However, when I run my client, my UserPassCallbackHandler class is never invoked, and the WS-Security headers are not present in my outbound message.

I read here that this could be caused by sending a payload with the wrong namespace/element name; however, I have verified via Wireshark that the namespace of the body element is correct:

&lt;?xml version='1.0' encoding='UTF-8'?&gt;
&lt;S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"&gt;
&lt;S:Body&gt;
&lt;HTNG_PaymentCardProxyRQ TimeStamp="2012-11-19T14:07:07.088-05:00" Version="1" xmlns="http://htng.org/2009B"&gt;
&lt;POS&gt;
&lt;Source&gt;
&lt;RequestorID ID="Proxy" ID_Context="SourceTransaction" Type="1"/&gt;
&lt;/Source&gt;
&lt;/POS&gt;
&lt;PaymentCards&gt;
&lt;PaymentCard CardNumber="4111111111111111" ExpireDate="1015"&gt;
&lt;CardHolderName&gt;Herp Derp&lt;/CardHolderName&gt;
&lt;EncryptedTrackData&gt;MTM1MzM1MjAyNzA5MQ==&lt;/EncryptedTrackData&gt;
&lt;/PaymentCard&gt;
&lt;/PaymentCards&gt;
&lt;/HTNG_PaymentCardProxyRQ&gt;
&lt;/S:Body&gt;
&lt;/S:Envelope&gt;

Furthermore, if I use the exact same wsit-client.xml file with a client stub generated by wsimport, my UserPassCallbackHandler is properly invoked. This leads me to believe that their may be some bug related to WSIT with a Dispatch client when using JAXB. Can anyone offer any suggestions? None of the WSIT client examples that I have seen use a Dispatch client + JAXB, so it is certainly possible that I have overlooked something important.

GlassFish fails to deploy a JAX-WS service thinking it is a JAXRPC service

$
0
0

I am trying to deploy a Servlet based endpoint using a webservices.xml in GlassFish 3.1.2.2. webservices.xml file could be used to augment or override existing JAX-WS annotations. However, GlassFish throws an error:
Service TimeService seems to be a JAXRPC based web service but without the mandatory WSDL and Mapping file. Deployment cannot proceed.

What surprises me is that several people have reported having this problem since GlassFish 2. However no one seems to have created a Jira and no one from the GlassFish Dev team has attempted to fix it.

Maven project attached. I have also created a JIRA bug report but in my experience, they are usually slow to respond.
http://java.net/jira/browse/GLASSFISH-19366

AttachmentSize
jaxws-servlet-container.zip4.01 KB

Couldn't validate reference with URI #str_

$
0
0

Hello!
I'm in troubles with web service client. I get error while receiving response in checking signature. I'm using Netbeans 7.2, Metro 2.2.1-1 and WLS 10.3. The following error

SEVERE: WSS1721: Validation of Reference with URI #str_BTOeTP2rrfu4HdJ1 failed
Exception in thread "main" javax.xml.ws.WebServiceException: com.sun.xml.wss.impl.WssSoapFaultException: Invalid Security Header

seems to be related to response fragment below

               <dsig:Reference URI="#str_BTOeTP2rrfu4HdJ1">
                  <dsig:Transforms>
                     <dsig:Transform Algorithm="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#STR-Transform">
                        <wsse:TransformationParameters>
                           <dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                        </wsse:TransformationParameters>
                     </dsig:Transform>
                  </dsig:Transforms>
                  <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                  <dsig:DigestValue>OTkKoTvmvVDPUkr5oyCPI3er+M0=</dsig:DigestValue>
               </dsig:Reference>

I have a working client written in JDeveloper and I think my problem is related to Metro.

My question is: could Metro any problems with response from WLS containing such expanded fragment about reference to SecurityTokenReference? How can I resolve this?

WLS handles correctly request and send response back.

JAXB XmlElement - Problem with Arrayfields

$
0
0

Hi,

I have used below getter method level XmlElement annotation for generating xsd from Java class.
@XmlElement(type=Integer.class, required=true)
public int [] getTestArrayInt () { .... }

Generated XML element:

minOccurs's default value is said to be 1. Hence, it is not being displayed here.
But maxOccurs="unbounded" which should be listed for Array elements is missing. Soap UI expects maxOccurs="unbounded" to be present for the array elements. As a result, in Soap UI, this element is not being treated as an array.

When I have removed type=Integer.class from the annotation, I started getting maxOccurs="unbounded" in the XML. But I need this type specially for primitive datatypes. Without type in annotation, minOccurs=1 gets missing for elements which are not required (i.e. required =true is not set).

Can someone please help me in this?

Thanks in advance,
Saumya

Error generating artifacts for the following WSDL

$
0
0

I converted a stand-alone java application into a web service. The deploy on glassfish server is successful. When I test the webservice, I get the following error.

Error generating artifacts for the following WSDL http://localhost:8080/Dec/Dec?WSDL

Possible causes can be invoking https when the application is not configured for security

My java application has 3 classes.

@WebService(serviceName = "Dec")
@Stateless()
public class Dec {
int num;
....
class Data{
public int []a;
public Data(int num) {
a= new int[num];
}
};
class T{
public double sum;
...
};
//operations

};

I tried to convert a java application with a single class to a web service and that worked perfectly.

Please help me with a way out of this issue.

How can I set a Web Service Timeout

$
0
0

Hello,
I am using Metro for Web Services in an applet that needs to gracefully handle network failures. Occasionally the network fails in the middle of a WebService call, which hangs forever waiting for the response from the server (checked a stack dump). The CXF2 stack has properties for connect and read time-outs, but they do not work for Metro. How can I set these time-outs in Metro?
Thanks...

Unknown JAXBContext implementation

$
0
0

Hi,

I get the following exception using jax-ws 2.2.7 combined with jdk 1.7.0_09
when programmatically throwing a SOAPFaultException:

Unknown JAXBContext implementation: class com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl
(see complete stack trace at the end of the message)

The "com.sun.xml.internal.bind" package is part of the bundled jaxb-api in jdk 7, whereas the jax-ws implementation uses
"com.sun.xml.bind" . So there must be a conflict between both jaxb versions.

Putting the jax-ws "jaxb-api.jar" and "jaxws-api.jar" into the java endorsed dir did not help. Same exception occured.

Any request without programmatically throwing an exception works as expected ..

Any hints appreciated.

Complete stack trace:

com.sun.xml.ws.handler.SOAPHandlerProcessor insertFaultMessage
SEVERE: exception while creating fault message in handler chain
com.sun.xml.ws.spi.db.DatabindingException: Unknown JAXBContext implementation: class com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl
at com.sun.xml.ws.spi.db.BindingContextFactory.getJAXBFactory(BindingContextFactory.java:207)
at com.sun.xml.ws.spi.db.BindingContextFactory.create(BindingContextFactory.java:149)
at com.sun.xml.ws.message.jaxb.JAXBMessage.create(JAXBMessage.java:161)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createSOAP11Fault(SOAPFaultBuilder.java:423)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createSOAPFaultMessage(SOAPFaultBuilder.java:165)
at com.sun.xml.ws.api.message.Messages.create(Messages.java:433)
at com.sun.xml.ws.handler.SOAPHandlerProcessor.insertFaultMessage(SOAPHandlerProcessor.java:95)
at com.sun.xml.ws.handler.HandlerProcessor.callHandlersRequest(HandlerProcessor.java:146)
at com.sun.xml.ws.handler.ServerSOAPHandlerTube.callHandlersOnRequest(ServerSOAPHandlerTube.java:138)
at com.sun.xml.ws.handler.HandlerTube.processRequest(HandlerTube.java:127)
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.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(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:192)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:245)
at de.intermediate.components.server.ReloadingClassFilter.doFilter(ReloadingClassFilter.java:44)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
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:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

jax-ws version: 2.2.7
jdk: 1.7.0_09

Thanks,
Alex


xjc generates empty classes but no errors

$
0
0

Hi,
I am trying to generate Jaxb classes for the following xsds.
schema.xsd
-------------------------------------------------------------

<?xml version='1.0' encoding='UTF-8'?>
<xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://myname.schema.com"
targetNamespace="http://myname.schema.com" xmlns:ns2="http://myname.schema2.com">
<xs:import namespace="http://myname.schema2.com"
schemaLocation="schema2.xsd" />

<xs:element name="Person" type="tns:ExtendedEntityType" />
<xs:complexType name="ExtendedEntityType">
<xs:complexContent>
<xs:extension base="tns:EntityType">
<xs:sequence>
<xs:element name="PersonContact" type="xsd:string" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>


<xs:complexType name="EntityType" abstract="true">
<xs:sequence>
<xs:choice minOccurs="0">
<xs:element name="Person" type="xsd:string" />
<xs:element ref="ns2:Person" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xsd:schema>

-------------------------------------------------------------

schema2.xsd
-------------------------------------------------------------

<?xml version='1.0' encoding='UTF-8'?>
<xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://myname.schema2.com"
            targetNamespace="http://myname.schema2.com">
<xs:element name="Person" type="tns:PersonType" />
<xs:complexType name="PersonType">
<xs:sequence>
<xs:choice minOccurs="0">
                   <xs:element name="PersonName" type="xsd:string" />
   <xs:element name="PersonAddress" type="xsd:string"/>
</xs:choice>
  </xs:sequence>
         </xs:complexType>
</xsd:schema>

XJC generated all the classes without any error

On close inpection the class ExendedEntityType.java came empty.
-----------------------------------------

/**
* Java class for ExtendedEntityType complex type.
*
* The following schema fragment specifies the expected content contained within this class.
*
*

 * &lt;complexType name="ExtendedEntityType">
*   &lt;complexContent>
*     &lt;extension base="{http://myname.schema.com}EntityType">
*       &lt;sequence>
*         &lt;element name="PersonContact" type="{http://www.w3.org/2001/XMLSchema}string"/>
*       &lt;/sequence>
*     &lt;/extension>
*   &lt;/complexContent>
* &lt;/complexType>
*

*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ExtendedEntityType")
public class ExtendedEntityType
extends EntityType
{

}

Looks like the EntityType defined schema.xsd has a section

<xs:element name="Person" type="xsd:string" />
<xs:element ref="ns2:Person" />

is the culprit.

I tried with different versions of metro. The last I tried is 2.2.1.1

Any Solution will be appreciated

AttachmentSize
Schema.zip7.99 KB

[wsimport-xjc] Handling Duplicate ObjectFactories

$
0
0

We have a number of common schemas that we've created separate jars for to avoid duplication and inconsistencies during code generation of our WSDLs.

However, wsimport still generates the ObjectFactory classes for these types even though there is an ObjectFactory in the xjc-produced jars.

For one of the schemas, we simply delete the package folders during the build process to avoid the collision, but that's not really the desired route. We'd rather hide this from the service developer.

Is there a way to tell wsimport to not generate the ObjectFactory for these types?

EDIT:

JAXB Version: 2.1.11
JAX-WS Version: 2.1.7
JDK Version: 1.6_30

help, No security header found in the message

$
0
0

I am write a WCF service to use wsHttpBinding and have a username / password authentication, and another to write a Java client to try to call WCF.

I use
JDK 1.6.0_37
NetBeans 7.2
Metro 2.2.1
but I get a error

com.sun.xml.wss.impl.PolicyViolationException: ERROR: No security header found in the message
at com.sun.xml.wss.impl.policy.verifier.MessagePolicyVerifier.verifyPolicy(MessagePolicyVerifier.java:138)
at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.createMessage(SecurityRecipient.java:1016)
at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.validateMessage(SecurityRecipient.java:252)
at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.verifyInboundMessage(SecurityTubeBase.java:455)
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processClientResponsePacket(SecurityClientTube.java:434)
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processResponse(SecurityClientTube.java:362)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1074)
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.client.Stub.process(Stub.java:443)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:174)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:102)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:154)
at $Proxy41.saySomething(Unknown Source)
at wcf.javaClient.main(javaClient.java:33)

"No security header found in the message", What does this mean?

Catalog is ignored when validating xsd files

$
0
0

Hi,

I've been trying to run a simple WS app that uses attachments, and thus requires http://ws-i.org/profiles/basic/1.1/swaref.xsd. This schema file is indeed referenced from every xsd file created by wsgen.

The server doesn't have internet access, so as often suggested I've put swaref.xsd in a local folder and created a catalog file:

&lt;catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"&gt;
   &lt;rewriteSystem systemIdStartString="http://ws-i.org/profiles/basic/1.1/" rewritePrefix="wsdl/"/&gt;  
&lt;/catalog&gt;

My catalog file is in WEB-INF, and I have some traces showing that it's actually parsed:

Parse catalog: jndi:/localhost/jaxws-exemple-svc/WEB-INF/jax-ws-catalog.xml
rewriteSystem: http://ws-i.org/profiles/basic/1.1/
wsdl/
REWRITE_SYSTEM: http://ws-i.org/profiles/basic/1.1/
jndi:/localhost/jaxws-exemple-svc/WEB-INF/wsdl/

The problem is that when schema validation is enabled, I still get this error:
org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'swaRef:swaRef' to a(n) 'type definition' component.

After some research and debugging, it actually looks like the catalog, while used to resolve the wsdl's location, isn't used when creating the XMLSchemaFactory that is part of the ServerSchemaValidationTube.

Has anyone here met a similar issue ? And if we were to fix it, what would be the best way to comply with Metro's architecture ?

Regards,
Eric

Jaxws and generated artifacts constants

$
0
0

Hi,
I have a class used in a web service, which has constants in it.
I would like the genereted client class for this class will also have those constants inside.

example:

public class returnedClass{
public static final String MY_CONST = "blabla";
.....
}

This used to be the case when I was using axis 1.4, but in jaxws I can't seem to make that happen.

can someone help me?

thanks,
Ran.

jaxws AnyTypeArray

$
0
0

I have a complex class that has a two dimensional array memeber.

public class bla
{
private Object[][] array;
....
}

jaxws created artifacts creates on the other side this memeber - List.
I would like it to create a List>, how can I do that?

thanks,
Ran.

Unsupported binding namespace "http://annox.dev.java.net"

$
0
0

I am tring to generate java source code from xsd file with annotations. For this I have written
XSD having following declarations in XSD file.

xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
jaxb:version="2.1"
xmlns:annox="http://annox.dev.java.net"
xmlns:s="http://annox.dev.java.net/org.hibernate.search.annotations"
jaxb:extensionBindingPrefixes="annox">

But when I tried to compile this schema with XJC its give me error that Unsupported binding namespace "http://annox.dev.java.net". And when I tried to open this URL(http://annox.dev.java.net) in browser the its show me Internet Explorer cannot display the webpage. Is the support for annox has been removed? Or there is another way to implement annox. Please help. Thanks in advance.


Weak HashMaps in the Memory leak + HPJDK 1.4.2_10 + WL 8.1 + JAXB ver-

$
0
0

Hi,

We have an application which is going in the OutofMemory situation in our prodcution, and we have observed from the heapdump that,
in the memory leak section - "Weak HashMaps" is occupying more memory.

We are using Weblogic 8.1 SP6 with HPUX ,JDK - java version "1.4.2.10"
Java HotSpot(TM) Server VM (build 1.4.2 1.4.2.10-060112-19:42-IA64N IA64, mixed mode).

In our application we have not at all used the WeakHashmaps. When we drilled down into the jar files to check where the WeaHashMaps have used, we observed that in some of the JAXB implemntation they are used. JAXB jar versions which we currently using are -
jaxb-xjc.-1.0.2
jaxb-libs.jar - 1.0.2
jaxb-impl.jar - 1.0.2
jaxb-api.jar- 1.0.1

Can anyone please let me know or suggest us the possible scenarios of this "Weak HahMaps " in the memory leak section ? is there are any knwon issues with WeakHashMap causing the memory leak with this version of jar version or so ?

Any help is highly appreciated!!!!!!

Thanks

error in web service client

$
0
0

using Netbeans 7.2.1, attempting to access to remote web service that requite STS (its implemented in WCF).
I have followed the instructions here http://metro.java.net/guide/ch12.html#gghnt

Running the test client code see below error, experiences folks there, can you please take a look and advise on steps to make it work, let me know if any other details required to dignose, thanks

run:
Jan 8, 2013 10:59:45 AM [com.sun.xml.ws.policy.parser.PolicyConfigParser] parse
INFO: WSP5018: Loaded WSIT configuration from file: file:/C:/Users/rosadom/Documents/NetBeansProjects/TestClient/build/web/WEB-INF/classes/META-INF/wsit-client.xml.
Jan 8, 2013 10:59:45 AM com.sun.xml.ws.security.impl.policy.Constants log_invalid_assertion
WARNING: SP0100: Policy assertion Assertion[com.sun.xml.ws.policy.sourcemodel.DefaultPolicyAssertionCreator$DefaultPolicyAssertion] {
assertion data {
namespace = 'http://schemas.microsoft.com/ws/2006/05/framing/policy'
prefix = 'msf'
local name = 'SslTransportSecurity'
value = 'null'
optional = 'false'
ignorable = 'false'
no attributes
}
no parameters
no nested policy
} is not supported under Token assertion.
Jan 8, 2013 10:59:45 AM [com.sun.xml.ws.policy.EffectiveAlternativeSelector] selectAlternatives
WARNING: WSP0075: Policy assertion "{http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1}BinaryEncoding" was evaluated as "UNKNOWN".
Jan 8, 2013 10:59:45 AM [com.sun.xml.ws.policy.EffectiveAlternativeSelector] selectAlternatives
WARNING: WSP0075: Policy assertion "{http://schemas.microsoft.com/ws/2006/05/framing/policy}Streamed" was evaluated as "UNKNOWN".
Jan 8, 2013 10:59:45 AM [com.sun.xml.ws.policy.EffectiveAlternativeSelector] selectAlternatives
WARNING: WSP0019: Suboptimal policy alternative selected on the client side with fitness "PARTIALLY_SUPPORTED".
Jan 8, 2013 10:59:46 AM com.sun.xml.ws.security.impl.policy.Constants log_invalid_assertion
WARNING: SP0100: Policy assertion Assertion[com.sun.xml.ws.policy.sourcemodel.DefaultPolicyAssertionCreator$DefaultPolicyAssertion] {
assertion data {
namespace = 'http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702'
prefix = 'sp'
local name = 'MustNotSendAmend'
value = 'null'
optional = 'false'
ignorable = 'false'
no attributes
}
no parameters
no nested policy
} is not supported under SecureConversationToken assertion.
Jan 8, 2013 10:59:47 AM com.sun.xml.ws.security.impl.policy.Constants log_invalid_assertion
WARNING: SP0100: Policy assertion Assertion[com.sun.xml.ws.policy.sourcemodel.DefaultPolicyAssertionCreator$DefaultPolicyAssertion] {
assertion parameter data {
namespace = 'http://www.abc.com/xyz/ws-trust/2010/11'
prefix = 'xyz'
local name = 'EnvCode'
value = 'envCode'
optional = 'false'
ignorable = 'false'
no attributes
}
no parameters
no nested policy
} is not supported under RequestSecurityTokenTemplate assertion.
Jan 8, 2013 10:59:47 AM [com.sun.xml.ws.policy.parser.PolicyConfigParser] parse
INFO: WSP5018: Loaded WSIT configuration from file: file:/C:/Users/rosadom/Documents/NetBeansProjects/TestClient/build/web/WEB-INF/classes/META-INF/wsit-client.xml.
Jan 8, 2013 10:59:47 AM com.sun.xml.ws.security.impl.policy.Constants log_invalid_assertion
WARNING: SP0100: Policy assertion Assertion[com.sun.xml.ws.security.impl.policy.SpnegoContextToken] {
assertion data {
namespace = 'http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702'
prefix = 'sp'
local name = 'SpnegoContextToken'
value = 'null'
optional = 'false'
ignorable = 'false'
attributes {
name = 'http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702:IncludeToken', value = 'http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient'
}
}
no parameters
nested policy {
namespace version = 'v1_5'
id = 'null'
name = 'null'
vocabulary {
1. entry = 'http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702:MustNotSendAmend'
2. entry = 'http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702:MustNotSendCancel'
3. entry = 'http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702:MustNotSendRenew'
4. entry = 'http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702:RequireDerivedKeys'
}
assertion set {
Assertion[com.sun.xml.ws.policy.sourcemodel.DefaultPolicyAssertionCreator$DefaultPolicyAssertion] {
assertion data {
namespace = 'http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702'
prefix = 'sp'
local name = 'MustNotSendAmend'
value = 'null'
optional = 'false'
ignorable = 'false'
no attributes
}
no parameters
no nested policy
}
Assertion[com.sun.xml.ws.policy.sourcemodel.DefaultPolicyAssertionCreator$DefaultPolicyAssertion] {
assertion data {
namespace = 'http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702'
prefix = 'sp'
local name = 'MustNotSendCancel'
value = 'null'
optional = 'false'
ignorable = 'false'
no attributes
}
no parameters
no nested policy
}
Assertion[com.sun.xml.ws.policy.sourcemodel.DefaultPolicyAssertionCreator$DefaultPolicyAssertion] {
assertion data {
namespace = 'http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702'
prefix = 'sp'
local name = 'MustNotSendRenew'
value = 'null'
optional = 'false'
ignorable = 'false'
no attributes
}
no parameters
no nested policy
}
Assertion[com.sun.xml.ws.policy.sourcemodel.DefaultPolicyAssertionCreator$DefaultPolicyAssertion] {
assertion data {
namespace = 'http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702'
prefix = 'sp'
local name = 'RequireDerivedKeys'
value = 'null'
optional = 'false'
ignorable = 'false'
no attributes
}
no parameters
no nested policy
}
}
}
} is not supported under Token assertion.
Jan 8, 2013 10:59:48 AM com.sun.xml.wss.impl.misc.DefaultCallbackHandler$X509CertificateValidatorImpl validate
SEVERE: WSS1533: Validation of self signed certificate failed.
Jan 8, 2013 10:59:48 AM com.sun.xml.ws.security.opt.impl.util.CertificateRetriever setServerCertInTheContext
WARNING: WSS0822: Could not validate the server certificate, not using it
Jan 8, 2013 10:59:48 AM com.sun.xml.wss.impl.misc.DefaultCallbackHandler handleUsernameCallback
SEVERE: WSS1500: Username Handler Not Configured properly using Callback and is null. (not configured)
Jan 8, 2013 10:59:48 AM com.sun.xml.wss.impl.misc.DefaultSecurityEnvironmentImpl getUsername
SEVERE: WSS0216: An Error occurred using CallbackHandler for : UsernameCallback
Jan 8, 2013 10:59:48 AM com.sun.xml.wss.impl.misc.DefaultSecurityEnvironmentImpl getUsername
SEVERE: WSS0217: An Error occurred using CallbackHandler handle() Method.
javax.security.auth.callback.UnsupportedCallbackException: Username Handler Not Configured
at com.sun.xml.wss.impl.misc.DefaultCallbackHandler.handleUsernameCallback(DefaultCallbackHandler.java:389)
at com.sun.xml.wss.impl.misc.DefaultCallbackHandler.handle(DefaultCallbackHandler.java:489)
.
.
.
Jan 8, 2013 10:59:48 AM com.sun.xml.wss.jaxws.impl.SecurityTubeBase secureOutboundMessage
SEVERE: WSSTUBE0024: Error in Securing Outbound Message.
com.sun.xml.wss.XWSSecurityException: javax.security.auth.callback.UnsupportedCallbackException: Username Handler Not Configured
at com.sun.xml.wss.impl.misc.DefaultSecurityEnvironmentImpl.getUsername(DefaultSecurityEnvironmentImpl.java:1329)
at com.sun.xml.wss.impl.filter.AuthenticationTokenFilter.resolveUserNameTokenData(AuthenticationTokenFilter.java:380)
.
.
.Caused by: javax.security.auth.callback.UnsupportedCallbackException: Username Handler Not Configured
at com.sun.xml.wss.impl.misc.DefaultCallbackHandler.handleUsernameCallback(DefaultCallbackHandler.java:389)

.
.
.
SEVERE: WSSTUBE0024: Error in Securing Outbound 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.wss.jaxws.impl.SecurityTubeBase.secureOutboundMessage(SecurityTubeBase.java:391)

steps to create a java client to access a remote WebService using STS authentication

$
0
0

I need to write a client (in java) to access a remote web service, the remote service is implemented in WCF and is using STS authentication.
I have the web service wsdl URL and also the URL for its STS, can someone point me to a simple set of instructions (something like step by step) that are specific to this case.

Have gone through several instructions and most of them talk about creating your keystone and trust-store and entry in wsit-client xml, i am not sure why i need these if i am just consuming the service.

Also I have a specific questions, the remote STS wsdl itself has a X509 certificate tag (hence the certificate), i am not sure by its there, any help would be great.

Thanks

(wsimport) Problem with authFile URL formatting....

$
0
0

I am trying to generate the Java client for a service written in .NET that uses NTLM to authenticate.

It seems when wsimport runs on Windows, it knows how to use NTML and works fine (using Maven w/ org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.1).

On Linux I am using an NTLM proxy (http://cntlm.sourceforge.net/) which seems to work okay. I started by hard coding the user/domain/password in the CNTLM config file, but now I am trying to pass it the specific credentials I want to use.

In the wsimport settings, I entered the address/port of the CNTLM proxy and in the authFile I include the URLs in the format:

http://user:password@server1.myserver.com/MyService/Service.svc?wsdl
http://user:password@server2.myserver.com/MyService/Service.svc?xsd=xsd0
http://user:password@server2.myserver.com/MyService/Service.svc?xsd=xsd1
http://user:password@server2.myserver.com/MyService/Service.svc?xsd=xsd2
http://user:password@server2.myserver.com/MyService/Service.svc?xsd=xsd4

QUESTION 1:
Is there a way to specify a wild card to allow the same user:password for all urls with the same host name instead of having to specify each URL specifically? I don't want to have to worry about changes in the endpoints of either the WSDL or XSD when the auth mechanism is the same on the server.

QUESTION 2:
I want to use our "service account" credentials instead of my personal ones. However the service account password was auto generated by our OPS team, very cryptic and has special characters in it. I tried URL encoding it but wsimport couldn't parse it correctly.

Can I encode the password so wsimport reads it correctly?

Thanks!

Customized JAXBValidation Fault

$
0
0

Hello All,

I would like to create a detailed collection of
JAXBValidationException(s) to send it to the client

I've annotated the
@SchemaValidation(handler=MyValidationErrorHandler.class) and my
extended class of ValidationErrorHandler works.
But the SAXParseException in my ValidationErrorHandler is like this

value 'b' with length = '1' is not facet-valid with respect to
minLength '2' for type 'validStringType'
The value 'b' of element 'ns2:name' is not valid.

and this is only the first occurance of a validationError.

This is not enough to create a usefull fault object for the client like
this:

...

Project
projectName
alue 'b' with length = '1' is not facet-valid with
respect to minLength '2' for type 'validStringType'
The value 'b' of element 'ns2:projectName' is not
valid.

Project
projectDecription
alue 'b' with length = '1' is not facet-valid with
respect to minLength '2' for type 'validStringType'
The value 'b' of element 'ns2:projectDecription' is
not valid.

...

Is there a possibiltiy to register a customized ValidationEventHandler
(which collects all errors) in the handler chain? Whow?

Thanks in advance

Tom

Viewing all 171 articles
Browse latest View live




Latest Images