Java Core Program :: Dynamic Object Creation for Classe & Invoking the same

Hi,
I need to create a dynamic object for a class & invoke it.
For eg: I have a table in my DB where all the names of my java classes are stored. I need to call name from the table of the DB and call that class dynamically in my java program.
ResultSet_01 = executeQuery("select classname from class_table where class_descrip = 'Sales Invoice' ");
               while(ResultSet_01.next())
                    String class_name = ResultSet_01.getDouble("classname");
               }Now using the string in class_name that is fetched from ResultSet_01, I need to create an object for the class_name & invoke the class that is been created with the same name.
Thank in advance.
Regards,
Haider Imani

Well for a start since a class name is a String, not a number you'd better start by getting the name with getString() not getDouble().
You need to work with fully qualified names, (FQNs) like "com.acme.myproject.MyDynamicClass", not just the bare MyDynamicClass.
The next question is where the .class files for the dynamically loaded classes are stored. If they are part of your normal program code, on the class path, then you can use Class.forName to load the class and return a Class object. If they are in some special place you'll need to create a URLClassLoader and get the Class from that.
Generally, when you load a class this way, it should implement some known interface, or extend some know abstract class. By placing objects of the dynamic class in a reference to that interface you can use the methods defined in the interface.
The usual way of getting an instance of a dynamic class is to call newInstance() on the Class object.

Similar Messages

  • Is it possible to restrict the object creation for stateless session beans

    Hi,
    Is it possible to restrict/fix the ejb object creation for stateless session beans in application server?
    For example, i want to configure the application server ( am using JBOSS ) to create maximum of 10 session bean objects. and if any requests for the stateless session bean come, as application server has created 10 objects, the requests should be blocked.
    Thanks in advance,
    nvseenu

    You can keep a counter in the application code. A static var won't work, but an entity and a consistent id should. This version would affect performance, but it would be portable to other app servers.
    // ConstrainedBean.java
    package unq.ejb;
    import javax.ejb.Stateless;
    import javax.ejb.CreateException;
    import javax.annotation.PostConstruct;
    import javax.annotation.PreDestroy;
    import javax.persistence.PersistenceContext;
    import javax.persistence.EntityManager;
    @Stateless
    public class ConstrainedBean implements Constrained {
        final static int DEFAULT_COUNTERID = 1;
        @PersistenceContext EntityManager em;
        @PostConstruct
        protected void init() throws CreateException {
         ConstrainedBeanCounter counter =
             em.find(ConstrainedBeanCounter.class, DEFAULT_COUNTERID);
         if( counter == null ) {
             counter = new ConstrainedBeanCounter();
             counter.counterId = 1;
             counter.counterValue = 0;
             em.persist(counter);
         if( counter.atMaximum() ) {
             throw new CreateException("error attempting to create > 10 beans");
         else {
             counter.increment();
        @PreDestroy
        protected void destroy() {
         ConstrainedBeanCounter counter = em.find(ConstrainedBeanCounter.class,
                                   DEFAULT_COUNTERID);
         counter.decrement();
        public void doSomething() { System.out.println("doSomething()"); }
    // ConstrainedBeanCounter.java
    package unq.ejb;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    @Entity
    public class ConstrainedBeanCounter implements java.io.Serializable
        @Id public int counterId;
        public int counterValue = 0;
        public void increment() {
         counterValue++;
        public void decrement() {
         counterValue--;
        public boolean atMaximum() {
         return counterValue > 9;
    }

  • MXML Dynamic Object Creation

    Hi ,
    Static Object Creation :
    Eg:
        <mx:Fade id="ViewStack_EffectStart" duration="500" alphaFrom="0.0" alphaTo="1.0"/>
        <mx:Fade id="ViewStack_EffectEnd" duration="500" alphaFrom="1.0" alphaTo="0.0"/>
    <comp:ErrorBox id="errorBox" active="{active}" showEffect="{ViewStack_EffectStart}" hideEffect="{ViewStack_EffectEnd}"/> .
    The above static objects is working fine, but the problem is that we have lot of similiar static object which creates a memory issue.If we create dynamic objects, will it avoid the issue.Is dynamic objects advisible?.
    Thanks in advance.Please reply ASAP.
    Thanks ,
    San.

    hmn.. I don't understand your questions fully.
    What about create the fade object in "Model" and reference the same Fade object for all dynamic objects?
    or r u asking to find out how to create fade in actionscript?
    var fade:Fade = new Fade();
    fade.target = this;
    fade.alphaFrom = 0;
    fade.alphaTo = 1;
    fade.play();
    hope this helps,
    BaBo,

  • Java.io.IOException: No serializer found for class..............

    Hi All,
    I am tring to send an object to a webservice. But when I run the code it throughs an Exception:
    - Exception:
    java.io.IOException: No serializer found for class com.tourico.webservices.impl.BookHotelTypeImpl$HlTypeImpl in registry org.apache.axis.encoding.TypeMappingDelegate@14b6b02
         at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1429)
         at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:914)
         at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:677)
         at org.apache.axis.message.MessageElement.outputImpl(MessageElement.java:1247)
         at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
         at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:265)
         at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1426)
         at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:914)
         at org.apache.axis.message.RPCParam.serialize(RPCParam.java:200)
         at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:433)
         at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
         at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
         at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:477)
         at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
         at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:315)
         at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:269)
         at org.apache.axis.SOAPPart.saveChanges(SOAPPart.java:530)
         at org.apache.axis.attachments.AttachmentsImpl.getAttachmentCount(AttachmentsImpl.java:519)
         at org.apache.axis.Message.getContentType(Message.java:475)
         at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:343)
         at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
         at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
         at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
         at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
         at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
         at org.apache.axis.client.Call.invoke(Call.java:2748)
         at org.apache.axis.client.Call.invoke(Call.java:2424)
         at org.apache.axis.client.Call.invoke(Call.java:2347)
         at org.apache.axis.client.Call.invoke(Call.java:1804)
         at com.tourico.webservices.HotelsServiceSoapStub.bookHotel(HotelsServiceSoapStub.java:488)
         at TestClient.main(TestClient.java:892)
    Any help will be appreciated
    Thanks
    Sandeep

    Hi,
    Is this class com.tourico.webservices.impl.BookHotelTypeImpl$HlTypeImpl implements java.io.Serializable ?
    --Marc (http://jnative.sf.net)                                                                                                                                                                                                                                                                                               

  • While using Firefox, a site popped up and said it was Firefox scanning for viruses. It then said I had dangerous viruses and should download a security program. Is this for real? The site was update32.escmce.ce.ms

    While using Firefox, a site popped up and said it was Firefox scanning for viruses. It then said I had dangerous viruses and should download a security program. Is this for real? The site was update32.escmce.ce.ms I googled this site and it does not exist. Now, I am worried about the security on my computer.

    If you're running under Windows, I suggest you download and install Microsoft's Security Essentials. It protects against these types of attacks and tends to find stuff that other anti-virus scanners don't find. You're system could be infected because of that bogus, evil anti-virus scan. Install and run the software while in safe mode.

  • Cannot acess classes in the same package.

    Hi
    I have "a.java" in c:/java/test directory. I have "b.java" file in the same directoty which creates a instance of "a" class. "a.java" compiled fine. But when compliling "b.java" i get error message
    cannot resolve symbol
    symbol : class a
    I have used "public" as acess modifier for both the classes. As per rule I can access the classes in the same package. But for some reason my program is not compiling. Can anyone tell me what the acutal problem is.
    Thanks in advance.

    Javapedia: Classpath
    Setting the class path (Windows)
    How Classes are Found
    java -cp .;<any other directories or jars> YourClassNameYou get a NoClassDefFoundError message because the JVM (Java Virtual Machine) can't find your class. The way to remedy this is to ensure that your class is included in the classpath. The example assumes that you are in the same directory as the class you're trying to run.
    javac -classpath .;<any additional jar files or directories> YourClassName.javaYou get a "cannot resolve symbol" message because the compiler can't find your class. The way to remedy this is to ensure that your class is included in the classpath. The example assumes that you are in the same directory as the class you're trying to run.

  • Signing 2 different classes in the same package differently.

    I have a class B in the default package.
    I have another class C which is kept in a jar file without any package information. I have signed this jar file in using one alias in my keystore.
    class B instantiates class C and passes its own reference to it.
    When I run class B, i get an error saying,
    Exception in thread "main" java.lang.SecurityException: class "C"'s signer information does not match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(ClassLoader.java:599)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:532)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    at B.main(B.java:23)
    Does this mean, I cannot have 2 classes in the same package, signed differently?
    Thanks
    AahRiMaaN

    coupdegrace wrote:
    JoachimSauer wrote:
    Force1 wrote:
    Do the files get automatically compiled if they are in the same package ?No, but if the class you compile depends on another that's not yet been compiled (or for which the source is newer than the .class file), then it will be compiled as well.Like,say If i add a int parameter, amethod(int i),then I will get a error,isn't it ?It actually gives a error.
    Also it will compile automatically only for the first time and any changes made to any file will have to be compiled into latest .class files ?Yes.
    Did compile the files under the above constraints.
    So it is a smooth "run" for the first time,but not after editions to the either files.
    I would appreciate if experts give some feedback on this.
    Thank you.

  • If I have 2 tv's and each their own apple tv can I display the same program to them from my macbook at the same time?

    If I have 2 tv's and each their own apple tv can I display the same program to them from my macbook at the same time?
    for instance Keynote?

    Welcome to the Apple community.
    The Apple TV cannot display keynote presentations or websites from the computer. It can display them via mirroring from the iPad 2 or better or the iPhone 4S.
    You cannot AirPlay to 2 Apple TV 2's at the same time from an iOS device. You can watch the same video, TV show or listen to the same music from your iTunes library on multiple Apple TV's at the same time.

  • Multiple classes in the same source file

    I'm not sure what this is called, having multiple classes in the same source file. At first I thought it ws called subclassing but then I googled it and found that subclasses are just derived classes. Here's an example of what I'm talking about.
    public class A {
    class B {
    class C {
    }So first of all, what is having multiple classes in the same source file called?
    Secondly, what are the advantages/disadvantages of this?
    Thirdly, can you have a class completely WITHIN a class (same source file but inside the class not outside) and what are the advantages/disadvantages of this?

    Advantage: You can reduce the number of source files specialy when your secondry classes are used only in the public class of the file.
    Disadvantage: Normaly it make things more clear if we have one-to-one correspondance of class and source files. This make things easy when you want to find the java file of a perticuler class file. Also If you later wanted to create a seperate public class with a same name as one of those secondry classes you got lots of changes to do.
    You can avoid this by creating them as nested classes
    ex:-
    public class MyPublicClass{
       private static class MyInnerClass{
    }this way the inner class will create a class file with name "MyPublicClass$MyInnerClass.class" instead of just "MyInnerClass.class"
    And also if you declare the inner class as public you can access them from out side

  • Reflection Classes with the same name

    Hi!
    I have a big problem with reflection. I want to reflect lots of stuff (methods, variables...) in a lot of classes with the same name immediately one after the other. It's like
    copy the file for the analysis to the right place
    do reflection and get results
    copy next file for analysis
    Important to note is, that all of the files that should be reflected have the same name.
    When I run the programm, he always only reflects the first file I gave for analysis, although I know the copying-stuff works and the new file would be there for analysis (but he does not seem to load/use it).
    Any ideas what i could do?
    Thanks!
    ET

    I'm not sure if i'm authorised to tell too much
    details, but i have to do some automated software
    analysis and therefore I need to know whats inside of
    a class and string search would not be appropriate.Why not ? What aspects of the class are you trying to examine ?
    They have the same name, because they are delivered in
    that form from a third party and it would be too much
    effort (and to much risk of errors) to rename them.Sure, if they're delivered as class files, you're unable to rename them. Without knowing more I can't advise you further.
    Why are you interested that much in that topic? Do you
    have to perform a similar task?No, I'm trying to determine if reflection is the right tool for the job. Frankly it doesn't sound like it is. But since you're not authorised to tell me more, I can't help you more.
    Dave.

  • HELP: signer info doesn't match info of other classes in the same package

    I have several jars which need to be signed. They contain several applications and packages which
    are split up based on which parts are needed by server vs client code. How do I get rid of this error?
    I'm signing all the jars using the keytool and jar signer in java 1.3.1. I generate a certificate file.
    My assumption is that each time I sign a different jar, the info is updated in the keystore and
    certificate file. What might I be doing wrong when signing multiple jars?
    (Yes, code from the same package may be in different jars. I don't have any controll of this,
    I'm not in charge of the build and distribution of the various packages).
    Exception in thread "main" java.lang.SecurityException: class
    "com.ibm.ucm.bootup.UCMSysMgtConstants"'s signer information does not match signer
    information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at com.ibm.ucm.bootup.UCMServerUpdater.<init>(Unknown Source)
    at com.ibm.ucm.bootup.UCMServerUpdater.<init>(Unknown Source)
    at com.ibm.ucm.bootup.UCMAdminServerUpdater.<init>(Unknown Source)
    at com.ibm.ucm.bootup.UCMAdminServerUpdater.main(Unknown Source)

    Where you able to solve this issue? (I'm seeing the same problem.)
    Thanks,
    Stacy

  • Two classes have the same XML type name??? Please, help...

    Hello!
    I have a simple web service class. I generated the ws server-side classes using wsgen.
    I created a jar file from the generated code.
    Then :
    Endpoint endPoint = Endpoint.create(
    new WebServicesUnitImpl()
    String wsFinalName = "http://localhost:9999/akarmi";
    endPoint.publish( wsFinalName );
    The web service started fine.
    Then called wsimport, and the generated classes have been placed into a jar file.
    Then called the code like this:
    WebServicesUnitImplService service = new WebServicesUnitImplService();
    WebServicesUnitImpl unit = service.getWebServicesUnitImplPort();
    unit.serviceXXX();
    but the code doesn't work at all, resulting this error message:
    Two classes have the same XML type name "{http://ws.components.core.ilogique.vii.com/}getMessages". Use @XmlType.name and @XmlType.namespace to assign different names to them.
         this problem is related to the following location:
              at com.vii.ilogique.core.components.ws.GetMessages
              at public com.vii.ilogique.core.components.ws.GetMessages com.vii.ilogique.core.components.ws.ObjectFactory.createGetMessages()
              at com.vii.ilogique.core.components.ws.ObjectFactory
         this problem is related to the following location:
              at com.vii.ilogique.core.components.ws.GetMessages
    I have this error report on all generated class file! How can i fix this?
    What is the main problem? The SE usage? I copied the lates jax-ws jars into endorsed lib resulting the same.
    Any help is appreciate.

    Hello!
    I have a simple web service class. I generated the ws server-side classes using wsgen.
    I created a jar file from the generated code.
    Then :
    Endpoint endPoint = Endpoint.create(
    new WebServicesUnitImpl()
    String wsFinalName = "http://localhost:9999/akarmi";
    endPoint.publish( wsFinalName );
    The web service started fine.
    Then called wsimport, and the generated classes have been placed into a jar file.
    Then called the code like this:
    WebServicesUnitImplService service = new WebServicesUnitImplService();
    WebServicesUnitImpl unit = service.getWebServicesUnitImplPort();
    unit.serviceXXX();
    but the code doesn't work at all, resulting this error message:
    Two classes have the same XML type name "{http://ws.components.core.ilogique.vii.com/}getMessages". Use @XmlType.name and @XmlType.namespace to assign different names to them.
         this problem is related to the following location:
              at com.vii.ilogique.core.components.ws.GetMessages
              at public com.vii.ilogique.core.components.ws.GetMessages com.vii.ilogique.core.components.ws.ObjectFactory.createGetMessages()
              at com.vii.ilogique.core.components.ws.ObjectFactory
         this problem is related to the following location:
              at com.vii.ilogique.core.components.ws.GetMessages
    I have this error report on all generated class file! How can i fix this?
    What is the main problem? The SE usage? I copied the lates jax-ws jars into endorsed lib resulting the same.
    Any help is appreciate.

  • Is database link only 'valid' for instances in the same server?

    Background: We have 5 servers and installed Oracle 7.3 and 8.
    Problem: I managed to create database link to other instance in same server; but not to other server. Error message received was :
    ORA-02019: connection description for remote database not found
    : TNS server name not found
    BUT: I managed it with 'copy from ' command in SQL*plus.
    Question: Is database link only 'valid' for instances in the same server?
    Thanks! ;o)

    user10127912 wrote:
    Hi,
    We are planning to install second instance of Oracle 11gR2 in Linux server 2.6.39-400.21.1.el6uek.x86_64 x86_64. This is something we never haven done before. If you have such experience, please give us some insight.
    The existing instance has all the standard ports:
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    Enterprise Manager Console HTTP Port (pterpdb02) = 1158
    Enterprise Manager Agent Port (pterpdb02) = 3938
    What ports should we select for second listener and enterprise manager? Is there anything else that we need to know before we install the second instance?If you want a second database instance, no additional installation is required - as long as you want to run the second instance at the same version as the the first. Just fire up dbca and create the second database. One installation of Oracle (one ORACLE_HOME) is capable of supporting many database instances, though the same may or may not be said of the hardware it is running on.
    As already said, one listener is enough. One listener, running from one oracle home, using the default name of LISTENER, running on the defualt port of 1521, is quite capable of -- indeed, WAS DESIGNED TO, supporte multiple database instances of multiple versions running from multiple ORACLE_HOMEs.
    One instance of dbcontrol/dbconsole will support only one database. If you do not use Grid Control (extra installation, extra license) you will need to use the emca utility or one of the options in the dbca utility to configure a seperate instance of dbcontrol for each database. Don't worry about the ports, the creation utility will take care of it and report what it does.

  • Hey. I have recently made an update on my daughters iMac, particularly update OS X 10.9.4, when finished, its still asking for update and the same update stills remarked in the apple update menu and at the App store app. Why doesn't stop asking f.ud?

    Hey. I have recently made an update on my daughters iMac, particularly the update OS X 10.9.4, when finished, its still asking for update and the same update stills remarked as ready in the apple update menu and remarked as 1 to go at the App store app. Why doesn't stop asking for update when its done like 5 times or more? Thanks for taking your time!

    If you don't already have a current backup, back up all data, then reinstall the OS.* You don't need to erase the startup volume, and you won't need the backup unless something goes wrong. If the system was upgraded from an older version of OS X, you may need the Apple ID and password you used.
    If you use FileVault 2, then before running the Installer you must launch Disk Utility and select the icon of the FileVault startup volume ("Macintosh HD," unless you gave it a different name.) It will be nested below another icon with the same name. Click the Unlock button in the toolbar and enter your login password when prompted. Then quit Disk Utility to be returned to the main Recovery screen.
    There are ways to back up a computer that isn't fully functional. Ask if you need guidance.
    If you installed the Java runtime distributed by Apple and still need it, you'll have to reinstall it. The same goes for Xcode. All other data will be preserved.
    *The linked support article refers to OS X 10.9 ("Mavericks"), but the procedure is the same for OS X 10.7 ("Lion") and later.

  • Getting the JAXB exception like "Two classes have the same XML type name-"

    Getting the JAXB exception like "Two classes have the same XML type name...",
    Here is the exception details:
    Exception in thread "main" com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions Two classes have the same XML type name "city". Use @XmlType.name and @XmlType.namespace to assign different names to them. this problem is related to the following location: at com.model.City at public com.model.City com.model.Address.getCurrentCity() at com.model.Address this problem is related to the following location: at com.common.City at public com.common.City com.model.Address.getPreviousCity() at com.model.Address
    at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(Unknown Source) at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source) at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at javax.xml.bind.ContextFinder.newInstance(Unknown Source) at javax.xml.bind.ContextFinder.find(Unknown Source) at javax.xml.bind.JAXBContext.newInstance(Unknown Source) at javax.xml.bind.JAXBContext.newInstance(Unknown Source) at com.PojoToXSD.main(PojoToXSD.java:17)
    I took the example like:
    package com.model; ---->this package contains 'Address' class and 'City' class
    public class Address {
    private String areaName; private City currentCity; private com.common.City previousCity;
    package com.model;
    public class City {
    private String cityName;
    Another city class in "com.common" package.
    package com.common;
    public class City {
    private String pinCode;
    We need to create XSDs and needs to do the Marshalling and unmarshalling with the existing code in our project(like as above example code), code does not have any annotations like "@XmlRootElement/@XmlType" and we can not able to change the source code.
    I would like to know is there any solution to fix the above issue or any other ways to create XSDs and marshaling/unmarshalling(like MOXy..etc)?
    It would be great if i can get the solution from any one....May thanks in advance.
    Thanks,
    Satya.

    Getting the JAXB exception like "Two classes have the same XML type name...",
    Here is the exception details:
    Exception in thread "main" com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions Two classes have the same XML type name "city". Use @XmlType.name and @XmlType.namespace to assign different names to them. this problem is related to the following location: at com.model.City at public com.model.City com.model.Address.getCurrentCity() at com.model.Address this problem is related to the following location: at com.common.City at public com.common.City com.model.Address.getPreviousCity() at com.model.Address
    at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(Unknown Source) at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source) at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at javax.xml.bind.ContextFinder.newInstance(Unknown Source) at javax.xml.bind.ContextFinder.find(Unknown Source) at javax.xml.bind.JAXBContext.newInstance(Unknown Source) at javax.xml.bind.JAXBContext.newInstance(Unknown Source) at com.PojoToXSD.main(PojoToXSD.java:17)
    I took the example like:
    package com.model; ---->this package contains 'Address' class and 'City' class
    public class Address {
    private String areaName; private City currentCity; private com.common.City previousCity;
    package com.model;
    public class City {
    private String cityName;
    Another city class in "com.common" package.
    package com.common;
    public class City {
    private String pinCode;
    We need to create XSDs and needs to do the Marshalling and unmarshalling with the existing code in our project(like as above example code), code does not have any annotations like "@XmlRootElement/@XmlType" and we can not able to change the source code.
    I would like to know is there any solution to fix the above issue or any other ways to create XSDs and marshaling/unmarshalling(like MOXy..etc)?
    It would be great if i can get the solution from any one....May thanks in advance.
    Thanks,
    Satya.

Maybe you are looking for

  • Transparent logo into KN?

    Mac OS10.4.11. Keynote 3.0.2 Logo created in Freehand. I want to place a two colour logo (Call it "A&B") into KN on a colored background without its white picture box surrounding it. JPEG, TIFF, PDF files don't seem to work. A Freehand vector EPS log

  • Problem to run a report

    Hi all, I have a problem to run report in report server other than the report server in process.I installed 9IDS on 2 PCs.I use one PC as a small Appserver.Exactly, i run OC4J on it, i also create a report server on it, .Both OC4J and report server a

  • Snow Leopard 10.6.8 Combo update problem

    I have an older Black MacBook from 2008 (4,1).  I was always on 10.6.6 as I only really did use this machine for live on stage performance and it has been rocksolid.  I decided to to apply the 10.6.8 combo update finally.  Everything went smooth but

  • Database Instance Using Swap Space even When There is Plenty of Free RAM

    Hi, I am facinga strange issue in oracle on solaris 5.10 Platform:solaris 5.10 Database version:11.2.0.1.0 Our database Instance Using Swap Space even When There is Plenty of Free RAM. We have 80GB of physical RAM, 32GB is set to oracle SGA_MAX_SIZE

  • Please let to be inset a CMYK images!

    More graphic designer have a CMYK logos and images first in hight resolution for press version, and something the big work is to convert all files for web publishing, Would be great to have a fantastic program like Muse that give a permission to conv