You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by npwork <ne...@yahoo.com> on 2007/10/30 20:44:01 UTC

Re: Fuse Tutorial Issues and Solutions

Hi Tom,

This post really helped. Thanks! ...I just had another question for
you...for some reason, the maven2 generate sources does not put the
generated code in target/generated-sources. Any idea why this could be
happening?

Thanks
NP

Tom Purcell wrote:
> 
> Hello
> 
> I made it through the Fuse tutorial and found some issues. I think they
> have to do with the Tutorial being done with a slightly out of date
> version of Fuse. I'm posting the discrepancies I found in the hope it
> helps someone, somewhere.
> 
> The Create Contract First Web Services In Fuse Tutorial:
> 
>     * When creating the first project you are instructed to select a
> "JSR-181 Service based on WSDL" project from the "New Project" wizard.
> That selection does not exist in the 1.3 version of the Fuse IDE. Choose
> "Contract First Service" instead.
>     * In creating the WSDL you are instructed to add a "getPrice" method.
> In the presentation the service Input changes to "getPriceRequest" and the
> Output changes to "getPriceResponse". In my IDE the Output changed to
> "getPriceResponse" but the Input changed to "getPrice". The difference had
> no long term effect on the assembly or running of the tutorial but it did
> cause me to stop and scratch my head for a bit. Clearly I did something
> wrong. I did not. Neither did you.
>     * The next thing really got me. When the WSDL is done and its time to
> generate source the presentation moves really quick and its difficult to
> see exactly what gets clicked. The presenter right clicks on the
> PricingService project , goes down to the "Build Phase" menu item and
> selects "generate-sources". In Fuse IDE 1.3 "Build Phase", and therefore
> its sub-selections, do not exist. Instead of "Build Phase" select "Run
> As". Then select "Maven2 generate sources".
>     * Shortly after that you run into another menu issue. You're told you
> need to "Synchronize with Maven" after you create a folder named "java".
> There is no "Synchronize with Maven" in the menu. I could not figure out
> what to do so I went into the pom.xml for the project and added the
> following to the resources element:
> 
>     <resource>
>     <directory>src/main/java</directory>
>     </resource>
> 
>     * Things go pretty well up until you finish creating the PricingHttp
> consumer. There you'll run into another descrepacncy in the Maven2
> implementation. You are instructed to select a project, right click, go
> down the list of actions to "Build Phase" and select "install". Instead,
> select the project, go down the list of actions to "Run As" and select
> "Maven2 install". As instructed do this for both the PricingHttp and the
> PricingService projects.
> 
>     * In running the install on the PricingService project I got some ugly
> build errors:
> 
>           Unable to locate the Javac Compiler in: C:\Program
> Files\Java\jre1.5.0_06\..\lib\tools.jarPlease ensure you are using JDK 1.4
> or above and...
> 
>       Note the "jre". I'm running the standard Sun 1.5.0_6 JDK. There is
> no "tools.jar in the "jre" but there is one in the JDK. So, in Eclipse, I
> went to Windows, Preferences, Java, Installed JREs and added the
> "jdk1.5.0_6" by navigating to "C:\Program Files\Java\jdk1.5.0_06". I reran
> the "Run As", "Maven2 install" and all was well.
>     * One last issue popped up: deployment failed. This is what I saw in
> the projectDeply console:
> 
>           [WARN] Attempting to build MavenProject instance for Artifact of
> type: jar; constructing POM artifact instead.
>           [INFO] ------------------ Deployment Analysis
> --------------------
>           [INFO] A custom project has 3 child dependencies
>           [INFO] - jbi-service-assembly : C:\Documents and
> Settings\tom\.m2\repository\com\mycompany\PricingAssemply\1.0-SNAPSHOT\PricingAssemply-1.0-SNAPSHOT.zip
>           [INFO] - jbi-component : C:\Documents and
> Settings\tom\.m2\repository\org\apache\servicemix\servicemix-http\fuse-3.1.0.2\servicemix-http-fuse-3.1.0.2-installer.zip
>           [INFO] - jbi-component : C:\Documents and
> Settings\tom\.m2\repository\org\apache\servicemix\servicemix-jsr181\fuse-3.1.0.2\servicemix-jsr181-fuse-3.1.0.2-installer.zip
>           [INFO] - jbi-shared-library : C:\Documents and
> Settings\tom\.m2\repository\org\apache\servicemix\servicemix-shared\fuse-3.1.0.2\servicemix-shared-fuse-3.1.0.2-installer.zip
>           [INFO]
> -----------------------------------------------------------
>           [INFO] PricingAssemply is not deployed
>           [INFO] Deploying jbi-service-assembly from C:\Documents and
> Settings\tom\.m2\repository\com\mycompany\PricingAssemply\1.0-SNAPSHOT\PricingAssemply-1.0-SNAPSHOT.zip
>           [ERROR] mojo-execute : jbi:projectDeploy
>           Diagnosis: Unable to deploy project, Error accessing ServiceMix
> administration
>           FATAL ERROR: Error executing Maven for a project
>           [ERROR] project-execute :
> com.mycompany:PricingAssemply:jbi-service-assembly:1.0-SNAPSHOT (
> task-segment: [jbi:projectDeploy] )
>           Diagnosis: Unable to deploy project, Error accessing ServiceMix
> administration
>           FATAL ERROR: Error executing Maven for a project
> 
>       I wasn't sure that was helpful so I went to the server console and
> found a pretty long stack trace with xml snippets and
> IllegalArgumaentExceptions and all kinds of other nastyness but I'll cut
> to the chase. Here was the important part:
> 
>           Caused by: java.net.URISyntaxException: Illegal character in
> path at index 16: file:/C:/Program Files/FUSE-1.3.0/FUSE-1.3.0/data/s....
> 
>       We don't need the whole line because if we count to 16 we find out
> the "Illegal character" is the <space> in "Program<space>Files" of the
> windows directory where the Fuse install placed the server. I copied the
> entire "FUSE-1.3.0" directory structure up one level (so that "Program
> Files" was no longer part of the path) and from that point on it was
> smooth sailing.
> 
> Thanks
> Tom
> 
> 

-- 
View this message in context: http://www.nabble.com/Fuse-Tutorial-Issues-and-Solutions-tf3548010s12049.html#a13494671
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Fuse Tutorial Issues and Solutions

Posted by Bruce Snyder <br...@gmail.com>.
On 10/31/07, npwork <ne...@yahoo.com> wrote:
>
> Hi,
>
> I found out two more issues
>
> 1) The outputDirectory should be
> <outputDirectory>target/generated-sources</outputDirectory>  instead of
> <outputDirectory>target/generated-sources/jaxws</outputDirectory>. If you
> keep the jaxws in there, the generated classes package structure does not
> conform and you will get compilation errors.

Yeah, you may be correct. My recollection may be incorrect as it's
been a while since I built the pricing service. Though I know I use
target/generated-source/jaxws and target/generated-source/jaxb in a
different project right now without issue. But I'm using CXF instead
of XFire.

> 2) After you generate the sources, in Pricing.java, the getPrice method is
> generated with output of type BigDecimal ....as per the WSDL the output type
> should be getPriceResponse

Hmm, that's definitely not correct (the BigDecimal as the return
type). Are you sure your WSDL is not goofed up somehow? Below is a
WSDL that should work:

---------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
	xmlns:tns="http://www.mycompany.com"
	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="PricingService"
	targetNamespace="http://www.mycompany.com">
	<wsdl:documentation></wsdl:documentation>

	<wsdl:types>
		<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
			targetNamespace="http://www.mycompany.com">
			<xsd:element name="getPriceRequest">
				<xsd:complexType>
					<xsd:sequence>

						<xsd:element name="ticker" type="xsd:string"></xsd:element>
						<xsd:element name="date" type="xsd:date"></xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="getPriceResponse">
				<xsd:complexType>
					<xsd:sequence>

						<xsd:element name="source" type="xsd:string"></xsd:element>
						<xsd:element name="price" type="xsd:decimal"></xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
		</xsd:schema>
	</wsdl:types>
	<wsdl:message name="getPriceRequest">
		<wsdl:part name="parameters" element="tns:getPriceRequest"></wsdl:part>
	</wsdl:message>
	<wsdl:message name="getPriceResponse">
		<wsdl:part name="parameters" element="tns:getPriceResponse"></wsdl:part>
	</wsdl:message>
	<wsdl:portType name="Pricing">
		<wsdl:operation name="getPrice">
			<wsdl:input message="tns:getPriceRequest"></wsdl:input>
			<wsdl:output message="tns:getPriceResponse"></wsdl:output>
		</wsdl:operation>
	</wsdl:portType>
	<wsdl:binding name="PricingBinding" type="tns:Pricing">
		<soap:binding style="document"
			transport="http://schemas.xmlsoap.org/soap/http" />
		<wsdl:operation name="getPrice">
			<soap:operation
				soapAction="http://www.mycompany.com/getPrice" />
			<wsdl:input>
				<soap:body use="literal" />
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	<wsdl:service name="PricingService">
		<wsdl:port name="PricingPort" binding="tns:PricingBinding">
			<soap:address location="http://localhost:8192/pricing/" />
		</wsdl:port>
	</wsdl:service>
</wsdl:definitions>
---------------------------------------------------------------------------------------------------------------

Compare yours to the one above.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/
Castor - http://castor.org/

Re: Fuse Tutorial Issues and Solutions

Posted by npwork <ne...@yahoo.com>.
Hello...please respond to the query.

Thanks for the help in advance

NP

npwork wrote:
> 
> Hi,
> 
> I found out two more issues
> 
> 1) The outputDirectory should be
> <outputDirectory>target/generated-sources</outputDirectory>  instead of
> <outputDirectory>target/generated-sources/jaxws</outputDirectory>. If you
> keep the jaxws in there, the generated classes package structure does not
> conform and you will get compilation errors.
> 
> 2) After you generate the sources, in Pricing.java, the getPrice method is
> generated with output of type BigDecimal ....as per the WSDL the output
> type should be getPriceResponse
> 
> Not sure if you faced this issued. Please provide assistance in resolving
> this.
> 
> Thanks
> NP
> 
> 
> bsnyder wrote:
>> 
>> On 10/30/07, npwork <ne...@yahoo.com> wrote:
>>>
>>> Hi Tom,
>>>
>>> This post really helped. Thanks! ...I just had another question for
>>> you...for some reason, the maven2 generate sources does not put the
>>> generated code in target/generated-sources. Any idea why this could be
>>> happening?
>> 
>> This is due to a bug in the servicemix-wsdl-first-service-unit Maven
>> archetype. Just edit the pom.xml for the project and change the
>> following:
>> 
>>  <outputDirectory>target/jaxws</outputDirectory>
>> 
>> to this:
>> 
>>  <outputDirectory>target/generated-sources/jaxws</outputDirectory>
>> 
>> BTW, thanks for reminder ;-). I just committed a fix for this
>> (https://issues.apache.org/activemq/browse/SM-1122). I'll have to get
>> this included in the ServiceMix 3.2 release.
>> 
>> Bruce
>> -- 
>> perl -e 'print
>> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
>> );'
>> 
>> Apache ActiveMQ - http://activemq.org/
>> Apache ServiceMix - http://servicemix.org/
>> Apache Geronimo - http://geronimo.apache.org/
>> Castor - http://castor.org/
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Fuse-Tutorial-Issues-and-Solutions-tf3548010s12049.html#a13552707
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Fuse Tutorial Issues and Solutions

Posted by npwork <ne...@yahoo.com>.
Hi,

I found out two more issues

1) The outputDirectory should be
<outputDirectory>target/generated-sources</outputDirectory>  instead of
<outputDirectory>target/generated-sources/jaxws</outputDirectory>. If you
keep the jaxws in there, the generated classes package structure does not
conform and you will get compilation errors.

2) After you generate the sources, in Pricing.java, the getPrice method is
generated with output of type BigDecimal ....as per the WSDL the output type
should be getPriceResponse

Not sure if you faced this issued. Please provide assistance in resolving
this.

Thanks
NP


bsnyder wrote:
> 
> On 10/30/07, npwork <ne...@yahoo.com> wrote:
>>
>> Hi Tom,
>>
>> This post really helped. Thanks! ...I just had another question for
>> you...for some reason, the maven2 generate sources does not put the
>> generated code in target/generated-sources. Any idea why this could be
>> happening?
> 
> This is due to a bug in the servicemix-wsdl-first-service-unit Maven
> archetype. Just edit the pom.xml for the project and change the
> following:
> 
>  <outputDirectory>target/jaxws</outputDirectory>
> 
> to this:
> 
>  <outputDirectory>target/generated-sources/jaxws</outputDirectory>
> 
> BTW, thanks for reminder ;-). I just committed a fix for this
> (https://issues.apache.org/activemq/browse/SM-1122). I'll have to get
> this included in the ServiceMix 3.2 release.
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache ActiveMQ - http://activemq.org/
> Apache ServiceMix - http://servicemix.org/
> Apache Geronimo - http://geronimo.apache.org/
> Castor - http://castor.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/Fuse-Tutorial-Issues-and-Solutions-tf3548010s12049.html#a13517920
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Fuse Tutorial Issues and Solutions

Posted by Bruce Snyder <br...@gmail.com>.
On 10/30/07, npwork <ne...@yahoo.com> wrote:
>
> Hi Tom,
>
> This post really helped. Thanks! ...I just had another question for
> you...for some reason, the maven2 generate sources does not put the
> generated code in target/generated-sources. Any idea why this could be
> happening?

This is due to a bug in the servicemix-wsdl-first-service-unit Maven
archetype. Just edit the pom.xml for the project and change the
following:

 <outputDirectory>target/jaxws</outputDirectory>

to this:

 <outputDirectory>target/generated-sources/jaxws</outputDirectory>

BTW, thanks for reminder ;-). I just committed a fix for this
(https://issues.apache.org/activemq/browse/SM-1122). I'll have to get
this included in the ServiceMix 3.2 release.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/
Castor - http://castor.org/