Parsing in Weblogic/jsp doesn't work; application-mode (command-line) works

Hello-
Parsing my XML file in Weblogic/jsp doesn't work, whereas it works
in application-mode... (albeit on two different machines)
Here are the parameters:
server1:
weblogic 6.0
win2k server
jre1.3
my personal machine:
***no weblogic***
win2k server
jre1.3
When I run my code as an application (command-line style) on my machine,
parsing in my xml file works fine, and I can do a root.toString() and it
dumps out the entire xml file, as desired.
However, running my code inside weblogic (on server1) in JSP, parsing in
my file and doing a root.toString() results in the following: [dmui: null]
(where dmui is my root)
(even though i'm running it on two different machines, i'm positive its the
same code (the servers share a mapped drive)...
So, I think its probably because I'm using a different parser, as
specified by weblogic? There are no exceptions being thrown. Here's my
(abbreviated) code, which is called either command line style or in a JSP:
// Imports
import org.w3c.dom.*;
import org.w3c.dom.Document;
import javax.xml.parsers.*;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
DocumentBuilderFactory docBuilderFactory =
DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
mDocument = docBuilder.parse (inFile);
myRoot.toString()
-END
Doing a System.getProperty("javax.xml.parsers.DocumentBuilderFactory")
results in:
server1 (weblogic/jsp):
"weblogic.apache.xerces.jaxp.DocumentBuilderFactoryImpl"
my machine (application-mode):
null
Does anyone have any ideas about how to get this work? Do I try to set it
up so that they both use the same parser? Do I change the Weblogic parser?
If so, to what? And how?
Am I even close?
Any help would be appreciated..
Thanks, Clint
"[email protected]" <[email protected]> wrote in message
news:[email protected]...
No problem, glad you got it worked out :)
~Ryan U.
Jennifer wrote in message <[email protected]>...
I completely missed setting the property(:-o), foolish mistake. That wasit. Thanks.
"j.upton" <[email protected]> wrote:
Jennifer,
Personally I would get rid of import com.sun.xml.parser.* and use xerces
which comes with WLS 6.0 now, unless like I said earlier you have a need
to
use the sun parser :) Try something like this with your code --I've put
things to watch for as comments in the code.
import javax.xml.parsers.*;
import org.xml.sax.SAXException;
import org.w3c.dom.*;
import java.io.FileInputStream;
public class BasicDOM {
public BasicDOM (String xmlFile) {
try{
FileInputStream inStream;
Document document;
/*You must specify a parser for jaxp. You can in a simple view
think
of this as being analogous to a driver used by JDBC or JNDI. If you are
using this in the context of a servlet or JSP and have set an XML
registry
with the console this happens automatically. You can also invoke it in
the
context of an application on the command line using the -D switch. */
System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
>>>
"weblogic.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
// create a document factory
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
// specify validating or non-validating parser
dbf.setValidating(true);
// obtain a factory
DocumentBuilder db = dbf.newDocumentBuilder();
// create a document from the factory
inStream = new FileInputStream(xmlFile);
document = db.parse(inStream);
}//try
catch (Exception e)
System.out.println("Unexpected exception reading document!"
+e);
System.exit (0);
}//catch
}//BasicDom
// Main Method
public static void main (String[] args) {
if (args.length < 1)
System.exit(1); file://or you can be more verbose
new BasicDOM(args[0]);
}//class
=============================================
That will give you a basic DOM you can manipulate and parse it fromthere.
BTW this code
compiled and ran on WLS 6.0 under Windows 2000.
Let me know if this helped or you still are having trouble.
~Ryan U.
"Jennifer" <[email protected]> wrote in message
news:[email protected]...
Actually I included com.sun.xml.parser.* as one last febble attempt toget
it working.
And as for source code, I included the code. If I just put that oneline
of code
in, including the imports, it fails giving me an error listed above inthe
subject
line. Here is the code again:
package examples.xml.http;
import javax.xml.parsers.*;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.w3c.dom.*;
import java.util.*;
import java.net.*;
import org.xml.sax.*;
import java.io.*;
public class BasicDOM {
static Document document;
public BasicDOM (String xmlFile) {
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
} catch (FactoryConfigurationError e){
System.err.println(e.getException());
e.printStackTrace();
// Main Method
public static void main (String[] args) {
BasicDOM basicDOM = new BasicDOM (args[0]);

Hi, Rob
Does it work in WL9.2?
It seems I do it exactly as the explained at http://edocs.bea.com/wls/docs81/programming/classloading.html - and it fails :o(.
I try to run my app.ear with WL9.2 There are 2 components in it: webapp and mdb. The webapp/WEB-INF contains weblogic.xml:
<weblogic-web-app>
<container-descriptor>     
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>
Mdb is expected to run in the same mode, i.e. to prefer the webapp/WEB-INF/*.jar over the parent Weblogic classloader. To do so I add the weblogic-application.xml to the app.ear!/META-INF:
<weblogic-application>
<classloader-structure>
<module-ref>
<!-- reminder: this webapp contains
prefer-web-inf-classes -->
<module-uri>webapp</module-uri>
</module-ref>
<classloader-structure>
<module-ref>
<module-uri>mdb.jar</module-uri>
</module-ref>
</classloader-structure>
</classloader-structure>
</weblogic-application>
Now, when classloader-structure specified, both webabb and mdb prefer the weblogic root loader as if prefer-web-inf-classes not defined at all.

Similar Messages

  • What's the available value for weblogic.jsp.encoding in web application.

    Hi,
              I'm using chinese windows nt 4.0 and weblogic 5.1 sp6.When I did not set
              weblogic.jsp.encoding to GB2312 , when the jsp file contain's chinese , the
              output will be error .And when I did not set it , the output is correct, but
              when I use request.getParameter("SomeFormElement")(the element inputed
              chinese), the return value is error.
              How should I set weblogic.jsp.encoding value to satisfy all this problem?
              When I set the value to ISO-8859, there is an exception:
              java.io.UnsupportedEncodingException: Charset: 'ISO-8859' not recognized,
              and there is no alias for it in the weblogic.httpd.charsets property. So
              What's the available value for weblogic.jsp.encoding in web application?
              Pan
              

    hi ,
    i think the best way is to create java beans ,in that bean call your EJB ,
    and check the validation over there.
    and make that bean scope to session.
    in each and everypage try to check the session ,if it is not valid then forward to your login page...
    otherwise continue to give access to him like guest
    Regards,
    AfTaB

  • How to automatically generate a build file of the application from command-line

    Hi All
    How can we automatically generate a build file of the application from command-line (as opposed to using Jdev IDE to click to generate a build.xml) ?
    Thanks

    User, which jdev version do you use?
    I don't think you can do this. You can only create an ant build.xml from the project inside jdev.
    You can use ojdeploy to build the project.  This is the only method which will also make the necessary changes to the descriptors.
    Timo

  • How to restore or backup Apex application from Command line ? URGENT

    We have Oracle apex 4.1 installed in Oracle 11g R2 database (windows 64-bit) 2008 R2
    For some reason our database dictionary objects are corrupted.
    We wanted to backup our Apex applications in some workspaces ASAP.
    We are not able to access apex from http://localhost:7777/pls/apex/htmldb_login
    We have an underlying database schema export (expdp).
    1) Is there a way to export or backup the apex application without logging into the apex URL ? if yes how ?
    2) Does Oracle has any of its own native tool to backup and restore from command line ?
    Thanks in advance

    My (MS Windows) experience, if I may; perhaps you'll find something useful.
    You'll find the README.TXT file in /apex/utilities directory. Read it.
    In order to use APEXExport, you need JDK version 1.5 or higher. Check your version by typing (and viewing the result):
    C:\>java –version
    java version "1.6.0_06"
    Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
    Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)Its directory should be part of the PATH environment variable: on my computer, directory name isC:\Program Files\Java\jre1.6.0_06\binFurthermore, Oracle JDBC class libraries must be part of the CLASSPATH environment variable. Check whether it exists (in Control Panel - System - Advanced - Environment Variables). For my 10gXE, it is here:C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jarI couldn't make it work; didn't know that ".\" directory must be entered into CLASSPATH as well (found that information in Arie Geller's book). Therefore, my final CLASSPATH version is:.\;C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jarOK, setup is done. Now, go to your /apex/utilities directory and, from the command prompt, run (mind the upper case!)java oracle.apex.APEXExportwhich will show a short help.
    I chose to export the whole workspace. In order to do that, I need the workspace ID (got it from Apex's SQL Workshop; that might be a problem as you can't get there, can you? I can't tell how to find that information apart from SQL Workshop, but I'm pretty sure someone, who is much more experienced than me, will know it). OK, here's how you find it:select v('WORKSPACE_ID') from dual;Finally, here's the final step - export:C:\apex\utilities>java oracle.apex.APEXExport -db localhost:1521:xe -user scott -password tiger -workspaceid 1038408092496568The result are fxxx.sql files (where "xxx" represents application number).
    I hope you'll manage to export your applications; basically, nothing special here (except that ".\" directory in the CLASSPATH variable).
    Best of luck!

  • Starting an application using command line arguements

    Hi All,
    I need to launch an application by passing command line arguements. How to go about it?
    Thanks
    Sakthi

    is this an application you've written, or one you've downloaded? the two ways I know of to run an app from the command line are to use the 'open' command (e.g. +open -a appName+), or to run the exectuable element directly (usually something like /path/to/appName.app/Contents/MacOS/appName). the open command doesn't have an option for passing parameters; running the executable directly will allow you to pass parameters unix-style (assuming the executable is designed to accept them), but doesn't always run the application the same way as double-clicking on the file.
    you can also try applescript (from the command line use osascript) if the app is scriptable.

  • How to skip and restart a failed worker using ADCTRL command line?

    To skip and restart a failed worker, we can start adctrl, use hidden option (7 or 8 depending on the version).
    Is it possible to do the same from command line?
    Thanks in advance.
    S. Sundar

    I am asking about the option to run in non-interactive modeIt cannot be done. Check "Oracle® Applications Maintenance Utilities Release 11i (11.5.10.2)" manual for more details.

  • Portal Work Protect mode is not working properly after upgrade to NW 7.4

    The portal Work protect mode value is set to '3' ("Choose action in popup on unsaved data")
    When we edit a standard ESS java Web Dynpro application and click exit, the portal should show us the Work protect mode popup.
    Instead, the portal exits to the overview page and when we try to navigate away from the overview page, it shows the work protect mode window.
    This was working fine before upgrade to SAP NW 7.4 SP 5.
    Please let me know if anyone have faced this issue before or have an resolution.
    Thank you.

    Hi Sundar & Rakesh
    I've followed Sundar's request in the previous thread we worked on together to provide further assistance here:
    ** Scenario Summary **
    The portal Work protect mode value is set to '3' ("Choose action in popup on unsaved data") When we edit a standard ESS java Web Dynpro application and click exit, the portal should show us the Work protect mode popup. Instead, the portal exits to the overview page and when we try to navigate away from the overview page, it shows the work protect mode window. This was working fine before upgrade to SAP NW 7.4 SP 5.
    Ok the first point of reference and analysis here is to check and review: Workprotect mode via the following navigation path:
    System Admin-> System Configuration -> Service Configuration -> Under one of the services: Work protect mode property.
    Now in terms of this popup kindly ensure the configurations are setup accordingly as per the following document:
    http://scn.sap.com/docs/DOC-2513
    What is the setting of WDPortalWorkProtectMode.setApplicationDirty ?
    Work Protect Mode
    http://help.sap.com/saphelp_nw04s/helpdata/en/45/b76f4169e25858e10000000a1550b0/content.htm
    Lastly have you attempted to change the property value and restarting the service ?
    Restart the config by right clicking on com.sap.portal.epcf.loader. Click Administrate ->restart
    Kindly update me as per your findings.
    Kind Regards
    Troy Cronin - Enterprise Portal Support Engineer.

  • Mail bounces when sent from command-line, works from PHPMailer, Mail.app

    Recently, any mail send from the command-line (manually, or via automated scripts) is getting rejected. However, messages composed with, say, PHPMailer are getting through. One thing I notice about the bounced messages is that there's no user/sender recorded. Here's a snippet of the log:
    Sep 28 16:45:32 ns postfix/pickup[3275]: 64F57343FF2: uid=501 from=<admin>
    Sep 28 16:45:32 ns postfix/cleanup[6126]: 64F57343FF2: message-id=<[email protected]>
    Sep 28 16:45:32 ns postfix/qmgr[3276]: 64F57343FF2: from=<[email protected]>, size=627, nrcpt=1 (queue active)
    Sep 28 16:45:35 ns postfix/smtp[6130]: 64F57343FF2: to=<[email protected]>, relay=mx.metropolis.ca[65.254.254.57], delay=3, status=sent (250 2.0.0 tylR1X05q2fRSSh0000000 mail accepted for delivery)
    Sep 28 16:45:35 ns postfix/qmgr[3276]: 64F57343FF2: removed
    Sep 28 16:45:54 ns postfix/pickup[3275]: 0A7BB343FFF: uid=501 from=<admin>
    Sep 28 16:45:54 ns postfix/cleanup[6126]: 0A7BB343FFF: message-id=<20070928224554.0A7BB343FFF@mail>
    Sep 28 16:45:54 ns postfix/qmgr[3276]: 0A7BB343FFF: from=<[email protected]>, size=423, nrcpt=1 (queue active)
    Sep 28 16:45:54 ns postfix/smtp[6130]: 0A7BB343FFF: to=<[email protected]>, relay=none, delay=0, status=bounced (mail for gpspolice.net loops back to myself)
    The failure reason given "mail for ... loops back to myself" doesn't seem right, since I haven't changed the DNS settings on this machine.
    You'll notice, the message that is sent has the from= address specified, whereas the other two failed examples don't... I'm not really sure why this is failing all of a sudden. Telus, one of our ISPs, is infamous for quietly making major network policy changes (e.g., blocking port 25 for all outgoing business customers). Any suggestions, or a link to a good SMTP mail server (a la OS X server) tutorial would be appreciated. Thanks.
    ...Rene

    David_x wrote:
    David_x wrote:
    Can you explain why you need any zones in your DNS apart from your own?
    OK, I read a previous post from you which explains your internal setup (mini & xserve), so you are using internal domains for web stuff with your local DNS based on your xserve. I presume your mini is using the xserve for DNS? So although I am not entirely clear about everything that is going on, I'll presume you do need these domains in your xserve...
    Yes, that's all correct. The Xserve does runs DNS, Web and Mail Services, the Mini just runs a couple web sites (on port 8080, fwiw).
    If an external mail server is responsible for a domain which you have in your internal DNS then you have to mirror the public MX records in your local DNS. How MX records work...
    This is what I've done in the DNS Services, I believe...
    For the domain gpspolice.net, your mini will ask your xserve for the MX record. This will resolve to a host name - in the public DNS this is "mail.gpspolice.net". Your mini will then ask your xserve to resolve this host name - in the public DNS this is "209.200.253.29". So ideally, you should have these two records (MX record= mail.gpspolice.net, plus "A" record for mail.gpspolice.net = 209.200.253.29) in your xserve dns. You may get away with using a different MX host name as long as the final IP is the same but better if exactly mirrors public DNS records.
    -david
    I think I've done what you've said, and still certain messages don't get sent out. Basically, any message bound for a .baseloc.net domain doesn't get sent. Here's an example of one message that get's stuck in the queue, along with the console log:
    Message ID: 46A1435234C
    Date: Wed Oct 3 09:57:17
    Size: 11009
    Sender: [email protected]
    Recipient(s) & Status:
    [email protected]:
    temporary failure. Command output: couldn't connect to lmtpd: Connection refused_ 421 4.3.0 deliver: couldn't connect to lmtpd_
    Oct 3 21:00:07 ns postfix/pipe[21091]: 46A1435234C: to=<[email protected]>, relay=cyrus, delay=39770, status=deferred (temporary failure. Command output: couldn't connect to lmtpd: Connection refused_ 421 4.3.0 deliver: couldn't connect to lmtpd_ )
    I have to say, I really appreciate your help. It's helping me understand the proper approach. Anyway, if there's any other information I can provide to help you [help me], please let me know. Thanks again.
    ...Rene

  • Invoking Forms 6i application from command line with parameters

    Hi,
    I have a java application that requires to start up and execute an existing Forms 6i application.
    I am not a java person, and I could not find any help regarding this. If anyone knows how to execute an fmx(6i) from within a java application, then please let me know. The java application has to pass in parameters so that the the Forms application opens up with the correct data.
    One alternative suggested was that the java application execute a command line invocation of the Forms application. I am looking for the correct and complete syntax to do this. The fmx can be invoked from the command line with the following entered at the dos prompt -
    c:\>OraFrm6i\Bin\ifrun60.exe<module name> <userid/password@db>. This works fine and the Forms application is executed.
    The requirement is to pass a couple of user defined parameters to the Forms application which can be used by it to query the database and display the correct information when it opens.
    Any help on this would be greately appreciated.
    Thanks
    Shailesh

    Shailesh,
    Create a parameter in your form - eg. COUNTRY_CODE and add any startup code.
    Then add the parameter to your command line (or put it in a *.bat file)
    c:\>OraFrm6i\Bin\ifrun60.exe<module name> <userid/password@db> country_code=UK
    JR

  • Mail on Leopard is dead, doesn't open except the command line on the above of the screen

    Mail program doesn't open. when I click on launchin icon just command line on the above of screen appears.
    I tried to launch it Milbox/Go to/ Inbox and it opened, but there was one big mess. other commands doesn't work.
    Mails are not neither coming in nor going out. HELP.
    Maybe I need to delete an old account and just set it up once againm but I dont get how to delete it at all.
    thanks in advance
    Kind regards
    Marcis

    If it's showing the 'open' button then it is already downloaded and is on one of your homescreens somewhere. You've checked all your homescreens and app folders for it, and can you find it via the spotlight search screen (swipe your first home screen to the right) ? There is a limit of 11 homescreens which you can access by swiping through them.
    If you can't find it then have you tried a reset to see if you can find it after the iPhone has restarted ? Press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the equivalent of a reboot.

  • Open application via. command line with parameters - Multiple times

    I'm using ANT to compile a program, then launch in FireFox ... I've looked all over for a solution to this, but have yet to find one.
    I need the command to open a specified URL in FireFox... easy enough, right?
    Solution #1 was to use the "open -a" command, with the URL- so "open -a FireFox.app/ http://someURL.com" ... the problem with this is that it opens a new window or tab every time- its a minor annoyance, but when you do 100 or more compiles during the day, its quite annoying.
    Solution #2 is to actually launch the program executable (FireFox.app/Content/MacOS/firefox) using the argument -url and that makes it so FireFox opens the URL in the current & front-most window. This worked great the first time, second time I get an error saying "A copy of Firefox is already open. Only one copy of Firefox can be open at a time."
    Anybody know how to make it so I don't have to close a window every time I compile? Your help would be greatly appreciated.
    Thanks!
    -Eric
    Message was edited by: eheaton

    If you don't get an answer here, you might try reposting in the UNIX forum. That's where the command line experts tend to hang out. Good luck.

  • Variable does not work for sqlplus (command line)

    Here is an select:
    variable x number;
    variable y number;
    variable a number;
    define x = 2000;
    define y = 2*1000;
    define a = &x+&y;
    select ener from adding where ener = &a;
    When I execute it under SQL*Plus Worksheet (client installed on my PC) then I get output:
    ENER
    4000
    1 row selected
    When I execute this same under command line sqlplus (under unix shell) then I get output
    old 1: select ener from adding where ener = &a
    new 1: select ener from adding where ener = 2000+2*1000
    no rows selected
    What is worng ?

    Nothing.
    Sqlplus is correct and sql worksheet is buggy.
    Define works with strings only. You cannot use it to calculate an expression.
    Apparently sql worksheet did calculate the expression, and sqlplus didn't, submitting it as a string.
    This is the expected behavior.
    This behavior can likely vary by version, so thank you for not providing version info.
    Will anything awful happen when you do, or is this just the lazyness epidemia in this forum?
    Sybrand Bakker
    Senior Oracle DBA
    Experts: those who did read documentation.

  • How to start a J2EE application in command line?

    Dear all,
    As known to all, in Visual Administrator we can start or stop an application in Deploy node easily.
    my question is - Is there any command can we use in command line to start/stop an application like 'startapp.bat sap.com/app1' or 'java xxx.jar startApp sap.com/app1'?
    Because we want to write a script to restart a certain application in schedule, any idea?
    Thank you in advance.

    Hi
    How to programatically start j2ee application/service  from command line
    Regards
    Sat
    Edited by: Satya Narayana on Oct 11, 2009 9:25 AM

  • Adobe AIR Application Installer command-line

    Could someone provide the command-line reference (parameters
    and usage) for Adobe AIR Application Installer?
    Tks!

    Hey Oliver!
    I've applied for an AIR distribution license but I still have
    some doubts.
    My application is based in one .air component and another one
    service created using C++. So, in order to install my application,
    I need to install both applications. I've used the bundled
    installation mentioned in the distribution docs, but it is not the
    best solution for my problem. I would like to have just one entry
    point in the “Add/Remove Programs” applet.
    Is there another way to deliver the .air application (e.g.
    not using the Adobe AIR Application Installer)?
    For example, is it possible get all files needed to create my
    .air file and install them without creating the .air file properly?
    I mean, is there any license or technical restrictions that
    invalidate this approach?
    Thanks!

  • Compile application using command line

    I want to be able to compile a personal profile application using the command line. Up until now I've used an IDE (WSDD) to compile and test my application but I need to be able to compile it using just the command line.
    Any help on the matter is much appreciated, thanks
    MBliss

    Thanks for the reply but unfortunately i'm not trying to compile a MIDP application, which is what the link refers to. I did however find out the -bootclasspath arguments i needed.

Maybe you are looking for

  • When I launch firefox 3.6.8 2 tabs open for my home page instead of just one.

    Just installed 3.6.8. At launch 2 tabs are opened, both for my home page. I have closed out several times and relaunched but each time 2 tabs are opening. Just looked at the plug-ins listed below and have no idea why I would have a plug-in for Netsca

  • Iphone will not turn on because of a software update

    My iphone went blank and the logo keeps coming on and off because of a software update. How do i fix this problem

  • #Error when missing values

    I know I have seen this before but cant remember the fix. We have columns A and B, then a variance column. Users dont want to suppress so sometimes there is #missing in both columns so the variance column is returning a #Error. I can change the suppr

  • F.62 custom print program

    Hello Experts, I need to modify the data and the layout of transaction F.62 (Print Journal Voucher).  I have searched information from the web that it is possible to add a custom print program to modify the logic.  I would like to ask what is the tra

  • Updates on SCCM Client for Silverlight, Visual C++

    Recently I've noticed that after installing a new Windows 7 system with the latest SCCM client ( 5.00.7858.1203 ), the first Software Scan shows each machine needs these three updates Is there any reason to not download these and put them into the Cl