Title: Factory.Parse issue

Hi Jason

 

I would guess that it probably is a classpath issue – you need xbean.jar and jsr173_1.0_api.jar on your classpath as well as any jar you generate using scomp. How are you calling XmlBeans within your program? What classpath are you passing it?

 

Also could you try running it from the command line and see what you get? Then we’d be able to see what the error message is.

 

Finally there’s another thing you can do.

 

Call XXXX.Factory.parse() passing an XmlOptions object. When setting up the XmlOptions object do something like the following (in addition to any other settings you already pass):

 

XmlOptions opts = new XmlOptions();

ArrayList errs = new ArrayList();

opts.setErrorListener(errs);

 

….parse(your_input_stream, opts);

 

for (int i=0; i<errs.size(); i++)

{

    XmlError err = (XmlError) errs.get(i);

    System.out.println(“Error ” + i + “ = ” + err.getMessage());

}

 

Cheers,

 

Lawrence

 


From: Green, Jason M. [mailto:[EMAIL PROTECTED]
Sent: Monday, April 03, 2006 1:08 PM
To: dev@xmlbeans.apache.org
Subject: RE: Factory.Parse issue

 

Lawrence,

   We run our program via another program.  We give the main program the location of one of our classes and it creates an instance of it. This instance is actually a JPanel that gets added to a tabbedPane contained in the main program.  That is basically how our program runs.  Let me know if that is confusing. 

When i say it craps out...

Since we are actually running it through this other program we can't really see any output, but we do create a file and output all of the execution to it.  So as we follow our code, the first instance we come to where it tries to start parsing the root element of the document, it stops running.  I.e, the output we have after that line is never sent to the outfile.  We have tries and catches for the code, but execution is never sent there.  So, basically, we think it is crashing at that first attempt to parse.  We're leaning towards a classpath issue (such as the main program having some xmlparser that is defined before ours and it tries to use that instead of xmlbeans).

Jason

 


From: Lawrence Jones [mailto:[EMAIL PROTECTED]
Sent: Monday, April 03, 2006 4:01 PM
To: dev@xmlbeans.apache.org
Subject: RE: Factory.Parse issue

Hi Jason

 

When you say the program “craps out”, what exactly do you see? And what do you means by “running the jar”? Do you mean running a java process from the command line with the jar on the classpath?

 

Cheers,

 

Lawrence

 


From: Green, Jason M. [mailto:[EMAIL PROTECTED]
Sent: Monday, April 03, 2006 12:27 PM
To: dev@xmlbeans.apache.org
Subject: Factory.Parse issue

 

Hey everyone.
I'm having an odd issue with xmlbeans.  When using it while developing in my IDE, it seems to work fine.  When actually running the jar (at least along those lines), the program craps out on the Factory.parse method.  We pass in a ByteArrayInputStream, and like I say, it works like a charm when running from our IDE.  The big problem is, there is absolutely no output to our files or anything saying why.  We created our jar with -debug, but don't know where the output is thrown to.  We have traced it down to here but can't track it past here:

This is in the PlanListDocumentDocument1$Factory.java file
public static PlanListDocumentDocument1 parse(InputStream inputstream, XmlOptions xmloptions)
        throws XmlException, IOException
    {
        return (PlanListDocumentDocument1)XmlBeans.getContextTypeLoader().parse(inputstream, PlanListDocumentDocument1.type, xmloptions);

    }

Here is the line of code that we call:
ResponseDocumentDocument1 response = ResponseDocumentDocument1.Factory.parse(new ByteArrayInputStream(result));

So basically, here's my main question.  If you set the debug, is the debug just sent to standard out, or can it be logged? 

Sorry for how much this post jumps around.  We're kinda frazzled here.

Jason

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

Reply via email to