Export project to java source

When exporting the Toplink project to Java source from the Mapping Workbench, is there a way to tell the workbench to include the package name in the generated file? We do this manually now.
Thanks in advance

Yes, in the mapping workbench, select the project, and pick the "Defaults" tab on the right. You can specify the project there.
- Don

Similar Messages

  • How can I specify table owners when I export project to Java source?

    Using TopLink Mapping Workbench, when I export project to Java source, the descriptors is automatically generated like:
    descriptor.addTableName("SOME_TABLE");
    Is there a way to configure the TopLink Mapping Workbench so it generates the descriptors so that the table owner is explicitly specified?
    descriptor.addTableName("SCHEMA_A.SOME_TABLE");
    Thanks!

    You can re-name your tables in the MW to be fully qualified for the name and that's how it will be generated and used.
    Doug

  • Bug with exporting project to java source

    Hi,
    This is in TopLink 9.0.4.2 (Build 040311).
    We're in the process of trying to determine if we should upgrade our TopLink from 2.5 to 9.0.4, and have not yet purchased a support contract because we haven't made the final decision yet, so I'm posting this bug here in hopes that someone can submit the bug.
    In one of our projects, we have an AggregateObjectMapping (AOM) for a Measurement object that is owned by 2 different objects, each with 2 to 4 instances of this Measurement class. I set up the instances of the AOM in the workbench just fine, and looking at the XML descriptors that are written out, it appears fine. Exporting the project session XML file works fine as well. However, when it is exported to a Java file, the instances of the AOM are exported incorrectly as described below.
    Here is the abbreviated mapping of the attributes of the Measurement class:
    <mappings>
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>mPrecision</instance-variable-name>
    <default-field-names>
    <default-field-name>direct field=yPrecision</default-field-name>
    </default-field-names>
    <uses-method-accessing>false</uses-method-accessing>
    <read-only>false</read-only>
    <mapping-class>MWDirectToFieldMapping</mapping-class>
    </mapping>
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>mQuantity</instance-variable-name>
    <default-field-names>
    <default-field-name>direct field=y</default-field-name>
    </default-field-names>
    <uses-method-accessing>false</uses-method-accessing>
    <read-only>false</read-only>
    <mapping-class>MWDirectToFieldMapping</mapping-class>
    </mapping>
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>mUnit</instance-variable-name>
    <uses-method-accessing>false</uses-method-accessing>
    <read-only>false</read-only>
    <reference-descriptor>com.cimsoft.lws.units.Unit.ClassDescriptor</reference-descriptor>
    <private-owned>false</private-owned>
    <uses-batch-reading>false</uses-batch-reading>
    <table-reference-mapping-reference-handle>
    <reference-handle>
    <reference-table>csrSlotGenericValue</reference-table>
    <reference-name>csrSlotGenericValue_csdUnit</reference-name>
    </reference-handle>
    </table-reference-mapping-reference-handle>
    <uses-joining>false</uses-joining>
    <one-to-one-mapping-indirection-policy>
    <indirection-policy>
    <uses-indirection>false</uses-indirection>
    </indirection-policy>
    </one-to-one-mapping-indirection-policy>
    <mapping-class>MWOneToOneMapping</mapping-class>
    </mapping>
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>UNDEFINED_MEASUREMENT</instance-variable-name>
    <mapping-class>MWUnmappedMapping</mapping-class>
    </mapping>
    </mappings>
    Notice that there are two direct to field mappings (mPrecision and mQuantity) and one OneToOneMapping (mUnit). The exported sessions XML file has the correct XML for instances of this object. Here is an example from a class that has 3 instances of this Measurement object mapped:
    <database-mapping>
    <attribute-name>mAlarmSize</attribute-name>
    <read-only>false</read-only>
    <reference-class>com.cimsoft.lws.units.Measurement</reference-class>
    <is-null-allowed>true</is-null-allowed>
    <aggregate-to-source-field-name-associations>
    <association>
    <association-key>unitId</association-key>
    <association-value>csrStock.alarmSizeUnitId</association-value>
    </association>
    <association>
    <association-key>y</association-key>
    <association-value>csrStock.alarmSize</association-value>
    </association>
    <association>
    <association-key>yPrecision</association-key>
    <association-value>csrStock.alarmSizePrecision</association-value>
    </association>
    </aggregate-to-source-field-name-associations>
    <type>oracle.toplink.mappings.AggregateObjectMapping</type>
    </database-mapping>
    <database-mapping>
    <attribute-name>mCurrentSize</attribute-name>
    <read-only>false</read-only>
    <reference-class>com.cimsoft.lws.units.Measurement</reference-class>
    <is-null-allowed>true</is-null-allowed>
    <aggregate-to-source-field-name-associations>
    <association>
    <association-key>unitId</association-key>
    <association-value>csrStock.currentSizeUnitId</association-value>
    </association>
    <association>
    <association-key>y</association-key>
    <association-value>csrStock.currentSize</association-value>
    </association>
    <association>
    <association-key>yPrecision</association-key>
    <association-value>csrStock.currentSizePrecision</association-value>
    </association>
    </aggregate-to-source-field-name-associations>
    <type>oracle.toplink.mappings.AggregateObjectMapping</type>
    </database-mapping>
    <database-mapping>
    <attribute-name>mLotSize</attribute-name>
    <read-only>false</read-only>
    <reference-class>com.cimsoft.lws.units.Measurement</reference-class>
    <is-null-allowed>true</is-null-allowed>
    <aggregate-to-source-field-name-associations>
    <association>
    <association-key>unitId</association-key>
    <association-value>csrStock.lotSizeUnitId</association-value>
    </association>
    <association>
    <association-key>y</association-key>
    <association-value>csrStock.lotSize</association-value>
    </association>
    <association>
    <association-key>yPrecision</association-key>
    <association-value>csrStock.lotSizePrecision</association-value>
    </association>
    </aggregate-to-source-field-name-associations>
    <type>oracle.toplink.mappings.AggregateObjectMapping</type>
    </database-mapping>
    However, here are the corresponding mappings in the exported Java file (with what it really should be manually inserted by me in comments):
         AggregateObjectMapping mAlarmSizeMapping = new AggregateObjectMapping();
         mAlarmSizeMapping.setAttributeName("mAlarmSize");
         mAlarmSizeMapping.setReferenceClass(com.cimsoft.lws.units.Measurement.class);
         mAlarmSizeMapping.setIsNullAllowed(true);
         mAlarmSizeMapping.addFieldNameTranslation("csrStock.alarmSizeUnitId", "unitId");
         mAlarmSizeMapping.addFieldNameTranslation("csrStock.alarmSize", "y");
         mAlarmSizeMapping.addFieldNameTranslation("csrStock.alarmSizePrecision", "yPrecision");
         descriptor.addMapping(mAlarmSizeMapping);
         AggregateObjectMapping mCurrentSizeMapping = new AggregateObjectMapping();
         mCurrentSizeMapping.setAttributeName("mCurrentSize");
         mCurrentSizeMapping.setReferenceClass(com.cimsoft.lws.units.Measurement.class);
         mCurrentSizeMapping.setIsNullAllowed(true);
         mCurrentSizeMapping.addFieldNameTranslation("csrStock.currentSize", "alarmSize");
         mCurrentSizeMapping.addFieldNameTranslation("csrStock.currentSizeUnitId", "unitId");
         mCurrentSizeMapping.addFieldNameTranslation("csrStock.currentSizePrecision", "alarmSizePrecision");
         // should be: mCurrentSizeMapping.addFieldNameTranslation("csrStock.currentSize", "y");
         // should be: mCurrentSizeMapping.addFieldNameTranslation("csrStock.currentSizePrecision", "yPrecision");
         descriptor.addMapping(mCurrentSizeMapping);
         AggregateObjectMapping mLotSizeMapping = new AggregateObjectMapping();
         mLotSizeMapping.setAttributeName("mLotSize");
         mLotSizeMapping.setReferenceClass(com.cimsoft.lws.units.Measurement.class);
         mLotSizeMapping.setIsNullAllowed(true);
         mLotSizeMapping.addFieldNameTranslation("csrStock.lotSizeUnitId", "unitId");
         mLotSizeMapping.addFieldNameTranslation("csrStock.lotSize", "currentSize");
         mLotSizeMapping.addFieldNameTranslation("csrStock.lotSizePrecision", "currentSizePrecision");
         // should be: mLotSizeMapping.addFieldNameTranslation("csrStock.lotSize", "y");
         // should be: mLotSizeMapping.addFieldNameTranslation("csrStock.lotSizePrecision", "yPrecision");
         descriptor.addMapping(mLotSizeMapping);
    It appears that the actual Measurement descriptor is being modified accidentally as it's being exported, as you'll notice that the first mapping (for mAlarmSize) correctly maps the default "y" to "alarmSize", and then the next mapping (for mCurrentSize) instead of mapping "y" to "currentSize" maps "alarmSize" to "currentSize", and the next AOM maps "currentSize" to "lotSize" instead of "y" to "lotSize".
    Thanks,
    Greg

    No one ever responded, so I'm commenting to bring it up again. It turns out that the error happens not just exporting to Java, but anytime the command-line project generation is used. If the Workbench is used to export either to XML or to a Java file, the file is generated correctly. It is not generated correctly if you try to do it from the commandline (e.g. from a build environment).
    This has happened with 9.0.4.2 through the current 9.0.4.5.
    Here are different ways I've tried doing it from the commandline, and they all generate the erroneous XML and Java files:
    java oracle.toplink.workbench.external.api.JavaSourceGenerator inputMWP outputJava.java
    and
    java oracle.toplink.workbench.external.api.DeploymentXMLGenerator inputMWP outputXML.xml
    which are recommended by the documentation. Also recommended by the documentation:
    JavaSourceGenerator.generate( inputFile, outputFile )
    and
    DeploymentXMLGenerator.generate( inputFile, outputFile ).
    From decompiling the management workbench to see what it was doing differently:
    MWProject project = WorkbenchSession.instance().openProject( inputFile );
    if ( doXML )
    project.setProjectDeploymentXmlDirectory( directory );
    project.setProjectDeploymentXmlFileName( filename );
    project.exportDeploymentXml();
    else
    project.setProjectSourceRootDirectory( directory );
    project.setProjectClassName( classname );
    project.exportJavaSource( outputFile );
    //Also tried plain old project.exportJavaSource(); which appears to actually do something different.
    Any ideas? It looks like a bug to me, particularly that different java or XML deployment files are generated when run from the commandline versus run from the UI. Obviously, the commandline is very important because it is what the build system needs.
    Thanks,
    Greg

  • Missing setup statements when exporting to java source code

    We are moving from Toplink 9i to Toplink 10g. (I know, we're a little behind the times). I saved the project in 10g checked to make sure all the settings were the same as in the 9i project. When I export the project to java source code, we're missing the following configuration setup statements.
    Has anyone else run in to this issue? (login is a DatabaseLogin object)
         // Configuration properties.
         login.setUsesNativeSequencing(false);
         login.setSequencePreallocationSize(50);
         login.setSequenceTableName("SEQUENCE");
         login.setSequenceNameFieldName("SEQ_NAME");
         login.setSequenceCounterFieldName("SEQ_COUNT");
         login.setShouldBindAllParameters(false);
         login.setShouldCacheAllStatements(false);
         login.setUsesByteArrayBinding(true);
         login.setUsesStringBinding(false);
         if (login.shouldUseByteArrayBinding()) {
              login.setUsesStreamsForBinding(false);
         login.setShouldForceFieldNamesToUpperCase(false);
         login.setShouldOptimizeDataConversion(true);
         login.setShouldTrimStrings(true);
         login.setUsesBatchWriting(false);
         if (login.shouldUseBatchWriting()) {
              login.setUsesJDBCBatchWriting(true);
         login.setUsesExternalConnectionPooling(false);
         login.setUsesExternalTransactionController(false);

    These settings are all the defaults, so not required. The project code generation no longer includes defaults.
    -- James : http://www.eclipselink.org

  • How can I share a *.java source file across multiple projects in NetBeans?

    I'm sure this simple and a pretty common operation but how can I share a *.java source file across multiple projects in NetBeans? Right now I keep cut, coping and pasting the same source file between multiple projects to re-use the same code. But I could I make this source file a library file or something like that so that I could access it from any project. I assume this would be a generic operation but I mentioned NetBeans for clarity. Thanks.

    fiebigc wrote:
    I know I mentioned NetBeans but I'm most interested in the generic method for creating a library of source files that I can call into whatever program I am developing. I've done such a thing in C using header files and such but I'm trying to get a direction on how this is accomplished in Java. I'm sorry if I could edit the title I would. If anyone wants to be specific about NetBeans I welcome that too.
    Edited by: fiebigc on Jun 20, 2008 5:57 PM
    >I know I mentioned NetBeans but I'm most interested in the generic method for creating a library of source files that I can call into whatever program I am developing. I've done such a thing in C using header files and such but I'm trying to get a direction on how this is accomplished in Java. I'm sorry if I could edit the title I would. If anyone wants to be specific about NetBeans I welcome that too.
    Edited by: fiebigc on Jun 20, 2008 5:57 PM
    Create a class library.
    Write your code, compile it to .class files, put those class files in a .jar file and include the jar file in the classpath whenever you want to compile a project against it.

  • Getting all the members (variables, methods AND method bodies) of a java source file

    For a project I want to programmatically get access to the members of java source file (member variables, methods etc) as well as to the source code of those members. My question is what is the best method for this? So far I have found the following methods:
    Use AST's provided by the Java Source API and Java Tree API, as discussed in the following posts:
    http://today.java.net/pub/a/today/2008/04/10/source-code-analysis-using-java-6-compiler-apis.html
    http://weblogs.java.net/blog/timboudreau/archive/2008/02/see_java_code_t.html
    http://netbeans.dzone.com/announcements/new-class-visualization-module
    This has the disadvantage that the classes actually have to be compilable. When I look at the Netbeans Navigator view however, it provides me with a nicely formatted UI list, regardless of the "compilable" state of the class.
    Thus I started looking at how to do this... The answer appears to be through the use of tools such as JavaCC: https://javacc.dev.java.net/
    ANTLR: http://www.antlr.org/
    which are lexers and parsers of source code. However, since the Navigator panel already does this, couldn't I use part of this code to get me the list of variables and methods in a source file? Does the Navigator API help in this regard?
    Another route seems to be through tools such as
    BeautyJ: http://beautyj.berlios.de/
    which run on top of JavaCC if I am correct, and which has the ability to provide a clean view on your java code (or an XML view). However, BeautyJ does not seem to be too actively developed, and is only j2se1.4 compatible.
    I hope someone can shed a light on the best way to go about what I want to achieve. Somebody already doing this?
    (I crossposted on the Netbeans forums too, hope this is OK...)

    I'm currently developing a LaTeX editor(MDI) and I do the same thing, but I don't know what exactly do you need.

  • How to convert class file to Java source code ?

    Hi All ,
    Currently am working in Peoplesoft Demo project using java as Plug in.We have only the class files and jar files and we have planned to modify the code for future enhancements.We dont have any legal issues here as we are already working with our client for the original source code.
    Kindly help me out in doing this reverse engineering process.We have come to know the below steps would help us out.Can someone guide us in acheiving this process step by step.Please add your experience here and let us know what are the other steps required ..
    (1)Rename the file from .jar to .zip and extract the .zip file.
    (2)Decompile the desired .class file using 3rd party tool and get .java file.
    (3)Modify the .java file and compile it.
    (4)Now zip the extracted files and rename the it from .zip to .jar.
    We need to verify whether the modified .jar file will work
    Thanks & Regards
    Kar1983

    Thanks for your reply ....We have asked them so many times ..but they say they dont have it .Since we have planned to do some enhancements from our end we have planned to do reverse engineering process.

  • How to read the Java source code (in Netbeans)

    I use OS X10.5.5, NetBeans 6.1 and JSE 6 on a 64 bit mac.
    When I downloaded NB6.1 it had JSE 5 as it's default (and only) java platform. I ran Software Update to get Java 6 from Apple, used the Java Prefrences utitlity to set JSE6 as default. In NB I added the JDK6 platform, registered the JDK6 javadocs and noticed that I also have the option of registering the Java source code.
    I have three questions:
    1) How do I make JDK6 the default in NetBeans. The JDK5 keeps being default after I did the steps above and I don't see anywhere to change that.
    2) How do I read the Java 6 source code? I can see sun provides [source code| http://download.java.net/jdk6/] for their supported platforms. I dont see Apple doing the same for its JDK port. What would I need to do to get to read the java SE6 sources? or is it actually hiding somewhere in the /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home hierarchy?
    3) Where does the JVM look for the binary code to run when I make a call to, say java.util.ArrayList or any other library. In my naivety I would have assumed it would be a .class file somewhere in the java Home folder, but I don't see anything like it.
    thanks in advance,
    chris

    This is taken from the help included with netbeans. In response to question 1.
    By default, the IDE uses the version of the Java SE platform (JDK) with which the IDE runs as the default Java platform
    for compilation, execution, and debugging. You can view your IDE's JDK version by choosing Help > About and clicking the
    Detail tab. The JDK version is listed in the Java field.
    You can run the IDE with a different JDK version by starting the IDE with the --jdkhome jdk-home-dir switch on the command line
    or in your IDE-HOME/etc/netbeans.conf file. For more information, see IDE Startup Parameters.
    In the IDE, you can register multiple Java platforms and attach Javadoc and source code to each platform. For example, if you
    want to work with the new features introduced in JDK 5.0, you would either run the IDE on JDK 5.0 or register JDK 5.0 as a
    platform and attach the source code and Javadoc to the platform.
    In  , you can switch the target JDK in the Project Properties dialog box. In  , you have to set the target JDK in the Ant script itself,
    then specify the source/binary format in the Project Properties dialog box.
    To register a new Java platform:
    Choose Tools > Java Platforms from the main window.
    Click New Platform and select the directory that contains the Java platform. Java platform directories are marked with a  
    in the file chooser.
    Use the Sources and Javadoc tabs to attach Javadoc documentation and source code for debugging to the platform.
    Click Close.
    To set the default Java platform for a standard project:
    Right-click the project's root node in the Projects window and choose Properties.
    In the Project Properties dialog box, select the Libraries node in the left pane.
    Choose the desired Java platform in the Java Platform combo box.
    Switching the target JDK for a standard project does the following:
    Offers the new target JDK's classes for code completion.
    If available, displays the target JDK's source code and Javadoc documentation.
    Uses the target JDK's executables (javac and java) to compile and execute your application.
    Compiles your source code against the target JDK's libraries.
    If you want to register additional Java platforms with the IDE, you can do so by clicking the Manage Platforms button.
    Then click the Add Platform button and navigate to the desired platform.
    To set the target Java platform for a free-form project:
    In your Ant script, set the target JDK as desired in the javac, java, and javadoc tasks.
    Right-click the project's root node in the Projects window and choose Properties.
    In the Sources panel, set the level of JDK you want your application to be run on in the Source/Binary Format combo box.
    When you access Javadoc or source code for JDK classes, the IDE searches the Java platforms registered in the
    Java Platform Manager for a platform with a matching version number. If no matching platform is found, the IDE's default platform is used instead.
    See Also
    Managing the Classpath
    Declaring the Classpath in a Free-Form Project
    Stepping Through Your Program
    Legal Notices

  • Java web service -- how to re-generate Java sources when WSDL changes?

    I created a new web service using the "Java Web Service from WSDL" wizard.
    Some time later I changed the WSDL and now I need to rebuild the Java sources. What is the best way to do this? I can't re-run the wizard, it returns an error: "The name of this web service is already used by another web service in this project."
    Using Jdeveloper 11.1.1.3.0 on Linux.
    Thanks.

    These links may helpful for you.
    http://download.oracle.com/docs/cd/E14004_01/books/SSDev/SSDev_CustomizingModel22.html
    http://download.oracle.com/docs/cd/B31017_01/core.1013/b28764/web_services003.htm

  • 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 i can make  my own connection in java source of a jsp page

    How i can make my own connection in java source of a jsp page (How to get connection from JNDI datasource address) ?
    imagine that i have a rowset in a web page , now i want to do some operation using
    plain JDBC , so i will need a connection object.
    I tried to get one of my rowsets connection but it return null ?
    what is best way to retrive a connection from JNDI datasource that we define for our project?
    for example if i have
    myRowSet.setDataSourceName("java:comp/env/jdbc/be");
    in web page constructor
    now i want a pure connection from the same datasource ? JNDI
    Thank you

    It is not hard to get your own connection from datasource.
    in your case you need to do like the the following code.
    i provide sample to show you how to catch the exception and create an statement .
    Connection con =null;
    try{
    InitialContext ctx = new InitialContext();
    DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/be");
    con = ds.getConnection();
    java.sql.Statement st =con.createStatement();
    }catch(SQLException sqlex){
    sqlex.printStackTrace();
    sqlex.getNextException().printStackTrace();
    catch(NamingException nex){
    nex.printStackTrace();
    hth
    Masoud kalali

  • The command oracg fails to generate Java source files

    I tried to use the command 'oracg -schema Openshipments.xdr' to generate Java source files from
    XML schema file Openshipments.xdr . Although the schema file is valid, the command oracg fails with following error messages :
    file:/D:/romel/project/UPS/doc/Openshipments.xdr<Line 6, Column 47>:
    XSD-2026: (Error) Invalid attribute 'name' in element 'element'
    file:/D:/romel/project/UPS/doc/Openshipments.xdr<Line 6, Column 47>:
    XSD-2030: (Error) Element 'schema' has invalid namespace:
    'urn:schemas-microsoft-com:xml-data'
    file:/D:/romel/project/UPS/doc/Openshipments.xdr<Line 6, Column 47>:
    XSD-2027: (Error) Invalid element 'ElementType' in 'schema'
    file:/D:/romel/project/UPS/doc/Openshipments.xdr<Line 6, Column 47>:
    XSD-2027: (Error) Invalid element 'ElementType' in
    'schema'file:/D:/romel/project/UPS/doc/Openshipments.xdr<Line 6, Column
    47>: XSD-2027: (Error) Invalid element 'ElementType' in 'schema'
    file:/D:/romel/project/UPS/doc/Openshipments.xdr<Line 6, Column 47>:
    XSD-2027: (Error) Invalid element 'ElementType' in 'schema'
    file:/D:/romel/project/UPS/doc/Openshipments.xdr<Line 6, Column 47>:
    XSD-2027: (Error) Invalid element 'ElementType' in 'schema'
    file:/D:/romel/project/UPS/doc/Openshipments.xdr<Line 6, Column 47>:
    XSD-2027: (Error) Invalid element 'ElementType' in
    'schema'file:/D:/romel/project/UPS/doc/Openshipments.xdr<Line 6, Column
    47>: XSD-2027: (Error) Invalid element 'ElementType' in 'schema'
    file:/D:/romel/project/UPS/doc/Openshipments.xdr<Line 6, Column 47>:
    XSD-2027: (Error) Invalid element 'ElementType' in 'schema'
    ...... the above line is repeated many times
    Error: Schema Class Generator failed to generate classes.
    oracle.xml.parser.schema.XSDException: Invalid attribute 'name' in
    element 'element'

    Your schema is not a valid XML Schema. Please check up with the syntax.
    Thanks.

  • When exporting projects in AP2.....

    what does "consolidate images into exported projects" mean? Is it best to leave the box unchecked or to check it? Does it make any difference when importing these projects back into AP2 or AP3 if they are or are not consolidated?

    If you want the project to be full importable exactly as it is in the source library when it is imported into a completely different library you will probably need to check consolidate masters - it does two things - first if any of the masters are referenced it includes them in the exported project the second think is that it includes image masters that may exist in other projects that happen to show up in albums for the exported project.
    Hope that clears things up.
    Easy enough to experiment on your own.
    RB

  • Do we have INCLUDE=JAVA CLASS AND INCLUDE=JAVA SOURCE OPTION IN DATA PUMP

    Hi All ,
    Can any one please tell me ,
    how to import only java class and java source from datapump export file.
    Include=java class or include=java source is not working ..
    Thanks in advance,
    Sanjeev.

    Duplicate post.
    datapump include option.
    Lock this thread

  • Java Source to IA-32 Compilation

    One of the features of Java that Sun has always pushed is cross-platform compatability. Thus the need for a VM. However, if I'm only writing an application for Windows, is there a way to compile my Java source code directly to a binary executable compatible with the IA-32 architecture(Intel)? I realize the JVM is more than just an interpreter for byte code, but the JVM can also be a drag on performance.

    There are tools that can be purchased that will do that. The question is, "why?" Why use java for windows only code? As for the JVM a drag on perfomance, in the old days sure. Now it is negligible. Things like the hotspot VM do smart compiles to machine code inline and a bunch of other tricks. The most common reason why some java apps run slow is the ancient one. Basically that the java programmer that wrote it didnt know what he was doing. Examples: People that use GUI builder tools like that in JBuilder (Id love to throw all those dorks out the window). People that program in an OO language in a non OO fasion. People that believe that they will just go get a bigger cpu instead of refactoring the code to make it efficient.
    The average code block in my department gts rewritten something like 5 times. If you look at the old stuff it is so stable and efficient that running JUnit on it is almost a waste of time and its classes are excluded from all JProbe tests.
    Just what kind of project are you trying to code anyway ?

Maybe you are looking for