Sign In  Sign Up Live-Chat

Setting Paths on linux urgent

Last post 09-08-2008, 2:57 AM by alexey.noskov. 3 replies.
Sort Posts: Previous Next
  •  09-06-2008, 6:44 AM 142716

    Setting Paths on linux urgent

    My case :I am trying to merge some data i have in databse [mysql] with a doc file i did that perfectly under windows
     
    //======================================================================
    <?php
    require_once("http://localhost:8080/JavaBridge/java/Java.inc");
    //Load libraries
    java_require("C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\JavaBridge\WEB-INF\lib\Aspose.Words.jdk15.jar;C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\JavaBridge\WEB-INF\lib\jaxen-1.1.jar");
    $headerFooterType = new Java("com.aspose.words.HeaderFooterType");

    $doc = new Java("com.aspose.words.Document", "C:\Temp\out.doc");
    $String=array("CompanyName","Address","City","PostalCode","Country");
    $Object=array("123","Hello","Slah","Ferh","Opom");
    $doc->getMailMerge()->execute(
        $String,
        $Object);
     
        $doc->save("C:\Temp\out.doc");
    ?>
     
    //======================================================================
     
    The Problem is under linux
     
     
    <?php

    require_once("http://localhost:8180/JavaBridge/java/Java.inc");

    //Load libraries
    java_require("/usr/share/tomcat5.5/webapps/JavaBridge/WEB-INF/lib/Aspose.Words.jdk15.jar;/usr/share/tomcat5.5/webapps/JavaBridge/WEB-INF/lib/jaxen-1.1.jar");

    $headerFooterType = new Java("com.aspose.words.HeaderFooterType");

    $doc = new Java("com.aspose.words.Document","/home/out.doc");

    $String=array("CompanyName","Address","City","PostalCode","Country");
    $Object=array("12323232323","Hello","Slah","Ferhat","OpeTechCom");
     
    $doc->getMailMerge()->execute(
        $String,
        $Object);
     
     
     
        $doc->save("/home/out.doc");
     
    ?>
    it returns

    Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: CreateInstance failed: new com.aspose.words.Document((o:String)[o:String]). Cause: java.lang.ClassNotFoundException: Unresolved external reference: java.lang.NoClassDefFoundError: asposewobfuscated.bt. -- Unable to call constructor, see the README section "Java platform issues" for details. VM: 1.5.0@http://gcc.gnu.org/java/" at: #-6 php.java.bridge.JavaBridge.getUnresolvedExternalReferenceException(JavaBridge.java:427) #-5 php.java.bridge.JavaBridge.CreateObject(JavaBridge.java:498) #-4 php.java.bridge.Request.handleRequest(Request.java:447) #0 http://localhost:8180/JavaBridge/java/Java.inc(265): java_ThrowExceptionProxyFactory->getProxy(2, NULL, false) #1 http://localhost:8180/JavaBridge/java/Java.inc(417): java_Arg->getResult(false) #2 http://localhost:8180/JavaBridge/java/Java.inc(420): java_Client->getWrappedResult(false) #3 http://localhost:8180/JavaBridge/java/Java.inc(602): java_Client->getInternalResult() #4 http://localhost:8180/JavaBridge/java/Java.inc( in http://localhost:8180/JavaBridge/java/Java.inc on line 228
     
     
     
     
    so any suggestions
     
  •  09-06-2008, 8:44 AM 142729 in reply to 142716

    Re: Setting Paths on linux urgent

    Hi

     

    Thanks for your inquiry. Try copying the lib folder to the root folder of your PHP project. And use relative path.

     

    <?php

    require_once("http://localhost:8080/JavaBridge/java/Java.inc");

    java_require("lib/Aspose.Words.jdk15.jar;lib/jaxen-1.1.jar");

     

    I hope this helps.

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  09-08-2008, 1:06 AM 142844 in reply to 142716

    Re: Setting Paths on linux urgent

    The problem is in this line and i did what u said alexey.noskov  but nothing happened same error

    $doc = new Java("com.aspose.words.Document","/home/out.doc");
    meaning the path here is \home\out.doc which cause such problem while in winodws 
    C:\Temp\out.doc it runs perfectly

    so any suggestions

    Filed under: Aspose Word Issue
     
  •  09-08-2008, 2:57 AM 142861 in reply to 142844

    Re: Setting Paths on linux urgent

    Hi

     

    Thanks for your inquiry. Maybe you can try putting your document into the root folder of your PHP project and trying using the following:

     

    $doc = new Java("com.aspose.words.Document","in.doc");

     

    Also for testing you can try creating empty document.

     

    $doc = new Java("com.aspose.words.Document");

     

    I hope this could help.

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
View as RSS news feed in XML