Does alias exist to differentiate between 2 classes with same name?

I have 2 classes (a domainmodel-class and a webpage-class) with the same name. Of course I get a naming-conflict when I want to reference the domainmodel-class from the webpage-class (because they have the same name).
I was wondering if there's a language construct in java to import my domainmodel-class under a different name / alias in the webpage-class.
Of course I could simply rename my webpage-class, but that has some impact which I'd rather avoid.
Thanks,
Geert-Jan

gbrits wrote:
I have 2 classes (a domainmodel-class and a webpage-class) with the same name. Of course I get a naming-conflict when I want to reference the domainmodel-class from the webpage-class (because they have the same name).
I was wondering if there's a language construct in java to import my domainmodel-class under a different name / alias in the webpage-class.
Of course I could simply rename my webpage-class, but that has some impact which I'd rather avoid.
Thanks,
Geert-JanNo, you can't do that. But one class can be imported, and the other one be used with fully qualified name all of the time.

Similar Messages

  • Distringuishing between 2 classes with same name

    Hi,
    I have just recently begun programming in Java on a software project with more than one programmer. On of my coworkers had us use the directory structure such that our packages are name with our domain backwards (ie, an example package is gov.lanl.gui). He was under the impression that by structuring things in this manner one would not have to worry about duplicate class names. So to test it he made a class called Point (knowing such a class existed in the Java API). When he tried to compile the code the compiler was confused as to which Point.java he wanted to use.
    Is there a way to reconcile this without having to make sure a class doesn't already exist with the same name?
    thanks,
    Keri

    I am confused by the statement:
    When he tried to compile the code the compiler
    was confused as to which Point.java he wanted to use.Why would there be more than one Point.java on his workstation? Did he extract the src.jar to his local file system? Please post the actual compiler error.
    He is correct that the package structure allows for two different classes to have the same name. If you import java.util.* and java.sql.* into a class and then try to reference the Date class you will get a complier error. This is because there is a java.util.Date class and also a java.sql.Date class. This is one of the reasons that you shouldn't usually import an entire package. Another is that it can make complilation really slow. If you have to import both classes you can do so using the entire package structure in front of the class name e.g.
    java.util.Date utilDate;
    java.sql.Date sqlDate;

  • Problem in importing two different classes with same name...

    I have to import two different classes in my program with the same name....
    import org.apache.lucene.document.Document;
    import org.w3c.dom.Document;
    //    I AM USING THE DOCUMENT FROM W3C PACKAGE HERE....
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                     DocumentBuilder builder = factory.newDocumentBuilder();
                     InputSource is = new InputSource( new StringReader( tempString ) );
                     d = builder.parse( is );
                     NodeList images = d.getElementsByTagName("img");
                     int length = images.getLength();
                     for(int i = 0;i<length;i++)
                         Node image = images.item(i);
                         String tempAltText = image.getAttributes().getNamedItem("alt").getNodeValue();
                         altText = altText.concat(" ").concat(tempAltText);
                     }and the error i am getting is
    [javac] C:\Documents and Settings\sumit-i\WolframWorkspaces\Base\WolframNutch\src\java\com\wolfram\nutch\indexer\InfoCenterFilter.java:20: org.apache.lucene.document.Document is already defined in a single-type import
        [javac] import org.w3c.dom.Document;
        [javac] ^
        [javac] C:\Documents and Settings\sumit-i\WolframWorkspaces\Base\WolframNutch\src\java\com\wolfram\nutch\indexer\InfoCenterFilter.java:132: incompatible types
        [javac] found   : org.w3c.dom.Document
        [javac] required: org.apache.lucene.document.Document
        [javac] d = builder.parse( is );
        [javac] ^
        [javac] C:\Documents and Settings\sumit-i\WolframWorkspaces\Base\WolframNutch\src\java\com\wolfram\nutch\indexer\InfoCenterFilter.java:133: cannot find symbol
        [javac] symbol  : method getElementsByTagName(java.lang.String)
        [javac] location: class org.apache.lucene.document.Document
        [javac] NodeList images = d.getElementsByTagName("img");
        [javac] ^
        [javac] Note: Some input files use unchecked or unsafe operations.
        [javac] Note: Recompile with -Xlint:unchecked for details.
        [javac] 3 errorsany idea ..how to resolve it
    Edited by: ping.sumit on Jul 16, 2008 3:39 PM
    Edited by: ping.sumit on Jul 16, 2008 3:40 PM

    now i changed the code to
    import org.apache.lucene.document.Document;
    import org.w3c.dom.Document;
    org.w3c.dom.Document d = null;
    try{
         System.out.println("in author");
                   URL url = new java.net.URL(urlString);
                   java.net.URLConnection conn = url.openConnection();
                   BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                   while ((in.readLine()) != null)
                        //tempString = tempString.concat(in.readLine());
                        String temp = in.readLine();
                        tempString = tempString + " " + temp;
                   System.out.println("the string in author" + tempString);
                    in.close();
                    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                     DocumentBuilder builder = factory.newDocumentBuilder();
                     InputSource is = new InputSource( new StringReader( tempString ) );
                     d = builder.parse( is );
                     NodeList images = d.getElementsByTagName("img");and their is only one error i am getting ...and that is
    [javac] C:\Documents and Settings\sumit-i\WolframWorkspaces\Base\WolframNutch\src\java\com\wolfram\nutch\indexer\InfoCenterFilter.java:20: org.apache.lucene.document.Document is already defined in a single-type import
        [javac] import org.w3c.dom.Document;
        [javac] ^
        [javac] Note: Some input files use unchecked or unsafe operations.
        [javac] Note: Recompile with -Xlint:unchecked for details.
        [javac] 1 error

  • Are Multiple Classes with Same name in a single Class valid ?

    package inheritance;
    interface Foo
         int bar();
    public class Inh6 {
         class A implements Foo  // THis is the first class
              public int bar()
                   return 1;
         public int fubar(Foo foo)
              return foo.bar();     
         public void testFoo()
              class A implements Foo // THis is the second class
                   public int bar()
                        return 2;
              System.out.println(fubar(new A()));
         public void testFooModified()
              class A implements Foo // THis is the first class
                   public int bar()
                        return 4;
              System.out.println(fubar(new A()));
         public static void main(String[] args) {
              new Inh6().testFoo();
              new Inh6().testFooModified();
    O/P :
    2
    4My question is this class "A" which is present in the different methods like testFoo() and testFooModified() different declarations of the same class or altogether different classes local to each method,something like err...Local Class ?
    Thanks in Advance.

    kajbj wrote:
    My question is this class "A" which is present in the different methods like testFoo() and testFooModified() different declarations of the same class Why would it be the same class? They have different scopes.
    KajSo you mean to say they are actually different classes with the same name,which will be invisible out of the respective methods in which they are defined ?
    Thanks.

  • Reflection - Two packages/classes with same name

    Hi There !
    I am in a situation and I need some help, if anyone can help me.
    I have two tools to work with different version of a server application. Now, the admin wants to have only one tool to work with both server app.
    The problem is that the server app has a jar file with the API to be used to access it. One jar for each version.
    Inside those jars files I have the same package and the same class ! But the implementation is diferent. So I will need to access one jar when accessing the old server app and another jar to access the new server app.
    I have no idea how to do it.
    I search arround google and I found that I can load a class at runtime and then with Reflection call its methods.
    I made a test app (simple, just 2 different jars with same package and class name just printing a Hello World and Bye World) and it worked very well.
    But when I tried to apply this to my code, I realize that one class need the reference of the other class...
    For example, I have a class named Server and other called ServerStatus.
    The Server class do the connection to the server and the ServerStatus get some server information. But the method that give me this information has a argument asking for an object of Server... like this:
    Server serv = new Server();
    serv.connect();
    ServerStatus servStat = new ServerStatus();
    servStat.getServerStatus(serv);I tried to do this with reflection but in the part that I need to invoke the method getServerStatus, I do not have the name of the class that is the argument (in this case Server).
    Something like this:
       Method  m = serverClass.getMethod("getServerStatus", new Class[] {?????.class});
             result = (Boolean)m.invoke(server, new Object[] {serverStatus});Do you have any ideiias to resolve this ?
    Or something different from reflection to access two different implementations with same package and class name ?
    If you need any other information, please ask me..
    Thank you so much !
    Regards,
    Thiago

    Thiago wrote:
    Hi.
    But now, how can I handle the object (because the newInstance() return a Object object.... not the class that I want (Server, for example)).
    When you declare a reference to be something more narrow than "Object" you're telling the compiler what methods and fields the referenced object supports. With a dynamically loaded class you can't do that at compile time, because the nature of the class isn't known until you load it at runtime.
    That's why it's very handy if you know that the class you are to load implements some interface which is known at compile time. Then you can access the object through a reference to that interface.
    Otherwise there's really no option but to handle the object through reflection. Find methods with getMethod() on the Class object and invoke them with Method.invoke().
    There are tricks to impose an interface onto a dynamically loaded class at runtime, but they are just neat ways of working through reflection.

  • Use Class with Same Name as Default Package Class

    I am upgrading a project to Flash CC and need to use the old JSON class in com.adobe.serialization.json. When I compile, I get an error, "1061: Call to a possibly undefined method decode through a reference with static type Class" because it probably is trying to use the newer default package JSON class rather than the one in com.adobe. I have the import statement in my class, "import com.adobe.serialization.json.JSON", but I guess its checking against the default package and giving me a compile error when I call "var parts:Object = JSON.decode(jsonData);"

    Thanks. I changed my publish settings to fp 10 which fixed it for now. I was hoping there might be a more elegant solution as the custom class is actually an Adobe class that would be better to not to have to rename.

  • The collection you specified does not exists or is not registered with the ColdFusion Search Service.

    While upgrading to CF7 from CF5, I am creating the new collections from Cf Admin. After creating, I indexed it from cf admin and then trying to search for the documents in that collection, and i am getting the following error. This was working yesterday. I have cheched the logs etc and nothing seems helpful in discovering what the issue is.
    Document count is 11,745 and the size is 25,948 kb, which is not too much for a collection. I have tried to restart Cold Fusion Search Services and then ColdFusion Application services, but all in vain.
    Any help on this would be greatly appreciated.
    Detail
    The collection you specified does not exists or is not registered with the ColdFusion Search Service.
    Message
    The collection rc_collectiom does not exist.
    StackTrace
    coldfusion.tagext.search.CollectionDoesNotExistException: The collection rc_collectiom does not exist. at coldfusion.tagext.search.SearchTag.verifyLocale(SearchTag.java:819) at coldfusion.tagext.search.SearchTag.doSearch(SearchTag.java:200) at coldfusion.tagext.search.SearchTag.doStartTag(SearchTag.java:159) at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1915) at cfeFull2dText2dReDirect2ecfm511389924.runPage(C:\Inetpub\wwwroot\External\FullText\eFull- Text-ReDirect.cfm:43) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349) at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1915) at cfApplication2ecfc179940445$funcONREQUEST.runFunction(C:\Inetpub\wwwroot\External\Applica tion.cfc:114) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:344) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:290) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:254) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:56) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:207) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:169) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:194) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:146) at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:72) at coldfusion.runtime.AppEventInvoker.onRequest(AppEventInvoker.java:178) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:215) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:51) at coldfusion.filter.PathFilter.invoke(PathFilter.java:86) at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:69) at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:52) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:115) at coldfusion.CfmServlet.service(CfmServlet.java:107) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541) at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

    So at last I figured this out myself and found a temporary resolution for this kind of problem. Majority of the times try creating the Collection through Cfcollection tag and then index it using cfindex tag, rather than performing these operations from the Cold Fusion 7 administrator.
    The only reason I can think of which might have caused the issue is – I have thousands of documents in the collection which I indexed. So while indexing the page gets expired. So I tried again to index it. This time the collection got indexed fairly quickly and I got the response that the collection has been indexed successfully. So for the first time when I tried to index the collection, there might be some piece of code, which did not register the collection properly and hence giving this error.
    When I did the same function using the code, with exactly same set of documents, it did not throw any error, even when I executed it for the first time. So the collection indexed properly.
    I am not claiming that technically this theory is correct, but this seems to be the problem.
    If someone knows technically what has happened at the back, please share it. For the time being, this is the fix – if you experience any problem in creating/indexing collections through cfadmin in CF7, do it thorough code.

  • CF8 Verity "The collection you specified does not exist or is not registered with the ColdFusion Search Service."

    I'm running ColdFusion 8 Enterprise on linux. I'm able to
    create collections and index them through cfadmin as well as in cfm
    application pages, but when trying to search I get the error
    &quot;The collection you specified does not exist or is not
    registered with the ColdFusion Search Service.&quot;
    I'm using the collection name in cfsearch and not the full
    path.

    Would I have been better off posting this in the General
    Discussion section? Could the moderators move it if so,
    please?

  • Mail in Mavericks not replacing existing mail with same name

    Mail in Mavericks not replacing existing mail with same name.
    Thanks

    I have the same situation as you - sending out pdfs of designed pages and wanting to overwrite them continually. It used to happen on an older version of Mail, then it disappeared and now it's back with the latest version.
    It's more than annoying, it's downright driving me nuts. In the last hour I had to quit Mail seven times.
    Please send a fix for this Apple.

  • How to delete one existing file before uploading a file with same name?

    Hello everybody.
    I am uploading a file to Tomcat server. But, the problem is:
    i want to delete an existing file in the server, if i upload a fresh file with same name. In other words, "First check for the file with the same name in the server. If it exists, then delete existing file in the server and upload fresh one". If such file doesnot exist, then upload the file to server.
    I have given deleteonExit()
    but, for the first time when user is uploading, i want to check for the file with same name in the server.
    i am pasting the code here. please help:
    <!-- uploading the file -->
    <%
    String contentType = request.getContentType();
    if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0))
    DataInputStream in = new DataInputStream(request.getInputStream());
    int formDataLength = request.getContentLength();
    byte dataBytes[] = new byte[formDataLength];
    int byteRead = 0;
    int totalBytesRead = 0;
    while (totalBytesRead < formDataLength)
    byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
    totalBytesRead += byteRead;
    String contextRootPath = this.getServletContext().getRealPath("/");
    contextRootPath=contextRootPath.concat("uploaded");
    String file = new String(dataBytes);
    String saveFile = file.substring(file.indexOf("filename=\"") + 10);
    saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
    saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1,saveFile.indexOf("\""));
    // Create a directory; all ancestor directories must exist
    File outputFile = new File(contextRootPath, saveFile);
    var=outputFile.getPath();
    outputFile.createNewFile();
    int lastIndex = contentType.lastIndexOf("=");
    String boundary = contentType.substring(lastIndex + 1,contentType.length());
    int pos;
    pos = file.indexOf("filename=\"");
    pos = file.indexOf("\n", pos) + 1;
    pos = file.indexOf("\n", pos) + 1;
    pos = file.indexOf("\n", pos) + 1;
    int boundaryLocation = file.indexOf(boundary, pos) - 4;
    int startPos = ((file.substring(0, pos)).getBytes()).length;
    int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
    FileOutputStream fileOut = new FileOutputStream(outputFile);
    fileOut.write(dataBytes, startPos, (endPos - startPos));
    fileOut.flush();
    fileOut.close();
    outputFile.deleteOnExit();
    %>Please help. Thanks for taking time.
    Regards,
    Ashvini

    Thank you MartinHilpert,
    I have one more doubt,
    I am uploading the file to one folder called "uploaded". Before uploading a fresh file, i want to delete all existing files in that folder. IS that possible ?? If yes, can you please tell me how to do that ??
    Regards, Thanks for your time.
    Ashlvini

  • Clashes with class of same name: weblogic 6.0 sp2

              Hi Mike,
              Thanks for the response.
              I am getting this error
              C:\bea\testDir\jsp_servlet\_vgn\_portal\_system\_site\_edit.java:7: package jsp_servlet._vgn._portal._system
              clashes with class of same name
              Full compiler error(s): C:\bea\testDir\jsp_servlet\_vgn\_portal\_system\_site\_edit.java:7:
              package jsp_servlet._vgn._portal._system clashes with class of same name package
              jsp_servlet._vgn._portal._system._site; ^ 1 error
              This is the error on the screen and the messages I posted are from the weblogic.log
              Let me know if you need more info. Also, i found some suggestion somewhere that
              I should install rolling patch 2, bu i searched the downloads and did not find
              anything called Rolling Patch 2.
              Varun
              (No more information available, probably caused by another error) Michael Young
              <[email protected]> wrote:
              >Hi.
              >
              >Can you post the complete error? I don't see anything about class name
              >clashes in the exception you posted below.
              >
              >Cheers,
              >Michael
              >
              >Varun Garg wrote:
              >
              >> I am getting a "clashes with class of same name" error with some of
              >my jsp pages
              >> on weblogic 6.0 sp2. I have tried deleting my temporary jsp file, i
              >have tried
              >> using a working directory for the jsp using weblogic.xml.
              >>
              >> This happens for few files and not all of them
              >>
              >> java.io.IOException: Compiler failed executable.exec(java.lang.String[javac,
              >-classpath,
              >> C:\bea\wlserver6.0\config\mydomain\applications\DefaultWebApp_myserver;C:\bea\wlserver6.0\.\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\lib\ASTab.jar;C:\bea\testDir;C:\bea\jdk130\jre\lib\rt.jar;C:\bea\jdk130\jre\lib\i18n.jar;C:\bea\jdk130\jre\lib\sunrsasign.jar;C:\bea\jdk130\jre\classes;.;C:\bea\wlserver6.0\lib\weblogic_sp.jar;C:\bea\wlserver6.0\lib\weblogic.jar;C:\bea\wlserver6.0\lib\jce1_2_1.jar;C:\bea\wlserver6.0\lib\sunjce_provider.jar;C:\bea\wlserver6.0\lib\US_export_poli
              c
              >y.jar;C:\bea\wlserver6.0\lib\local_policy.jar;C:\bea\wlserver6.0\config\mydomain\applications\DefaultWebApp\WEB-INF\lib;;null,
              >> -d, C:\bea\testDir, C:\bea\testDir\jsp_servlet\_vgn\_portal\_system\_title.java])
              >> at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:585)
              >> at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:354)
              >>
              >> Thanks in advance for the help.
              >>
              >>
              >
              >--
              >Michael Young
              >Developer Relations Engineer
              >BEA Support
              >
              >
              

              Hi Mike,
              Thanks for the response.
              I am getting this error
              C:\bea\testDir\jsp_servlet\_vgn\_portal\_system\_site\_edit.java:7: package jsp_servlet._vgn._portal._system
              clashes with class of same name
              Full compiler error(s): C:\bea\testDir\jsp_servlet\_vgn\_portal\_system\_site\_edit.java:7:
              package jsp_servlet._vgn._portal._system clashes with class of same name package
              jsp_servlet._vgn._portal._system._site; ^ 1 error
              This is the error on the screen and the messages I posted are from the weblogic.log
              Let me know if you need more info. Also, i found some suggestion somewhere that
              I should install rolling patch 2, bu i searched the downloads and did not find
              anything called Rolling Patch 2.
              Varun
              (No more information available, probably caused by another error) Michael Young
              <[email protected]> wrote:
              >Hi.
              >
              >Can you post the complete error? I don't see anything about class name
              >clashes in the exception you posted below.
              >
              >Cheers,
              >Michael
              >
              >Varun Garg wrote:
              >
              >> I am getting a "clashes with class of same name" error with some of
              >my jsp pages
              >> on weblogic 6.0 sp2. I have tried deleting my temporary jsp file, i
              >have tried
              >> using a working directory for the jsp using weblogic.xml.
              >>
              >> This happens for few files and not all of them
              >>
              >> java.io.IOException: Compiler failed executable.exec(java.lang.String[javac,
              >-classpath,
              >> C:\bea\wlserver6.0\config\mydomain\applications\DefaultWebApp_myserver;C:\bea\wlserver6.0\.\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\lib\ASTab.jar;C:\bea\testDir;C:\bea\jdk130\jre\lib\rt.jar;C:\bea\jdk130\jre\lib\i18n.jar;C:\bea\jdk130\jre\lib\sunrsasign.jar;C:\bea\jdk130\jre\classes;.;C:\bea\wlserver6.0\lib\weblogic_sp.jar;C:\bea\wlserver6.0\lib\weblogic.jar;C:\bea\wlserver6.0\lib\jce1_2_1.jar;C:\bea\wlserver6.0\lib\sunjce_provider.jar;C:\bea\wlserver6.0\lib\US_export_poli
              c
              >y.jar;C:\bea\wlserver6.0\lib\local_policy.jar;C:\bea\wlserver6.0\config\mydomain\applications\DefaultWebApp\WEB-INF\lib;;null,
              >> -d, C:\bea\testDir, C:\bea\testDir\jsp_servlet\_vgn\_portal\_system\_title.java])
              >> at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:585)
              >> at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:354)
              >>
              >> Thanks in advance for the help.
              >>
              >>
              >
              >--
              >Michael Young
              >Developer Relations Engineer
              >BEA Support
              >
              >
              

  • Merging Log Files with same name

    Hello,
    I have log files with same name 00000000.jdb (because created at different machines). I would like to merge data stored in these two files.
    I tried below approaches which do not work:
    1. rename one of the files -> doesn't work as file header has file name info which doesn't match with renamed value
    2. db dump/load -> dump and load works without error. (i have to dump Entity related Database and Format related Database -- from -l option) However when i try to read the file, it gives error.
    Exception in thread "main" com.sleepycat.je.EnvironmentFailureException: (JE 5.0.103) Catalog could not be refreshed, may indicate corruption, errorFormatId=52 nFormats=51, . UNEXPECTED_EXCEPTION: Unexpected internal Exception, may have side effects.
    I am using EntityStore and thus Annotated Entities.
    Does any one has any insights?
    Thanks.

    Yuvaraj,
    As you discovered, it is not possible to use .jdb files from one environment in a different environment.  The .jdb files use an internal format with relationships between files that form the Btree.
    I'm glad to hear you were able to use DbDump and DbLoad successfully.
    --mark

  • How to create two employees with same name as supplier record?

    Dear all,
    We need to create a supplier record for an employee so that we can issue invoice for pretty cash payment. If there are 2 employees with same name, how can we create supplier records for these 2 employees? The system does not allow duplicate supplier name.
    Please advise.
    Regards,
    HY

    Hello,
    In R12 it is possible to create 2 employee with same name but different employee number.
    And also possible to create these 2 employees as suppliers in Payables.
    HTH,
    Vik

  • Can I run 2 different domains with same name but on 2 different machines?

    I am trying to setup 2 domains with same name (sharedcds1) on 2 different machines (Machine1 and Machine2).
              When I start the weblogic managed server 1 (sharedcds1managedserver1) on Machine2, it throws an error saying it has some conflicts with the managed server 1 running on Machine1. How did the managed server of one machine know about the other server. Can I run 2 different domains with same name but on 2 different machines?
              Here is the error in the log -
              <Jun 14, 2005 10:53:29 AM EDT> <Error> <Cluster> <BEA-000123> <Conflict start: You tried to bind an
              object under the name weblogic.transaction.coordinators.sharedcds1managedserver1 in the JNDI tree.
              The object from 4596206652609838848S:130.170.61.153:[9505,9505,-1,-1,9505,-1,-1,0,0]:sharedcds1:s
              haredcds1managedserver1 is non-clusterable, and you have tried to bind more than once from two or m
              ore servers. Such objects can only be deployed from one server.>
              <Jun 14, 2005 10:53:29 AM EDT> <Error> <Cluster> <BEA-000123> <Conflict start: You tried to bind an
              object under the name weblogic.transaction.coordinators.sharedcds1managedserver1 in the JNDI tree.
              The object from 8842351474821025197S:130.170.61.154:[9505,9505,-1,-1,9505,-1,-1,0,0]:sharedcds1:s
              haredcds1managedserver1 is non-clusterable, and you have tried to bind more than once from two or m
              ore servers. Such objects can only be deployed from one server.>
              Thanks
              Satish

    Yes you can. Make sure that domains configured to use different multicast address. WLS uses multicast for communications between nodes in domain.
              although your configuration will work, you could have troubles if you going to execute inter-domain calls between domains/servers with the same names.

  • Automator and applescript to copy new files in a folder with same name as parent folder

    I have an iMac with a pictures folder (Finder folder) containing several subfolders with pictures. As per now, all these subfolders are imported into an iPhoto library (and the structure of the Finder pictures folder is thus maintained: The iPhoto events are named the same as the Finder subfolder). I.e. I have not created any albums in iPhoto.
    I have also set up a workflow, where new iPhone photos are automatically being synced to specified Finder folders within the iMac pictures folder. So what I want to do is to make a workflow to import potential new photos from week to week into the existing iPhoto structure. I know iPhoto has this Autoimport folder, so this one is unpacked and "mapped". So, this is what I´m hoping to do:
    Automator (iCal - want to do this on a weekly basis):
    - Get specified Finder items -- set to target folder = iMac pictures folder
    - Get folder content (with subfolders)
    - Filter Finder items
         - Items from the last 7 days (which then would be any new files created last week)
    - Applescript/shell script loop(?)
         - Get folder name for each file´s (from previous step) parent folder
         - Create new folder with same name as the file´s parent folder (if not already existing) under the iPhoto Autoimport folder
         - Copy the given file into the folder from above
    - Run iPhoto application (Automator task), which then should just auto import the new photos according to the Finder folder structure
    Whith the workflow above, I aim to maintain the existing iPhoto structure, and just import new photos into the existing structure. Creating folder names under the Autoimport, similar as the existing Finder folder names / iPhoto events should make it possible to have the new files imported under the existing event, right?

    Anyone?
    I have now switched to Aperture (from iPhoto) due to Aperture´s capability to handle Finder folder structure, and due to the possibility of having the pictures within Aperture as referenced files to the pictures within the Finder folders (i.e. possibility to delete pictures from both library and Finder folder at the same time).
    So I have a superior Finder folder called "Album". Within "Album" I have several subfolders (sub albums) containing pictures. The "Album" folder with subfolders are imported into Aperture as "Projects and albums", and the pictures are uploaded within the Aperture structure as referenced files. So for now the Aperture structure is more or less a direct mirror of the Finder folder structure, whereas "Album" is the project.
    And this is my current workflow in Automator, but I´m searching help with my Applescript:
    - Get specified Finder items (target folder = the superior Finder folder "Album")
    - Get Folder content
    - Filter Finder items (to look for potential new files to import into Aperture)
         - Kind is not folder
         - Date created last X days
    The output files from this task enters an Applescript
    on run {input, parameters}
           repeat with f in input (**Loop**)
                   tell application "Finder"
                          set fileName to name of (f)
                          set parentFolder to name of container of (f)
                          tell application "Aperture"
                                 tell library 1
                                        tell project "Album"
                                               if (exists album parentFolder) then
                                                 ** I then would like to check if fileName already exist within the existing album**
                                                 ** If not existing, I would like to import file f into the existing album as a referenced file**              
                                               else if not (exists album parentFolder) then
                                                       make new album with properties {name:parentFolder}
                                                ** I then would like to import file f into the new album as a referenced file**
                                               end if
                                        end tell
                                 end tell
                          end tell
                   end tell
           end repeat
    end run

Maybe you are looking for