ANT task to process properties-files into static class

Hi,
I think this problem is very interesting. I have a web application that needs various configuration. I'm using a properties file that is loaded into a Properties-class.
The problem arrises when runtime exceptions are thrown (NullPointerException) by using:
String value = props.getProperty("myProp");
(In this case the entry "myProp" is not available.)
The solution would be to process the properties file and put all keys and values into a class with public static attributes:
class Props {
public static String myProp = "123";
This processing should be done with ANT! It shall create a JAVA file before the general compilation task. This would be great and runtime exceptions concerning a lack of propertie-keys are extinguished forever.
Is there any tool for ANT that helps?
Thanks in advance.

Personally, I would not like it - I can't compile even parts of my code without running Ant to build the whole thing? Second, I do not want my build tool to alter or add any source files.
IMO, you should instead simply go and check for null values before using them. I'd regard these NPEs rather as programming flaws - you already pointed out that their value may be null, so not checking is just wrong.
Lastly, maybe you can create a tool yourself - generating a code like this is highly trivial. you only have to keep in mind that development will be a PITA because an IDE with incremental compile will always fail with compilation errors as long as it doesn't create that constants class Ant's supposed to create.
Oh, and why not ask Ant-related questions in an Ant forum?

Similar Messages

  • How can i use JWSDP1.6 from Ant tool to convert .wsdl file into Java class

    Hi All,
    i m very new in the development field.plese help me...
    i have a .wsdl file and i have to make some modification in the file and return this file with build file used in Ant tool.
    means my requirement is to conver the .wsdl file into java class,modify it and convert back to wsdl file.how can i do it using JWSDP1.6 and Ant tool.
    thanks in advance...
    Vikram Singh

    lemilanais wrote:
    hello!
    I have developpe an animation with flash. before give it to othe person in order to use it, i would like to secure it by integrated a security module inside the software.Secure it from what? Being played? Copied? Deleted? Modified?
    Because, i am a java developper, i have choose Netbeans 6.1 to secure it.That has to be the most random thing I've read in some time.
    do you know how can i do to integrate my animation .swf inside my java class?Java can't play SWF files and Flash can't handle Java classes, so what you're suggesting here doesn't make a lot of sense.

  • [svn:fx-3.x] 13067: Fix for html-wrapper ant task generates incorrect wrapper files for flash player version detection .

    Revision: 13067
    Revision: 13067
    Author:   [email protected]
    Date:     2009-12-17 12:48:20 -0800 (Thu, 17 Dec 2009)
    Log Message:
    Fix for html-wrapper ant task generates incorrect wrapper files for flash player version detection.
    QE notes: None.
    Doc notes: None
    Bugs: SDK-18826
    Reviewed By: Paul
    Tests run: checkintests
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-18826
    Modified Paths:
        flex/sdk/branches/3.x/modules/antTasks/src/flex/ant/HtmlWrapperTask.java

    Could you try creating a new Firefox profile to see if that helps?
    8. Make a new profile
    Chris

  • Wrap a file into one class

    Hello,
    I want to wrap a file into one classe, how can I do that?
    For example:
    class fileWrapper {
    one buffer for file content(what kind of buffer here?)
    Thanks a lot
    Grace

    The following is not a buffer but I hope it could be of some use.
    import java.io.*;
    public class FileWrapper {
        java.io.File file;
        FileWrapper(java.io.File f) throws java.io.IOException{
           this.file =f;
        FileWrapper(java.lang.String fname) throws java.io.IOException{
          this(new java.io.File(fname));
        // .. next is an example of a method ... You can define other useful methods
        public String readLines() throws java.io.IOException{//read all lines as a String object
           java.io.BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(this.file),"UTF8"));
           StringBuffer buffer = new StringBuffer();
           String temp=null,newLine=System.getProperty("line.separator");
           while((temp=reader.readLine())!=null){
               buffer.append(temp).append(newLine);
           reader.close();
           return String.valueOf(buffer);
    /*public static void main(String[] args) throws java.lang.Exception{
      FileWrapper fw = new FileWrapper("test.txt");
      String str = fw.readLines();
      System.out.println(str);
    }

  • Where do I find the ANT task for creating ear file in WLI

    Hi friends
    I was trying to create an ear file out of my process definitions and deploy on weblogic instead of deploying it from Workshop. I heard that there are ANT tasks available that do this but I couldn't find much detail.
    I was wondering if somebody can point me to any documentation or anything that'll help me achieve this.
    Thanks.
    Bijan

    This may help

  • Wsdlc Ant Task - Problem creating java files in the correct package

    In eclipse, for weblogic 9.2
    Using the wsdlc WebLogic Web Services Ant Task, I am trying to auto-generate the java files for the web service based on the WSDL. I have specified the packageName as one of the parameters. However the java files are being created and packaged based on the TargetNameSpace of the WSDL rather then under the package name specified. Following is part of my build.xml
    autogen.src.dir=../code/java/beaAutoGen
    base.dest=../../../var/build/wsmToPlmWS
    bea.build.dir=beaBuild
         <target name="generate-from-wsdl" depends="prepare">
              <delete dir="${src.dir}" includeemptydirs="true" />
              <delete dir="${autogen.src.dir}" includeemptydirs="true" />
              <wsdlc srcWsdl="../config/sourceWSDL/MRPBindingPort.wsdl"
                   destJwsDir="${base.dest}/${bea.build.dir}/compiledWsdl" destImplDir="${base.dest}/${bea.build.dir}/impl"
                   packageName="com.lmco.iplm.webservices.wsmtoplm" debug="on"
                   srcServiceName="WSPlmMto_Service"
                   debugLevel="DEBUG" autoDetectWrapped="true" jaxRPCWrappedArrayStyle="true"
                   verbose="on" classpathref="bea-classpath" />
    <!-- unjar to get the all the details so we can tokenize -->
              <unjar dest="${autogen.src.dir}"
                   src="${base.dest}/${bea.build.dir}/compiledWsdl/MRPBindingPort_wsdl.jar" />
    <!-- copy over the impl file -->
              <copy todir="../code/java/src">
                   <fileset dir="${base.dest}/${bea.build.dir}/impl" />
              </copy>
         </target>

    In eclipse, for weblogic 9.2
    Using the wsdlc WebLogic Web Services Ant Task, I am trying to auto-generate the java files for the web service based on the WSDL. I have specified the packageName as one of the parameters. However the java files are being created and packaged based on the TargetNameSpace of the WSDL rather then under the package name specified. Following is part of my build.xml
    autogen.src.dir=../code/java/beaAutoGen
    base.dest=../../../var/build/wsmToPlmWS
    bea.build.dir=beaBuild
         <target name="generate-from-wsdl" depends="prepare">
              <delete dir="${src.dir}" includeemptydirs="true" />
              <delete dir="${autogen.src.dir}" includeemptydirs="true" />
              <wsdlc srcWsdl="../config/sourceWSDL/MRPBindingPort.wsdl"
                   destJwsDir="${base.dest}/${bea.build.dir}/compiledWsdl" destImplDir="${base.dest}/${bea.build.dir}/impl"
                   packageName="com.lmco.iplm.webservices.wsmtoplm" debug="on"
                   srcServiceName="WSPlmMto_Service"
                   debugLevel="DEBUG" autoDetectWrapped="true" jaxRPCWrappedArrayStyle="true"
                   verbose="on" classpathref="bea-classpath" />
    <!-- unjar to get the all the details so we can tokenize -->
              <unjar dest="${autogen.src.dir}"
                   src="${base.dest}/${bea.build.dir}/compiledWsdl/MRPBindingPort_wsdl.jar" />
    <!-- copy over the impl file -->
              <copy todir="../code/java/src">
                   <fileset dir="${base.dest}/${bea.build.dir}/impl" />
              </copy>
         </target>

  • Autotype ant task and java source file having method which  returns hashmap

    Hi Friends,
    I am using autotype ant task to generate types.xml and supporting java classes.
    The task is defined as follows .
    <target name="std">
    <source2wsdd javaSource="HelloWorld.java"
    typesInfo="types.xml"
    ddFile="ddfiles/web-services.xml"
    serviceURI="/HelloWorldService"/>
    </target>
    In my java source i have method which is returning an HashMap. In this scenario I am getting error when i run the task. The error is as follows
    C:\test-ws\javaclass>ant auto
    Buildfile: build.xml
    auto:
    [autotype] Autotyping for javaTypes TestBean
    [autotype] weblogic.xml.schema.binding.BindingException: Invalid class received
    : interface java.util.Map loaded from file:/C:/bea/jdk142_05/jre/lib/rt.jar!/jav
    a/util/Map.class. All classes that will be serialized or deserialized must be n
    on-interface, non-abstract classes that provide a public default constructor
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.en
    sureValidClass(JavaInspector.java:1050)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.fi
    llDescriptor(JavaInspector.java:174)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.ge
    tDescriptor(JavaInspector.java:139)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.cr
    eateBeanProperty(JavaInspector.java:927)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.cr
    eateBeanProperty(JavaInspector.java:905)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.ad
    dPropertiesToScalar(JavaInspector.java:834)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.fi
    llDescriptor(JavaInspector.java:209)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.ge
    tDescriptor(JavaInspector.java:139)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.cr
    eateDescriptorForClass(JavaInspector.java:106)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.Compiler.compile
    (Compiler.java:106)
    [autotype] at weblogic.xml.schema.binding.internal.XSDTypeMappingBuilder.ma
    pClass(XSDTypeMappingBuilder.java:89)
    [autotype] at weblogic.xml.schema.binding.internal.XSDTypeMappingBuilder.ma
    pClass(XSDTypeMappingBuilder.java:102)
    [autotype] at weblogic.xml.schema.binding.internal.TypeMappingBuilderBase.a
    ddMapping(TypeMappingBuilderBase.java:180)
    [autotype] at weblogic.webservice.tools.build.internal.Java2SchemaImpl.doTy
    peMapping(Java2SchemaImpl.java:267)
    [autotype] at weblogic.webservice.tools.build.internal.Java2SchemaImpl.run(
    Java2SchemaImpl.java:167)
    [autotype] at weblogic.ant.taskdefs.webservices.javaschema.JavaSchema.doJav
    a2Schema(JavaSchema.java:302)
    [autotype] at weblogic.ant.taskdefs.webservices.javaschema.JavaSchema.execu
    te(JavaSchema.java:184)
    [autotype] at org.apache.tools.ant.Task.perform(Task.java:341)
    [autotype] at org.apache.tools.ant.Target.execute(Target.java:309)
    [autotype] at org.apache.tools.ant.Target.performTasks(Target.java:336)
    [autotype] at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
    [autotype] at org.apache.tools.ant.Project.executeTargets(Project.java:1255
    [autotype] at org.apache.tools.ant.Main.runBuild(Main.java:609)
    [autotype] at org.apache.tools.ant.Main.start(Main.java:196)
    [autotype] at org.apache.tools.ant.Main.main(Main.java:235)
    BUILD FAILED
    file:C:/test-ws/javaclass/build.xml:62: weblogic.webservice.tools.build.WSBuildE
    xception: Failed to do type mapping - with nested exception:
    [weblogic.xml.schema.binding.BindingException: Invalid class received: interface
    java.util.Map loaded from file:/C:/bea/jdk142_05/jre/lib/rt.jar!/java/util/Map.
    class.  All classes that will be serialized or deserialized must be non-interfac
    e, non-abstract classes that provide a public default constructor]
    Can any one provide the solution for this
    Thanks
    Anantha

    Hi Friends,
    I am using autotype ant task to generate types.xml and supporting java classes.
    The task is defined as follows .
    <target name="std">
    <source2wsdd javaSource="HelloWorld.java"
    typesInfo="types.xml"
    ddFile="ddfiles/web-services.xml"
    serviceURI="/HelloWorldService"/>
    </target>
    In my java source i have method which is returning an HashMap. In this scenario I am getting error when i run the task. The error is as follows
    C:\test-ws\javaclass>ant auto
    Buildfile: build.xml
    auto:
    [autotype] Autotyping for javaTypes TestBean
    [autotype] weblogic.xml.schema.binding.BindingException: Invalid class received
    : interface java.util.Map loaded from file:/C:/bea/jdk142_05/jre/lib/rt.jar!/jav
    a/util/Map.class. All classes that will be serialized or deserialized must be n
    on-interface, non-abstract classes that provide a public default constructor
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.en
    sureValidClass(JavaInspector.java:1050)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.fi
    llDescriptor(JavaInspector.java:174)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.ge
    tDescriptor(JavaInspector.java:139)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.cr
    eateBeanProperty(JavaInspector.java:927)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.cr
    eateBeanProperty(JavaInspector.java:905)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.ad
    dPropertiesToScalar(JavaInspector.java:834)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.fi
    llDescriptor(JavaInspector.java:209)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.ge
    tDescriptor(JavaInspector.java:139)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.JavaInspector.cr
    eateDescriptorForClass(JavaInspector.java:106)
    [autotype] at weblogic.xml.schema.binding.internal.codegen.Compiler.compile
    (Compiler.java:106)
    [autotype] at weblogic.xml.schema.binding.internal.XSDTypeMappingBuilder.ma
    pClass(XSDTypeMappingBuilder.java:89)
    [autotype] at weblogic.xml.schema.binding.internal.XSDTypeMappingBuilder.ma
    pClass(XSDTypeMappingBuilder.java:102)
    [autotype] at weblogic.xml.schema.binding.internal.TypeMappingBuilderBase.a
    ddMapping(TypeMappingBuilderBase.java:180)
    [autotype] at weblogic.webservice.tools.build.internal.Java2SchemaImpl.doTy
    peMapping(Java2SchemaImpl.java:267)
    [autotype] at weblogic.webservice.tools.build.internal.Java2SchemaImpl.run(
    Java2SchemaImpl.java:167)
    [autotype] at weblogic.ant.taskdefs.webservices.javaschema.JavaSchema.doJav
    a2Schema(JavaSchema.java:302)
    [autotype] at weblogic.ant.taskdefs.webservices.javaschema.JavaSchema.execu
    te(JavaSchema.java:184)
    [autotype] at org.apache.tools.ant.Task.perform(Task.java:341)
    [autotype] at org.apache.tools.ant.Target.execute(Target.java:309)
    [autotype] at org.apache.tools.ant.Target.performTasks(Target.java:336)
    [autotype] at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
    [autotype] at org.apache.tools.ant.Project.executeTargets(Project.java:1255
    [autotype] at org.apache.tools.ant.Main.runBuild(Main.java:609)
    [autotype] at org.apache.tools.ant.Main.start(Main.java:196)
    [autotype] at org.apache.tools.ant.Main.main(Main.java:235)
    BUILD FAILED
    file:C:/test-ws/javaclass/build.xml:62: weblogic.webservice.tools.build.WSBuildE
    xception: Failed to do type mapping - with nested exception:
    [weblogic.xml.schema.binding.BindingException: Invalid class received: interface
    java.util.Map loaded from file:/C:/bea/jdk142_05/jre/lib/rt.jar!/java/util/Map.
    class.  All classes that will be serialized or deserialized must be non-interfac
    e, non-abstract classes that provide a public default constructor]
    Can any one provide the solution for this
    Thanks
    Anantha

  • How we write into properties file using get class method

    Hi
    I want to set some value into properties file using given code
    can any one please tell me how i can do this.
    property file
    setting.properties
    Name     =     abc
    and code I use is
    java.io.InputStream oInputStream = this.getClass().getResourceAsStream("Setting.properties");
                   Properties obj = new Properties();
                   obj.load(oInputStream);
                   String myName = obj.getProperty("Name");
                   System.out.println("myName :"+myName);
                   obj.setProperty("Name","def");
                   FileOutputStream oOutput= new FileOutputStream("Setting.properties");
                   obj.store(oOutput, "");
    thanks.

    You can't.
    If you have properties that change dynamically, you should not be using a properties file that sits in the classpath, you should be using Preferences, or a properties file that sits in some application or possibly even user directory, but not one in the classpath. The proper way to do this, would be to have a properties file in your jar (or otherwise in your classpath) that contains the defaults, and another one outside of the classpath in one of the twwo above mentioned areas, then, you read the default one only if the other doesn't exist, or you read the default one first, then read the other overwriting the values from the defaults.
    Don't forget to save the properties again (right after loading if you loaded, or always load, the defaults) after every change.

  • Adding a properties file into SapDictionaryTypesRuntime.jar

    Hi,
    I would like to add a properties file to SapDictionaryTypesRuntime.jar located in plugins\com.sap.dictionary.runtime\lib.
    Could you please help me how i can do  that ?.I tried using WinZip to add a file ,didnt help.

    This jar-file is part of the framework so you should not add anything to it.
    For testing purposes, you can extract the jar-file in its directory, add the property file to some folder and recreate the jar file using the jar-utility.
    Armin

  • How to import JAR file into a class

    I have a JAR file that i need to use the content of that file in another class. But when i use "import" syntax, the compiler list down the error that the class of the JAR file is not found.
    For example,
    import log4j;
    after compile, the error is "Class log4j is not found in import".
    Please help me. Thank you

    A common misconception of the import statement is that it would actually do something. Well, it doesn't. It is only a mark for the compiler that you would like to use the shorter name for the classes mentioned, instead of the fully qualified one. You could use the name "java.awt.datatransfer.Clipboard" everywhere you wanted to use the Clipboard class, did you "import" that package or not.
    You don't have a class called "log4j" so the compiler complains that it can't find it. Instead, you have classes called org.apache.log4j.* (yes, you can use the * to substitute class names), IIRC. So you could use a import statement with "importorg.apache.log4j.*;" but you don't really have to.
    Just make sure that java will found those classes.
    http://java.sun.com/j2se/1.3/docs/tooldocs/findingclasses.html

  • JDeveloper 10g, ADF, ANT:How to define ant task for EAR & WAR file creation

    I am trying to automate the deployment process of our ADF Faces & BC application. I have reviewed this doc:
    http://download.oracle.com/docs/cd/B31017_01/web.1013/b28951/anttasks.htm
    and followed the procedure for integrating ant onto the server. I can build the project and also successfully deploy the ear file. Howerver, I did not find any instruction on how to generate the EAR file. Can anyone point me to the right place for this task definition?
    Here is my current build.xml file.
    <?xml version="1.0" encoding="windows-1252" ?>
    <!--Ant buildfile generated by Oracle JDeveloper-->
    <!--Generated Jul 16, 2007 12:20:13 PM-->
    <project name="CRDBApps" default="build-all" basedir="." xmlns:oracle="antlib:oracle">
    <property file="build.properties"/>
    <property file="ant-oracle.properties"/>
    <target name="clean-all" depends="">
    <ant antfile="build.xml" dir="CRDBView" target="clean"/>
    <ant antfile="build.xml" dir="CRDBLib" target="clean"/>
    <ant antfile="build.xml" dir="CRDBModel" target="clean"/>
    </target>
    <target name="build-all" depends="clean-all">
    <ant antfile="build.xml" dir="CRDBView" target="compile"/>
    <ant antfile="build.xml" dir="CRDBLib" target="compile"/>
    <ant antfile="build.xml" dir="CRDBModel" target="compile"/>
    </target>
    <target name="deployear" depends="">
    <echo message="-----> Deploying the application module deployment (ear) file"/>
    <oracle:deploy deployerUri="deployer:oc4j:opmn://myserver/home"
    userid="oc4jadmin"
    password="password"
    file="CRDBView/deploy/CRDBApps.ear"
    deploymentName="CRDBApps"
    bindAllWebApps="default-web-site"/>
    </target>
    </project>
    thanks!
    Wes

    Thanks all for the tips. After reading up a bit today on ear/war files and ant. I ended up just creating a task to mimic the ear/war file structure. My script isnt pretty but I'll work on refining that later. Here is what I have if anyone ever is interested:
    <target name="war" depends="">
    <echo message="Executing target war..."/>
    <mkdir dir="war"/>
    <copydir src="CRDBView\public_html" dest="war\"/>
    <copydir src="CRDBView\classes" dest="war\WEB-INF\classes"/>
    <copydir src="CRDBModel\classes" dest="war\WEB-INF\classes"/>
    <copydir src="CRDBLib\classes" dest="war\WEB-INF\classes"/>
    <echo message="Creating war file..."/>
    <jar basedir ="war" destfile="CRDBApps.war"/>
    <echo message="Done executing target war..."/>
    </target>
    <target name="ear" depends="war">
    <echo message="Executing target ear..."/>
    <mkdir dir="ear\META-INF"/>
    <copydir src="CRDBView\deploy\META-INF" dest="ear\META-INF"/>
    <copy file="CRDBApps.war" todir="ear\"/>
    <jar basedir ="ear" destfile="CRDBApps.ear"/>
    <echo message="Done executing target ear..."/>
    </target>
    <target name="cleanAndDeployCRDBApps" depends="build-all,deployear">
    <echo message="Executing target cleanAndDeployCRDBApps..."/>
    <delete dir="war"/>
    <delete dir="ear"/>
    <echo message="Done executing target cleanAndDeployCRDBApps..."/>
    </target>
    <target name="deployear" depends="ear">
    <echo message="Executing target deployear"/>
    <oracle:deploy deployerUri="deployer:oc4j:opmn://myserver:6003/home"
    userid="oc4jadmin"
    password="password"
    file="CRDBApps.ear"
    deploymentName="CRDBApps"
    bindAllWebApps="default-web-site"/>
    <delete file="CRDBApps.ear"/>
    <delete file="CRDBApps.war"/>
    <echo message="Done executing target deployear"/>
    </target>
    ...

  • Extract EAR file into java classes

    Hi,
    I have an EAR file and I want to extract it to get java classes, is there any way for it?
    Thanks,
    Uma Nath Tripathi

    EAR, WAR, RAR, and EJB-JAR are just JAR files.
    Use jar xvf filename to get the contents.
    --olaf                                                                                                                                                                                                                   

  • [svn] 4606: Make policy-file-url optional via the ant task.

    Revision: 4606
    Author: [email protected]
    Date: 2009-01-21 09:44:27 -0800 (Wed, 21 Jan 2009)
    Log Message:
    Make policy-file-url optional via the ant task.
    The policy-file-url - takes a empty sting from the command line to separate two urls.
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-18401
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18401
    Modified Paths:
    flex/sdk/branches/3.x/modules/antTasks/src/flex/ant/types/URLElement.java

    Remember that Arch Arm is a different distribution, but we try to bend the rules and provide limited support for them.  This may or may not be unique to Arch Arm, so you might try asking on their forums as well.

  • Are the WLS 9.1 Web Service Ant Tasks ready for prime time?

    I am trying to create a Proof of Concept (POC) for Enterprise and B2B Services at Wendy's Int'l, Inc.
    As part of this POC, I created a WSDL for an in-house service and then used the wsdlc and jwsc Ant Tasks to translate this WSDL to Java classes and ultimately (I hoped) a deployable services.
    In this document, I describe the issues I encountered setting up what I consider to be a simple POC.
    I'll try to attach my WSDL file and build.xml so you can follow along.
    I'll also try to attach my CSS file so you can compare how the generated WSDL appears in the Browser to the way I want it to appear.
    If attachments are not allowed on these forums, then I will wait and see if there is interest in those documents before I paste them under this topic.
    Some preliminary information about my environment.
    Environment:
         Windows XP Pro SP2
         WebLogic 9.1
         Java 1.5.0_04
    Service Name:
         AppRelease
    Note: If I modify my WSDL (perhaps to add a new Operation or to change the definition of an element) and run wsdlc again, the AppReleaseSOAPPortImpl.java file is overwritten For this reason, I implemented my service logic in a class called AppReleaseServiceImple.java.
    Now, for the issues.
    1.     Bug:
    In the WSDL generated by wsdlc, the wsdl:part child of the wsdl:message tag is erroneously prefixed with a colon.
    This occurs whether or not I specify a prefix for the http://schemas.xmlsoap.org/wsdl/ namespace.
    Work around: Extract the wsdl from the jar file, fix it and add it back into the jar.
    2.     Bug:
    In the WSDL generated by wsdlc, the wsdl:input and wsdl:output children of the wsdl:operation child of wsdl:portType tag are erroneously prefixed with a colon. Like 1 above, this occurs whether or not I specify a prefix for the http://schemas.xmlsoap.org/wsdl/ namespace.
    Work around: Extract the wsdl from the jar file, fix it and add it back into the jar.
    The error message generated by Bugs 1 and 2 is not helpful in diagnosing the problem:
    [jwsc] Error at line:46 col:7 ':' expected [?! -- [CDATA[ ]
    3.     Bug:
    In the WSDL generated by wsdlc, the documentation elements have all of my html elements stripped out, as well as my xhtml and wsdl namespace references. This completely negates one of the best features of the documentation tag, being able to present the WSDL in a browser as a nicely formatted, human friendly document which is also the underlying WSDL that can be viewed when the person views the source document.
    I label this as a bug because it greatly reduces the functionality of the resulting WSDL.
    4.     Annoyance:
    The WSDL generated by wsdlc has all of my comments stripped out, except the comments in the xsd:schema section of the wsdl:types element. I would prefer that all my comments be left in the WSDL, but if comments must be stripped out then I think all of the comments should be stripped out.
    5.     Annoyance:
    The WSDL generated by wsdlc has my CSS specification stripped.
    Work around: I don’t know if adding the CSS back will do any good because I have not yet created a deployable service (see the last issue below).
    6.     Annoyance:
    The WSDL generated by wsdlc has different namespace prefixes than the ones I specified for my application's namespace and for the http://schemas.xmlsoap.org/wsdl/soap/ namespace.
    Work around: Perform a find/replace on namespace prefixes "s0" and "s1" to return them to my prefered values.
    Another thing I can do at this point is simply replace the generated WSDL in the jar file with my original WSDL. This would address issues 1 thru 6 above.
    7.     Annoyance:
    The java source files created by wsdlc are put into a jar file. This makes it annoying when working within a traditional IDE like Eclipse because there is no way to reference the source files within the jar as working source.
    Work around: Extract the source files from the jar and identify the resulting directory structure as part of the source structure of the project.
    8.     Bug:
    The jwsc task complains if the same parameter name is used in multiple operations. I received the following Errors from jwsc:
    [jwsc] C:\IDE\workspace\Acre-WL9.1\AppReleaseSOAPPort.java 0:0
    [jwsc] [ERROR] - Parameter element "{http://acre.services.wendys.com/AppRelease/}garRequest" is not unique across document/literal bare WebService.
    Since the operation names are unique, I see no reason to also require uniqueness in the parameter names used by those operations.
    Work around: Use unique element names for the input parameters of the services operations.
    9.     Bug:
    Once items 1, 2 and 8 above are taken care of, jwsc fails with the following error:
    java.lang.AssertionError: java.lang.ClassNotFoundException: weblogic.j2ee.descriptor.ApplicationBeanImpl
    This seems to be due to the weblogic.jar file not being in the System Classpath.
    However, I should note that when I set verbose="on" and debug="on" in the jwsc ant task, there was a message from the task which stated "[jwsc] [search path for class files: [big freakin’ jar list]". In the big freakin’ jar list, I did find weblogic.jar and weblogic.jar has the required ApplicationBeanImpl. This indicates to me that the jwsc task does not fully honor either its classpathref attribute, nor an embedded classpath element.
    Work around: Make sure the weblogic.jar is in the System Classpath.
    10.     Bug:
    I fixed bug #9 by running a setDomainEnv script and then ran my ant task. This time I received the following output:
    ant build-serviceBuildfile: build.xml
    build-service:
    [jwsc] 1 JWS files will be processed.
    [jwsc] Processing JWS: C:\IDE\workspace\Acre-WL9.1\src\com\wendys\services\acre\AppReleaseServiceImpl.java
    [jwsc] JWS: C:\IDE\workspace\Acre-WL9.1\src\com\wendys\services\acre\AppReleaseServiceImpl.java Validated.
    [AntUtil.deleteDir] Deleting directory <some temporary directory>
    BUILD FAILED
    java.lang.ExceptionInInitializerError
    At this point, I am completely stymied about how to proceed.
    I wonder what new issues await once this 10th issue is addressed.
    Really, is this tool set ready for prime time?

    <i>Sorry to hear you are having so many issues with using the WLS 9.1 web service Ant tasks, inside of Eclipse.
    I generally create a User Library for the couple weblogic jars needed, and use it (the User Library) in my Eclipse projects that I create JWSes in.</i><br>
    I also have a separate WebLogic Library in Eclipse (actually 2 libraries since I work with WL 8.1 and now WL 9.1). As you may know, one of the long-standing issues with the Ant integration within Eclipse is the fact that Ant, being an External Tool, does not receive the Project-specific Paths/Libraries. However, since most Java-relevant Ant tasks can take classpath and classpathref attributes, this is usually not an issue. In the case of the BEA-supplied wsdlc Ant task, it is apparent from the verbose/debug console output that wsdlc can see the jars in its classpathref, but it ignores those references when resolving class references and instead only uses the system classpath.
    <p>
    <i>I've only needed the weblogic.jar and xbean.jar, not all the ones you mentioned in an earlier thread of this post.</i><br>
    I have not tried to winnow down exactly which jars are required. I simply included all the jars that exist and were added to the system classpath by the setDomainEnv.bat file created by WebLogic 9.1.
    <p>
    <i>Afterwards, I create an Ant Builder to build the JWS Web Service EAR, as opposed to fiddlin' with Eclipse.</i><br>
    I too use Ant to build my deployable archives. Eclipse is simply my IDE of choice. I validated that all the issues I listed occurred when running Ant from the command line.
    <p>
    <i>If you are interested in how I do it, send me an e-mail (to [email protected]), and I'll send you a zip of one of these JWS projects. The build.xml script for the project, takes care of a lot of the "annoyances" you mentioned, one of which I think is not accurate. I have never had a situation where the wsdlc Ant task "overwrote" my XXXImpl.java file..</i><br>
    Since I'm doing a POC to determine how we want to proceed with developing Web Services and an SOA in general, I tried to perform the same tasks using Axis 2 1.0, the WebLogic 9.1 tools, and XFire 1.1. Overwriting the Impl class is a common failing in the tools which take a WSDL and create Java source files for all three frameworks.
    <p>
    Try my scenario. Add another operation to an existing WSDL, and run the wsdlc Ant Task. The old IMPL class will be over-written.
    <p>
    Because of this, I have a separate Impl class and I make sure that all its methods and annotations match the methods and annotations in the Skeleton Impl class created by wsdlc.
    <p>
    <i>Maybe that's because I use the <exec> Ant task with jar.exe (the xvf options) in my build.xml, to only get what I need out of the .jar/.zip the wsdlc generates. I'm typically only interest in the interface class that my XXXImpl.java file needs to implements, because I use XMLBeans for the input args (and return values) of my web service operations.</i><br>
    Perhaps. I am not using XMLBeans in any of the three frameworks because the resulting service seems to be lighter-weight in all three frameworks if XMLBeans is not used. I'm sure there will be scenarios where XMLBeans is preferred, but I have not encountered that case in this POC.
    <p>
    <i>Regards,
    Mike Wooten</i>
    Thanks for the follow-up.
    Mike McAngus

  • EJB project IDE build dos not include properties files

    We have property files also which we want included as part of the build process
    for EJB projects but if we use the IDE build it does not include them. We have
    to therefore export the IDE build and customize it to include *.properties like
    this
    <zip basedir="${dest.path}" zipfile="${ejb.outputJar}" encoding="UTF8"> <!-- JARs
    filenames are encoded UTF8 --> <zipfileset dir="${project.local.directory}" includes="*.properties"
    /> </zip>
    which causes a problem for us because the exported build file is specific to a
    user's local PC and cannot be used in a team environment.
    How can we have the IDE build include all the files within an EJB project i.e.
    include properties files also.

    Hey Jamie,
    Currently there is no support to include other .properties files into
    the internal build. There's a build.properties that you get as part of
    an EJB project which you could place your values into and use that as
    your template for your team based development and check that into your
    source control.
    If you'd really like to get gross and hack Workshop a little bit you
    could modify the default EJB project template to use your .properties
    file for every EJB project you create. This would then splat a copy of
    your .properties file into the root of the EJB project.
    To do that you'd go to {your BEAHOME}\workshop\templates and crack open
    the ejb-project.zip template zip file and merge your settings into the
    existing build.properties file. This has the same
    effect as replacing the .properties file after you've created your
    project only it keeps you from having to perform that step each time.
    The downside of this is that each person on your team would then have to
    update that template zip file in their workshop installation. (I'd make
    sure to backup the original template file before performing this
    activity so you can always go back to the original template).
    Hope this helps,
    -Michael
    Jamie wrote:
    We have property files also which we want included as part of the build process
    for EJB projects but if we use the IDE build it does not include them. We have
    to therefore export the IDE build and customize it to include *.properties like
    this
    <zip basedir="${dest.path}" zipfile="${ejb.outputJar}" encoding="UTF8"> <!-- JARs
    filenames are encoded UTF8 --> <zipfileset dir="${project.local.directory}" includes="*.properties"
    /> </zip>
    which causes a problem for us because the exported build file is specific to a
    user's local PC and cannot be used in a team environment.
    How can we have the IDE build include all the files within an EJB project i.e.
    include properties files also.

Maybe you are looking for

  • Change Dynamic Link?

    Hi guys I run Pr CC on a Win7 64bit machine and reloaded all my CC programs recently. Previously my dynamic link was set to Audition but now it set itself to AE. I cannot seem to find a way to change it back to Audition in the preferences, which is m

  • Dynamically load jar file

    Hi, I've got an applet (used in a website) which must internally load a jar (the jarname and mainclassname are stored in the database). with a lot of jars (more than 10) and slow-internet users of my applet, it is not an option to add all the jars to

  • TS3694 What is error 3194 and how do I fix it?!

    What is error 3194 and how do I fix it?!

  • Cannot download latest version of Adobe

    I offen get the message "Before reading this file you must have the latest version of Adobe."  I cannot get it to download from any means I try.  I have version 9. Can someone recommend recommendations for downloading? Thanks.  ecs

  • Creating Empty/Blank .mp3 with AIR

    Hello, Is it possible to create a blank or empty .mp3 file having specific duration using Adobe AIR? If it is possible, can any share the documentation and or code for the same. Thanks in advance.