To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=52761
                  Issue #:|52761
                  Summary:|"theCoreReflection" service not available in a fresh
                          |Java UNO env
                Component:|api
                  Version:|OOo 1.1.4
                 Platform:|All
                      URL:|
               OS/Version:|All
                   Status:|UNCONFIRMED
        Status whiteboard:|
                 Keywords:|
               Resolution:|
               Issue type:|DEFECT
                 Priority:|P3
             Subcomponent:|code
              Assigned to:|sw
              Reported by:|ronyf





------- Additional comments from [EMAIL PROTECTED] Mon Aug  1 13:01:38 -0700 
2005 -------
"com.sun.star.reflection.theCoreReflection" is not available in a fresh Java UNO
env and can therefore not be retrieved via the
"com.sun.star.comp.helper.Bootstrap" supplied (inital) context!

Cf. e-mails as of 2005-07-29, and Jürgen Schmidt's suggestion that this might be
considered a bug or a request for feature enhancement. Because of the importance
for some Java-based use-cases I would suggest to qualify this omission as a bug.

If this service is not incorporated then no reflection can be carried out with
plain UNO components. In my use-case this means that UNO components cannot be
interacted with by a scripting language, which uses Java reflection to use the
Java-based UNO reflection mechanism. 

There may even be other use-cases where it becomes important for Java programs
to be able to use the Java based core reflection mechanism of UNO, especially,
if UNO components should be used without the office.

What follows is a small (running) Java program to demonstrate that
"theCoreReflection" object is not retrievable. 

---------------- cut here --------------
import com.sun.star.comp.helper.Bootstrap;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;

public final class RgfUnoAnalyzeTest2 {

    public static XComponentContext defaultContext=null;

    /** Static block to initialize static fields. */
    static {
        try
        {
            XComponentContext 
ctxt0=Bootstrap.createInitialComponentContext(null) ;
            System.err.println("ctxt0="+pp(ctxt0));

            String key="/singletons/com.sun.star.reflection.theCoreReflection";
            Object tcr2=ctxt0.getValueByName(key);
            System.err.println(key+"\t=\t"+pp(tcr2));

            key="/singletons/com.sun.star.lang.theServiceManager";
            tcr2=ctxt0.getValueByName(key);
            System.err.println(key+"\t=\t"+pp(tcr2)+"\n");
        }
        catch (Exception e)
        {
            System.err.println("Exception:" + pp(e) + "has occurred!");
        }
    }

    public static void main(String[] arguments) throws Exception {

        System.out.println("In main()...");
        System.exit(0);
    }

    private RgfUnoAnalyzeTest2 () {}

    public static String pp(Object o)
    {
        if (o==null) return "<null>  <=== <=== <===";
        return "<"+o.toString()+">";
    }
}
---------------- cut here --------------

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to