Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "SCA Java support in STP"

(Todo list)
(Deploy to tomcat container)
Line 101: Line 101:
 
=== Create client project ===
 
=== Create client project ===
 
=== Deploy to tomcat container ===
 
=== Deploy to tomcat container ===
 +
'''TBD'''
 +
 
== Todo list ==
 
== Todo list ==
 
'''TBD'''
 
'''TBD'''
  
 
== References ==
 
== References ==

Revision as of 04:10, 24 January 2007

This wiki page is used to explain the current SCA Java support in STP Service Creation project.

It's just draft version, please give your valuable feedback to help us to improve it in the next milestone.

Thanks

Johnson Ma (Jan 24, 2007)

Introduction

We just added SCA Java support in STP service creation project. It allows user to create/debug SCA component within Eclipse by providing following functions:

  * Project wizard to help user to create sca java component
  * Fasttrack wizard to generate default.scdl and java empty interface/impl class
  * SCDL Editor. which is indeed the WST XML Editor with sca.xsd loaded
  * SCA and tuscany annotations editing support.
  * launch configuration to run & debug sca java component with Eclipse.
  * Integrated with Tuscany Java2Wsdl tool -sca-java-1.0-M2 release

Runtime/Spec info:

  * SCA java impl v0.95
  * SCA Assemble model v0.96
  * Tuscany-sca-java-1.0-M2 release

Setup Eclipse Plugins

The STP does not have update site yet. So we need to setup the Eclipse env manually. Please download and install the following plugins:


Please set the Tuscany kit location in preference page as the image below before do any SCA related work.

Sca preferences.JPG

Creating SCA Java Component using STP Service Creation and Tuscany

Creating SCA Java component project

SCDL Editing

The SCDL Editing is provided by customizing the standard XML Editor as following:

  • Register SCDL file as XML content type
  • Register sca.xsd to schema validator

Design View of the SCDL Editor

 Sca scdleditor designview.JPG

Source View of the SCDL Editor

 Sca scdleditor sourceview.JPG

You will got error message from schema validator for the generated scdl file. Please leave it for now, since those default.scdl comes with Tuscany1.0 M2 examples also have same problem.

SCA annotation editing

The SCA and Tuscany annotations are supported by extending the annotation editing framework in STP. In the java source editor, once you select java class, method or field, we will show the applicable annotations in the Annotation Properties View. Then you can add appreciate annotation from there. Notice: the sca annotation validation rules hasn't been setup yet. It will be provided in the next milestone

Sca annotation properties view.JPG

Generating WSDL

The Tuscany Java2wsdl tool has been integrated as an incremental builder, which is linking to java interface class with @Service annotation. For our example, the HelloWorld.wsdl will be automatically generated every time user modify the HelloWorld interface class. The current J2W option has been set according to those values defined in default.scdl file :

* service name ("-sn") = JavaInterfaceName + "Service"
* soap address ("-l") = "http://localhost:8080/service/"
 

Later on, We will provide preference/project properties to configure all J2W options including style, use, target namespace and output WSDL file name...etc

WSDL Editor

Directly use WST WSDL Editor here.

Generating Jar file

I created a JarBuilder to automatically package all classes, scdl and wsdl files into one single jar file, and put it under /Project/bin.

Run the SCA Java component

I will create java launch configuration to run & debug the SCA component within Eclipse. In the launch config:

  • Set mainclass to "org.apache.tuscany.launcher.MainLauncherBooter".
  • Set program args to the jar file of the component.
  • Set vmargs to "-Dtuscany.installDir=kit_dir_from_perference"

If you got

   Caused by: org.apache.tuscany.services.maven.TuscanyDependencyException: Unable to resolve artifact: org.apache.tuscany.sca.services.binding
    s:axis2:1.0-incubator-M2:jar [org.apache.tuscany.sca.services.bindings:axis2:1.0-incubator-M2:jar]
       at org.apache.tuscany.services.maven.MavenArtifactRepository.resolve(MavenArtifactRepository.java:72) 


From Tuscany maillist, that is random problem caused by some mass jars in maven repository. I have no idea how to workaround so far. Deleting .m2 doesn't help.

I plan to add '-Doffline=true' flag in the launch configuration and preference page later.

Create client project

Deploy to tomcat container

TBD

Todo list

TBD

References

Back to the top