Joyce Kind

Greenhorn
+ Follow
since Nov 27, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Joyce Kind

Hi,

My application was working before. After I added some spring schema in the applicationContext.xml header and changed the spring-beans version from 2.5 to 3.0, and I got the following exceptions when I start my application.

java.lang.NoSuchMethodError: org.springframework.core.MethodParameter.getParameterAnnotations()[Ljava/lang/Object;
at org.springframework.beans.factory.config.DependencyDescriptor.getAnnotations(DependencyDescriptor.java:203)
at org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver.isAutowireCandidate(QualifierAnnotationAutowireCandidateResolver.java:106)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.isAutowireCandidate(DefaultListableBeanFactory.java:377)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.isAutowireCandidate(DefaultListableBeanFactory.java:364)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:670)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:610)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1076)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:982)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:329)
at org.springframework.batch.core.launch.support.CommandLineJobRunner.start(CommandLineJobRunner.java:191)
at org.springframework.batch.core.launch.support.CommandLineJobRunner.main(CommandLineJobRunner.java:254)

Do you know what is about? By the way, I am not using autowiring in my application.

Thanks!
14 years ago
Hi,

I just start to use Spring-WS client to send request with an attachment to a Web Service. According to the Web service functional spec I received from client, I need to call an operation uploadFile with the file itself as a SOAP attachment. However I am not able to find anything related to attachement in the WSDL file and JAXB generatd classes. As I presume the WSDL should have <mime:part><mime:content part="attach" type="application/pdf" /> </mime:part> declared for the uploadFileRequest. So I wonder if the WSDL I received is wrong.

As I am new to Spring-WS and SOAP attachement, and really not sure if Spring-WS has better way to deal with the attachment. Could someone please help?

The WSDL I got:
<wsdl:portType name="FileService">
<wsdl:operation name="uploadFile">
<wsdl:input message="uploadFileRequestMsg" name="uploadFileRequest"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding>
<wsdl:operation name="uploadFile">
<soap12:operation soapAction="uploadFile" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"/>
<wsdl:input name="uploadFileRequest">
<soap12:header message="serviceHeaderMsg" part="serviceHeader" use="literal" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"/>
<soap12:body use="literal" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"/>
</wsdl:input>
</wsdl:operation>
</wsdl:binding>

schema for uploadFileRequest:
<xsd:complexType name="uploadFileRequest">
<xsd:sequence>
<xsd:element minOccurs="0" name="repositoryName" type="xsd:string" />
<xsd:element minOccurs="0" name="fileName" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>

Thanks!
14 years ago
Thanks, I will try wsimport.

Happy New Year to you!
14 years ago
Hi,

This is my first time to try spring-ws client.

After reading documentation and some examples online, I found I need to generate JAXB domain classes from XML schema first, so I can use JAXB objectFacotry to create request domain object and ask Spring framework to send over my request to a Web Services. But I only have one WSDL file from the Web Service and there is no seperate XSD file. I saw the XML schema actually is written inside the WSDL file as below:

<wsdl:type>
<xs:schema>...</xs:schema>
<xs:schema>...</xs:schema>
<xs:schema>...</xs:schema>
<xs:schema>...</xs:schema>
</wsdl:type>

For this built-in XSD, how do I generate JAXB domain classes?

Thanks very much!
14 years ago
Thanks Paul,

So <city>New York</city> and <city xmlns:ns2="http://www.mycom.com/XMLSchema/myxsd" xmlns="">New York</city> are functionally the same.

I would like to get rid of the automatically generated xmlns:ns2 part, as our sample client xml does not include this. How can I do that?

Thanks.
14 years ago
Hi,

I am using JAXB2 marshaller to create an xml file based on the generated classes from the xml schema. I got two questions regarding the namespace:

1. In the root element "ROOT", I need to add attributes xsi:schemaLoaction, xmlns, and xmlns:xsi as below
<?xml version="1.0" encoding="UTF-8" ?>
<ROOT jobname="job"
xsi:schemaLocation="...."
xmlns="........"
xmlns:xsi="..............">....
</ROOT>

But from the generated class ROOT, I am not able to find the setSchemaLocation() or SetXmlns(), How do I set these values to ROOT element?

2. There is another element class that has setCity() method, and this method takes JAXBElement<String> as argument. I created the JAXBElement<String> as below:

JAXBElement<String> city = new JAXBElement<String>(new QName("city"), String.class, null, "New York"); //cannot get rid of namespace
address.setCity(city);

And the result xml is
<city xmlns:ns2="http://www.mycom.com/XMLSchema/myxsd" xmlns="">New York</city>

I need <city>New York</city>, and how can I get rid of the namespace?

Thanks very much!
14 years ago
Hi,

I am using Eclipse Helios and want to install jaxb xjc exlipse plugin to automatically generate classes from XSD.

But i searched the Web and could not find the site url to install the plugin from eclipse. Do you know the site url or how to install this plugin?

Thanks very much.
14 years ago
Hi all,

I am having a problem to print an Microsoft Excel spreadsheet to printer using Java. I searched POI, Jxcell ect. and could not find the solution. The Jave Print Service API seems no support too. Sorry if I am wrong.

Could anybody, who printed the spreadsheet to printer using Java before, please tell me which API you have used? I would like to study for it.

Thanks in advance,
Joyce
16 years ago