facebook

Problems creating bottom-up JAX-WS webservice

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #286161 Reply

    mwunderlich
    Member

    Hi all,

    I am currently evaluating MyEclipseIDE as a dev tool for working on a Java web service project. However, I have problems with the code gen wizard.
    I have created my interface for the webservice and a class that implements this interface. When I run the Wizard to generate the web service server and client classes, i get the error msg:

    “Problem occured
    Generating JAX-WS Web Service
    Reason:
    runtime modeler error: Wrapper class text.jaxws.myMethodHere is not found. Have you run APT to generate them?”

    Could anyone enlighten me as to what this msg means??
    FWIW, when trying to create a simple Hello World example I don’t get this msg.
    Thanks a lot!

    Kind regards,

    Martin

    #286233 Reply

    Brian Fernandes
    Moderator

    Martin,

    We run an annotation processor on your project in order to generate code necessary for further WS generation. This should be automatically enabled, do you have an .apt-generated source folder in your project? Also check Project properties > Java Compiler > Annotation Processing > Factory path, does it have a MYECLIPSE_WSTOOLS_HOME/webservices-tools.jar entry and is annotation processing enabled ? Also, is “Build Automatically” on?

    Thanks.

    #286714 Reply

    mwunderlich
    Member

    Hi Brian,

    I have managed to create a little Hello World web service, following the instructions on the site. However, when I try to generate my own service (bottom up), I still get the error described.

    To answer your questions:
    @Support-Brian wrote:

    Martin,

    We run an annotation processor on your project in order to generate code necessary for further WS generation. This should be automatically enabled, do you have an .apt-generated source folder in your project?
    .

    No.
    @Support-Brian wrote:

    Also check Project properties > Java Compiler > Annotation Processing > Factory path, does it have a MYECLIPSE_WSTOOLS_HOME/webservices-tools.jar entry

    .

    Yes.

    @Support-Brian wrote:

    and is annotation processing enabled ?

    .

    Yes.

    @Support-Brian wrote:

    Also, is “Build Automatically” on?

    Thanks.

    Where can I find this?

    Cheers,

    Martin

    #286726 Reply

    Brian Fernandes
    Moderator

    Martin,

    Build Automatically is a menu item under the Project menu. It should be checked (usually is). It is possible that you have the .apt-generated folder in your project but cannot see it because of filter settings. Can you view the same project in windows explorer (or equivalent for your OS) and see if that folder is present?

    Is it possible for you to post a minimal example of the interface you used which demonstrates this problem?

    Thanks.

    #286772 Reply

    mwunderlich
    Member

    Hi Brian,

    @Support-Brian wrote:

    Martin,
    Build Automatically is a menu item under the Project menu. It should be checked (usually is). It is possible that you have the .apt-generated folder in your project but cannot see it because of filter settings. Can you view the same project in windows explorer (or equivalent for your OS) and see if that folder is present?

    Is it possible for you to post a minimal example of the interface you used which demonstrates this problem?
    Thanks.

    The menu item “Build Automatically” is checked. I do have the folder .apt-generated, but it is empty.
    Below please find the Java bean that I am trying to generated the WS from. Maybe there is something in there that will shed some light on this. I am trying to create a web services wrapper for a project on sourceforge called TinyTM. It’s essentially a database of multilingual text.

    Thanks a lot for your help.

    Kind regards,

    Martin

    package org.tinytm.webservice;

    public class TinyTMServer implements ITinyTM {

    public String[] tinytm_get_fuzzy_matches(String sourceLanguage,
    String targetLanguage, String sourceText) {
    // TODO Auto-generated method stub
    return null;
    }

    public String[] tinytm_get_fuzzy_matches(String sourceLanguage,
    String targetLanguage, String sourceText, String tagString,
    String penaltyString) {
    // TODO Auto-generated method stub
    return null;
    }

    public int[] tinytm_lang_ids_from_lang(String language) {
    // TODO Auto-generated method stub
    return null;
    }

    public int tinytm_language_id_from_string(String lang) {
    // TODO Auto-generated method stub
    return 0;
    }

    public void tinytm_new_segment(String sourceLanguage,
    String targetLanguage, String sourceText, String targetText) {
    // TODO Auto-generated method stub

    }

    public void tinytm_new_segment(int p_segment_key, int p_parent_key,
    String p_creation_ip, String p_customer_name,
    String p_segment_type, String p_text_type, int p_document_key,
    String sourceLanguage, String targetLanguage, String sourceText,
    String targetText, String tagString) {
    // TODO Auto-generated method stub

    }

    public int tinytm_segment_type_id_from_string(String type) {
    // TODO Auto-generated method stub
    return 0;
    }

    }

    #286953 Reply

    mwunderlich
    Member

    Hi Brian,

    Any news on this? The way things are now, I must conclude that MyEclipse isn’t really suitable for my purposes.

    Kind regards,

    Martin

    #286991 Reply

    Brian Fernandes
    Moderator

    Martin,

    Sorry for the delayed response, thanks for sending the class in. I narrowed the problem down to the fact that you have two overloaded methods in this class: tinytm_get_fuzzy_matches and tinytm_new_segment.
    If you rename the second occurrence of each method, the bottom up generation works.

    For a webservice, I would suggest having a single method with the given name which would accept all possible parameters and place delegation logic in the method based on parameters available. Obviously a better error reporting system is required in cases like these and I have filed this particular case for further investigation.

    Please let us know if you have further concerns.

    #287046 Reply

    mwunderlich
    Member

    @Support-Brian wrote:

    Martin,

    Sorry for the delayed response, thanks for sending the class in. I narrowed the problem down to the fact that you have two overloaded methods in this class: tinytm_get_fuzzy_matches and tinytm_new_segment.
    If you rename the second occurrence of each method, the bottom up generation works.

    For a webservice, I would suggest having a single method with the given name which would accept all possible parameters and place delegation logic in the method based on parameters available. Obviously a better error reporting system is required in cases like these and I have filed this particular case for further investigation.

    Please let us know if you have further concerns.

    Hi Brian,

    Thanks a lot for the reply. It was indeed the overloaded methods that were causing the problem. I have renamed the second instance of each method and now managed to successfully create the web service classes and the client. Thank you so much for your help!

    A new problem has occured in that when I try to access the web service from the client, I get the following error msg:

    Exception in thread "main" java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/Program%20Files/MyEclipse%206.5/jre/lib/ext/webservices-rt.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)

    Apparently, there is a versioning problem, but I am not sure what to do about it. Any ideas_

    Cheers,

    Martin

    #287047 Reply

    Brian Fernandes
    Moderator

    Martin,

    Glad you got it working, thanks for following up.
    You need to run the client with a JDK version greater than or equal to 1.6.0_04 (or any version of 1.5). The 1.6 versions prior to that shipped with an earlier version of JAX-WS which cause this conflict.

    Hope this helps.

    #287051 Reply

    mwunderlich
    Member

    @Support-Brian wrote:

    Martin,

    Glad you got it working, thanks for following up.
    You need to run the client with a JDK version greater than or equal to 1.6.0_04 (or any version of 1.5). The 1.6 versions prior to that shipped with an earlier version of JAX-WS which cause this conflict.

    Hope this helps.

    Thank you so much, Brian. That did the trick!!

    Cheer,s

    Martin

    #288442 Reply

    scallaer
    Member

    MyEclipseIDE 6.5
    Annotation processing is on
    Factory path includes the webservices-tools.jar
    No overloading methods
    .apt_generated folder is in place and empty
    jdk is 1.5_11
    A delegate class has been generated.

    Please help.

    #288443 Reply

    scallaer
    Member

    @scallaer wrote:

    MyEclipseIDE 6.5
    Annotation processing is on
    Factory path includes the webservices-tools.jar
    No overloading methods
    .apt_generated folder is in place and empty
    jdk is 1.5_11
    A delegate class has been generated.

    Please help.

    Same error
    “Problem occured
    Generating JAX-WS Web Service
    Reason:
    runtime modeler error: Wrapper class tree.jaxws.Save is not found. Have you run APT to generate them?”

    #288484 Reply

    scallaer
    Member

    Found the cause: tried to generate a webservice from code outside the web project

Viewing 13 posts - 1 through 13 (of 13 total)
Reply To: Problems creating bottom-up JAX-WS webservice

You must be logged in to post in the forum log in