Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 29

Thread: Problems With Spring WS 1.5 Samples

  1. #11
    Join Date
    May 2005
    Posts
    208

    Default

    Yes, that was settled a while ago.

    I've been making some progress. I've found that the instructions for the airline sample were far better in the 1.0.4 version download. (That doesn't mean that the pom.xml is better, just that the instructions seemed more sensible to me.)

    I've got the database built and loaded in MySQL; I've set up my JPA instance and validated it all in IntelliJ. I re-ran the code generation goal in Maven and added the results to my source paths. The airline sample code is now built and deployed on Tomcat 5.5.26.

    Next step: try out the different clients to make sure that they're all working. I'm especially interested in the .NET client.

    I'll go back to the 1.5 version and retry the airline sample again. Knowing what I know now, perhaps I can manage it.

    %

  2. #12
    Join Date
    May 2005
    Posts
    208

    Default

    airline clients are not happening for me. each one has build issues. gotta be missing something else.

    %

  3. #13

    Cool

    Must be truthful the airline sample has been a bugger for me to install as well, i cant get the pom run either something about the jaxb2 plugin not working, so i have built my own little sample and am trying out my own clients on that, its good practice and yeilds a lot more understanding, now i have a step by step for the security stuff i reckon i can make it happen, i switched out of maven as well and run ant for my own builds - at least it actually works, ok you have to specify and have the jars

  4. #14
    Join Date
    May 2005
    Posts
    208

    Default Still No Joy With Airline Sample

    The title says it all.

    I changed the applicationContext-jpa.xml, because after glancing through it I realized that the dataSource properties were still set to the default values for HSQLDB. (I'm using MySQL.)

    After changing the properties to point to my database I started getting exceptions on startup. Some of them have to do with referential integrity. If I look at the database, I can see that there's already data in the tables. If I open jpa/applicationContext-jpa.xml, I can see that the DatabaseInitializer bean is the likely culprit, so I commented that out.

    I also found two problems with the configuration:

    1. No default ctor for flightController in mvc-servlet.xml; added a reference to airlineService.
    2. No default ctor for airlineService in service/applicationContext.xml; added references to flightDao and ticketDao.

    At last I'm able to bring up the JSP that shows flights. Gotta start working with the clients one by one to see what's up with those.

    It might help some other people to modify the /samples for the 1.5.0 download to match the readme.txt documentation that came with the 1.0.4 download; add the bit about modifying the jpa/applicationContext-jpa.xml if you aren't using HSQLDBC; and correct the two bean configs that I noted above. Thanks.

    %

  5. #15

    Default Security

    All i still cannot get security to happen on the samples.

    I am trying to set up the Wss4j example

    have the following on the client side

    Code:
           <bean id="messagFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
    
           </bean>
           
           <bean id="client1" class="Client1">
           		<constructor-arg ref="messagFactory"/>
           		<property name="defaultUri" value="http://localhost:8080/testWS/searchService"/>
    			<property name="interceptors">
    				<list>
    					<ref local="wsInterceptor"/>
    				</list>
    			</property> 
           </bean>
           <bean id="wsInterceptor" class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
           		<property name="securementActions" value="UsernameToken"/>
           		<property name="securementUsername" value="Ian"/>
           		<property name="securementPassword" value="password"/>
           </bean>
    this on the server

    Code:
        <bean id="securityInterceptor" class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
        	<property name="validationActions" value="UsernameToken"/>
        	<property name="validationCallbackHandler" ref="callbackHandler"/>
        </bean>
        
        <bean id="callbackHandler" class="org.springframework.ws.soap.security.wss4j.callback.SimplePasswordValidationCallbackHandler">
        	<property name="users">
        		<props>
        			<prop key="Ian">password</prop>
        		</props>
        	</property>
        </bean>
    and i added the interceptor to the PayloadRoot, now when i call the service through eclipse europa web service explorer everything happens, i get a response - but surely i should not as there should be a security failure.

    When i try to run the client as described above i get the following exception

    Code:
    Exception in thread "main" org.springframework.ws.soap.client.SoapFaultClientException: One or more mandatory SOAP header blocks not understood
    	at org.springframework.ws.soap.client.core.SoapFaultMessageResolver.resolveFault(SoapFaultMessageResolver.java:37)
    	at org.springframework.ws.client.core.WebServiceTemplate.handleFault(WebServiceTemplate.java:668)
    	at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:502)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:440)
    	at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:395)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:341)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:332)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:322)
    	at Client1.getData(Client1.java:31)
    	at Client1.main(Client1.java:19)
    Anyone got any more clues as to what i may have missed in trying to get this to go, it is fairly urgent for a POC i am working on

  6. #16
    Join Date
    May 2005
    Posts
    208

    Default A Moving Target

    I opened up FlightController to give it a look. It feels like I'm learning Spring again for the first time, because I still have all the Spring 1.x books that don't use annotations much. I've got a lot of re-learning to do.

    The /flights URL displays fine for me, but when I submit a request it doesn't bring back a list of flights to drill into. The only way I can get to the flight.jsp for details is to use the URL /flight?id=1. The flight.jsp is displayed, but there's no data in it. I'll have to study the new controller to see what the problem is.

    I still haven't gotten any of the WS clients to work. I thought it'd be smart to get the web client working first, because I have a better understanding of that. Now I find out that I don't understand that, either. Lots to learn.

    %

  7. #17
    Join Date
    May 2005
    Posts
    208

    Default Airline JPA Issue

    When I start up the airline sample I see the following exception:

    Code:
    java.lang.IllegalStateException: Cannot apply class transformer without LoadTimeWeaver specified"
    Google found this explanation from Juergen:

    http://forum.springframework.org/arc...p/t-44299.html

    So I tried adding <context:load-time-weaver/> to applicationContext-jpa.xml, along with the context namespace, but then I got another, worse exception:

    Code:
    2008-04-14 12:42:01,238 ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed
    org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 87 in XML document from class path resource [org/springframework/ws/samples/airline/dao/jpa/applicationContext-jpa.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:load-time-weaver'.
    The app runs with the first exception, but not the second.

    What am I missing with the load time weaver? I've added the context namespace. Is there more?

    %

  8. #18
    Join Date
    May 2005
    Posts
    208

    Default Another Fix For Airline Sample

    I wasn't getting any data into the flight.jsp, because the variable "flight" couldn't be resolved.

    I changed the FlightsController singleFlight method to fix it. I changed this:

    Code:
        @RequestMapping(value = "/flight")
        public String singleFlight(@RequestParam("id")long id, ModelMap model) throws Exception {
            Flight flight = airlineService.getFlight(id);
            model.addAttribute(flight);
            return "flight";
        }
    to this:

    Code:
        @RequestMapping(value = "/flight")
        public String singleFlight(@RequestParam("id")long id, ModelMap model) throws Exception {
            Flight flight = airlineService.getFlight(id);
            model.addAttribute("flight", flight);
            return "flight";
        }
    I had to make another change to flights.jsp. I changed this line:

    Code:
                            <c:url var="flightUrl" value="flight">
    to this:

    Code:
                            <c:url var="flightUrl" value="/flight">
    All is well now. Web MVC client appears to be working fine. Now onto the WS clients.

    %

  9. #19
    Join Date
    May 2005
    Posts
    208

    Default Airline Sample JAX-WS Client Builds and Runs Fine

    The JAX-WS client for the airline sample builds and runs fine for me using the Ant build.xml that's provided.

  10. #20
    Join Date
    May 2005
    Posts
    208

    Default Airline Sample Spring-WS Client Build Fails

    The Spring WS client build fails while processing spring-core-1.2.9.pom: Failed to resolve activation-1.0.2.jar

    I'll have to dig into Maven to see how to resolve this.

    %

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •