XML - JTree  in JBuilder environment

Basically, my task is to create an basic java-xml based forum for part of my school project. My code has to be able to compile and run in JBuilder 7 Enterprise (Windows) without installing any extra APIs or XML Parsers [ :( ]. How do I do basic xml manipulations with JTree (i.e. read write) in this limited environment? Also I would love to see some sample codes on how to load xml into JTree. I haven't seen one around. Please advice. Thanks in advanced.

try this:
http://java.sun.com/j2ee/1.4/docs/tutorial/examples/jaxp/dom/samples/DomEcho02.java

Similar Messages

  • DB_LOCK_DEADLOCK: Using BerkeleyDB Xml in a threaded environment

    Hello,
    I'm having problems running a Berkeley DB application in a threaded environment. In summary, this is what I'm doing:
    I implemented the following class:
    ref class MyTestClass
    private:
         DbEnv* env;
         XmlManager* man;
         unsigned int ctr;
    public:
         MyTestClass()
              ctr = 0;
              env = new DbEnv(0);
              env->set_cachesize(0, 64*1024, 1);
              env->set_lk_max_lockers(1000);
              env->set_lk_max_locks(1000);
              env->set_lk_max_objects(1000);
              env->open("c:\\temp\\SampleDb",
    DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG |
    DB_INIT_MPOOL | DB_INIT_TXN | DB_THREAD | DB_PRIVATE, 0);
              man = new XmlManager(env, DBXML_ALLOW_AUTO_OPEN);
         void MyTestWriter()
              while(true)
                   DbXml::XmlQueryContext *ctx;
                   DbXml::XmlTransaction *txn;
                   DbXml::XmlResults *res;
                   try
                        ctx = new XmlQueryContext(man->createQueryContext(XmlQueryContext::LiveValues, XmlQueryContext::Lazy));
                        txn = new XmlTransaction(man->createTransaction());
                        res = new XmlResults(man->query(*txn, "for $v in collection('test.dbxml')/sessions return insert nodes <A/> into$v", *ctx, DB_RMW));
                        txn->commit(DB_TXN_SYNC);
                   catch(XmlException& e)
                   finally
                        delete res;
                        delete txn;
                        delete ctx;
         void DeadlockUnblocker()
              while(true)
                   int ret;
                   env->lock_detect(0, DB_LOCK_DEFAULT, &ret);
                   Sleep(5000);
    Basically I create a shared MyTestClass object and then spawn 4 threads: 3 of them execute the MyTestWriter method and 1 executes the DeadlockUnblocker method.
    What happens is that the 3 threads block even before completing the first write. After 5 seconds the DeadlockUnblocker is executed and 1 thread is unblocked and throws a "DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock" which is trapped by my catch block. However, the other threads are still hanging on the execution and the entire flow of the application is stopped.
    Anybody can tell me what I'm doing wrong ??
    Thanks
    Matteo

    Matteo,
    First, the C++ API works best if you avoid new/delete of Xml* objects. There are relatively few cases where that's necessary. Using scoped objects ensures their destruction.
    As for your hang the best tool to use is "db_stat -CA" in the environment directory at the time of the hang to find out what is going on. You'll have to not use DB_PRIVATE in the DbEnv::open() flags for it to work. While a deadlock thread is reasonable if you expect a lot of deadlocks (and concurrent write will do that) it is best to use DbEnv::set_lk_detect() to get immediate detection.
    Regards,
    George

  • Using a xml parser with jbuilder

    I'm using jbuilder and the required librairies I've just added require me to add an XML parser to the path. I've just downloaded one from www.apache.org.
    How do I incorporate this parser into my project. I need to use the following packages but I'm not sure how I can put everything together.
    If you understand what my problem is please help. Thanks , B.
    import org.w3c.dom.Document;
    import org.w3c.dom.DOMException;

    Go to tools | configure libraries.
    click the new button on the left
    Type in the name you want the library to be identified with (XML Parser or something)
    Choose the location (this determines how many people and projects have access to the libraries)
    Click the add button and find the *.jar files.
    Ok back out of the dialogs
    Now select the Project Properties (or default props to have the library available to all projects, not recommended tho)
    Select the paths tab
    Click Add and select the Library you added in the earlier steps.
    If you have any probs, www.borland.com has heaps of stuff on configuring libraries

  • Elegant XML -- JTree

    Problem:
    To build an XML editor -> an elegant way to refelct changes in the Jtree to the XML on the file system.
    Is there anyother way other than what is done in the tutorial by sun (reating an Adaptor Object inheriting from defaultMutableTreeNode )?
    any leads/ links?

    ...well i eventullay came up with a sulution ..
    1) Create Your Object(MyObject) with ref to a node in the XmlTree.
    2) add MyObject as Userobject in the DefaultmutableTree of the JTree node.
    3) So for every tree selection /Manupulation u have the org ref of the XML node in the tree which u can manupulate too.
    works great for me!

  • XML - JTree RMI

    Hi Friends,
    I am a beginner in RMI. I am trying to develop a JTree with following functionalities for XML file reading and writing
    1) generating TreeNode from String
    2) generating String from TreeNode
    Both of this functions I want to keep at Server and want to invoke using RMI.
    Following is the code:
    public interface XTreeIF
        extends Remote {
        public DefaultMutableTreeNode createTreeNode(String xmlText)
                throws RemoteException;
       public String createXmlString(DefaultMutableTreeNode rootNode)
                throws RemoteException;
    public class RemoteXTree
         extends UnicastRemoteObject
         implements XTreeIF {
      public DefaultMutableTreeNode createTreeNode(String text)
                throws RemoteException {
                         DefaultMutableTreeNode treeNode;
         treeNode = createTreeNode(parseXml(text));  //function for creating treenode
         return _treeNode;
       public String createXmlString(DefaultMutableTreeNode treeNode)
                throws RemoteException {
         StringBuffer xml = new StringBuffer();
         xml.append("<?xml version=\"1.0\" ?>");
         xml.append(createXmlNodes(treeNode));  //function for creating xml nodes
         return xml.toString();
    }I am getting error on the client side as:
    java.rmi.UnmarshalException: Error unmarshaling return header;
    Can anyone please suggest what may be the problem and how to sort it out.

    Hi Mr.Nitin,
    print the stak trace and I can you help.
    Bye.

  • A issue with post-procesing  phase of XML Publisher in eBS environment

    I have to optimize some XML Bi Publiser reports in eBS 11i enviroment . I optimezed sql query from report but ... my reports take a long time to finish . My log file of the request looks like :
    Report Builder: Release 6.0.8.27.0 - Production on Fri Oct 1 15:24:48 2010
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Enter Username:
    Executing request completion options...
    ------------- 1) PUBLISH -------------
    Beginning post-processing of request 48022736 on node TCONCMGR1 at 01-OCT-2010 15:38:30.
    Post-processing of request 48022736 completed at 01-OCT-2010 16:36:07.
    So , my query takes about 14 minutes to complete . and 1 hour in post-processing phase . Why takes so long time to make this phase and how I make to downing this time interval.
    Please give me some advices.
    Some pointers to some articles covering this area would be helpfull also.
    Many thanks,
    Aurel

    Hi ravi;
    Please check below which could be helpful for your issue:
    XML publisher Troubleshooting
    oracle.apps.fnd.cp.opp.PostProcessorException: XML Publisher output file no
    How To Increase the Processing Performance of Inbound XML Messages [ID 276016.1]
    How to increase the performance of inbound transaction delivery XML messages [ID 265855.1]
    Regard
    Helios

  • JBuilder environements settings?

    Hello,
    I created a jar file using JBuilder6. When I am closing JBuilder, opening the cmd on windows,
    I can run the jar file on the machine I created the file but not on another one.
    Does anyone now what should be done for this jar file to be really multiplatforms?
    Thanks

    It doesn't even find the main class!
    I think JBuilder is "taking advantage of the situation" and you need the entire set below
    in order to make this run!!!
    I might want to try the jar cvf command line but then their are no manifets file created even by default,
    so then maybe you could help on this one? I don't know, what do you suggest?
    Thanks.

  • Jbuilder compiler problem with xml DOM - please help.

    my problem is that I am using jbuilder 4 professional to compile/run my code.
    However I want to use the XML DOM but jbuilder does not appear to support the necessary packages for use with XML.
    How can I get round this.
    Can I compile instead from the command line - I am using JDK1.4 which supports the java xml packages necessary. Or is there a way of adding the necessary files to my project?
    thanks, B

    Add the required jar files to your project properties->classpath in JBuilder
    The only problem is that. I have been using JBuilder without any problems.

  • XML Reports completes in warning

    Hi gurus,
    I am having trouble our developer have made XML report and registered it when he is running the concurrent request is completing in warning (yellow color) and no output is generate and below is the log file for the concurrent request.
    we never had any XML report in our environment this is the first time so do we need to do any setup for XML reports to generate fine ?
    also where is OPP service log files location ?
    Thanks
    Regards,
    HASSAN
    General Ledger: Version : 12.0.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    GLTS module: GL_TRIAL BALANCE ACCOUNT WISE SUMMARY
    Current system time is 22-OCT-2011 12:20:40
    +-----------------------------
    | Starting concurrent program execution...
    +-----------------------------
    Arguments
    p_set_of_books_id='1001'
    P_CHART_OF_ACCOUNTS_ID='30008'
    p_company='001'
    COMP2='001'
    p_project='1101'
    p_project_to='1101'
    p_period='200612'
    p_period_to='201112'
    Forcing NLS_NUMERIC_CHARACTERS to: '.,' for XDO processing
    APPLLCSP Environment Variable set to :
    Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
    American_America.UTF8
    Enter Password:
    Report Builder: Release 10.1.2.3.0 - Production on Sat Oct 22 12:20:42 2011
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Executing request completion options...
    ------------- 1) PUBLISH -------------
    Beginning post-processing of request 785118 on node TEST at 22-OCT-2011 12:20:57.
    Post-processing of request 785118 failed at 22-OCT-2011 12:20:58 with the error message:
    One or more post-processing actions failed. Consult the OPP service log for details.
    ------------- 2) PRINT   -------------
    Not printing the output of this request because post-processing failed.
    Finished executing request completion options.
    Concurrent request completed
    Current system time is 22-OCT-2011 12:20:58
    ---------------------------------------------------------------------------

    hassanksa wrote:
    the desktop version of xml pub which our developer used for report development was not compatible with our apps
    then i recommended developer with the correct version once he used the right one the reports worked fineThanks for the update and for sharing the solution!
    Hussein

  • Problem in xml header syntax!!

    Greetings,
    I'm testing hibernate framework, I'm writing this mapping xml file. Regardless the fact it is a hibernate example, this is a normal xml file problem. When I write that xml to the JBuilder editor, I get an error msg. I don't know why! and this is actually the question, how to make the xml below valid?
    I'd like to share my experience about this file. The problem is in the line
    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
    and this is the key to the hidden solution!! is this line like import statement so the editor doesn't see it? when I delete it, the editor then says: that <hibernate-mapping>, <class> etc must be declared!!
    Thanks in advance for help
    below is the xml file code:
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
    <hibernate-mapping>
    <class name="hello.Message" table="MESSAGES">
    <id name="id" column="MESSAGE_ID">
    <generator class="increment"/>
    </id>
    <property name="text" column="MESSAGE_TEXT"/>
    <many-to-one name="nextMessage" cascade="all" column="NEXT_MESSAGE_ID"/>
    </class>
    </hibernate-mapping>

    In my experience with XML (and not hibernate), the set of messages "{every tag name} must be declared" usually means you have not turned on validation properly in whatever is parsing your data. I don't know the magic incantation to parse with a DTD, so I cannot help you with a solution, just with a clarification of the problem.
    Dave Patterson

  • Importing Arabic text from an XML file

    Importing text from an XML file to appear as text in Flash
    works in English, however if the text I want to import is in
    Arabic, when I test the movie there is no text at all.
    Is there some particular syntax to preface the Arabic text?
    I'll want to import text from XML in other languages too.
    (French)
    I'd cut and pasted some Arabic text into the XML file that
    displays pictures and text in the "slideshow.fla" (
    http://www.adobe.com/support/flash/applications/jpeg_slideshow_xml/jpeg_slideshow_xml03.ht ml)
    Substituting Arabic text for English text, editing the XML
    file with Dreamweaver.
    Any ideas as to how I might achieve my objective of importing
    Arabic text into Fash?
    I'd started developing my prototpe in Macromedia Director 7,
    and then Director MX, but I have not found a suitable Arabic font
    that I can embed that will allow me to display Arabic fonts in
    Adobe Director. I have the Arabic text in a Word document.
    I've dicovered that my Flash MX Pro and Dreamweaver both
    support Arabic fonts, but I want to import text from an XML file.
    I'd prefer using cast libraries and cast members, but I don't
    know of an equivalent in Flash to what I'm comfortable with in
    Director.

    Oh so many questions. You probably aren't going to like the
    answers. I have Flash MX04 pro (aka Flash 7) and things made a big
    jump between MX (aka 6) and MX04. If you only have MX, there might
    not be a way to do this. All my advice is based upon MX04 or
    higher.
    It is possible to do complex languages in Flash. My
    experience is with Hindi and I've helped a few folks here with
    Arabic.
    You won't be able to use text from Microsoft Word – at
    least I don't think so. The XML file will need to be saved in the
    UTF-8 format. I think Word uses its own scheme and won't work. But
    I'm not a Word expert. Something like Text Edit (Mac) or WordPad
    (PC) should be able to save a UTF-8 file.
    The next problem is you mention "suitable Arabic font that I
    can embed." AFAIK, you can't embed any of the complex scripts in
    Flash. You just have to rely on the end user having appropriate
    fonts installed and enabled. Most operating systems from 2000 on do
    have this – although some folks like to remove them to save
    space.
    Next issue will be line composing. I've found that when using
    anything above the normal Latin range that Flash suddenly forgets
    how to make a line fit into a text area. It will just break things
    in the middle of words and not even notice the spaces between
    words. I've written a little snippet of code that "composes" the
    lines. It works well with Hindi and folks here have used it with
    Arabic and not come back saying that it doesn't work. Search the
    forums (both the Flash and Actionscript) if you can't find it I'll
    dig it out when I get home.
    So here is the checklist:
    Make sure the XML is saved in UTF-8
    Import the XML file
    In Testing environment go Debug–>List variables.
    Does it show up correctly there?
    Does it show at all in a text field?
    Use the "composer" to make the lines break.

  • Using debug mode with jbuilder 4 (or other tool) and wl 6.0

    Hello,
    I would like to know if there is a way to use jbuilder environnement to
    debug ejb deployed on WL. I would like to be able to set break points into
    my source code and be able to display variables values.
    If it is not possible with jbuilder, is it possible with an other tool ?
    If not, how can you debug ejb ? For exemple if I want to be sure a specific
    line has been callde, do I need to stop my server, insert a system.out,
    redeploy my ejb and restart my WL or is there a more simple way to do it ?
    Thank's.
    Nicolas.

    Hello,
    I would like to know if there is a way to use jbuilder environnement to
    debug ejb deployed on WL. I would like to be able to set break points into
    my source code and be able to display variables values.
    If it is not possible with jbuilder, is it possible with an other tool ?
    If not, how can you debug ejb ? For exemple if I want to be sure a specific
    line has been callde, do I need to stop my server, insert a system.out,
    redeploy my ejb and restart my WL or is there a more simple way to do it ?
    Thank's.
    Nicolas.

  • Fonts in JBuilder

    A have a java application that is supposed to show either chinese or western europe fonts according to selections made in the application.
    I works fine when I start the application from within the JBuilder environment, but when I move the compiled jarfile to any other place and run it, I cannot show the chinese font. I only get little squares instead.
    What is missing?

    A have a java application that is supposed to show
    either chinese or western europe fonts according to
    selections made in the application.
    I works fine when I start the application from within
    the JBuilder environment, but when I move the compiled
    jarfile to any other place and run it, I cannot show
    the chinese font. I only get little squares instead.
    What is missing?
    The JBuilder app provides its own internal JDK, and Borland has modified the font.properties files to support a wider range of characters than the default font.properties supplied by Sun. Unfortunately, the JDK/JRE supplied by Sun is less capable in some ways...although it obviously can be modified.
    The answer: you can use physical fonts directly from your applications or you can modify your font property logical fonts to include a mapping to the Chinese physical fonts. Or...you can change your Windows host in the Regional Settings control panel so that the host's default locale is Chinese. Your JRE will then find the correct Chinese font.properties file and will access system fonts appropriately.
    Regards,
    John O'Conner
    http://www.joconner.com/javai18n/

  • Overriding web.xml using Plan.xml

    Hi,
    I want to override certain values (MAX_ROW_FETCH_SIZE)  in web.xml using Plan.xml for a servlet deployed on weblogic server.
    My web.xml looks like this.
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
             version="2.5">
      <servlet>
        <servlet-name>trial</servlet-name>
        <servlet-class>oracle.apps.cmi.sv.fwk.webui.trial</servlet-class>
        <init-param>
          <param-name>MAX_ROW_FETCH_SIZE</param-name>
          <param-value>50</param-value>
        </init-param>
        <init-param>
          <param-name>JDBC_MAX_FETCH_SIZE</param-name>
          <param-value>20</param-value>
        </init-param>
      </servlet>
      <servlet-mapping>
        <servlet-name>trial</servlet-name>
        <url-pattern>/trial</url-pattern>
      </servlet-mapping>
    </web-app>
    My Plan.xml looks like this
    <?xml version='1.0' encoding='UTF-8'?>
    <deployment-plan xmlns="http://xmlns.oracle.com/weblogic/deployment-plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd">
      <application-name>SPUF</application-name>
      <variable-definition>
        <variable>
          <name>SessionDescriptor_timeoutSecs_13708393894780</name>
          <value>3602</value>
        </variable>
        <variable>
          <name>MAX_ROW_FETCH_SIZE</name>
          <value>3</value>
        </variable>
        <variable>
          <name>JDBC_MAX_FETCH_SIZE</name>
          <value>2</value>
        </variable>       
      </variable-definition>
      <module-override>
        <module-name>SPUF.war</module-name>
        <module-type>war</module-type>
        <module-descriptor external="false">
          <root-element>weblogic-web-app</root-element>
          <uri>WEB-INF/weblogic.xml</uri>
          <variable-assignment>
            <name>SessionDescriptor_timeoutSecs_13708393894780</name>
            <xpath>/weblogic-web-app/session-descriptor/timeout-secs</xpath>
          </variable-assignment>
        </module-descriptor>
        <module-descriptor external="false">
          <root-element>web-app</root-element>
          <uri>WEB-INF/web.xml</uri>
          <variable-assignment>
            <name>MAX_ROW_FETCH_SIZE</name>
            <xpath>/web-app/servlet/init-param/[param-name="MAX_ROW_FETCH_SIZE"]/param-value</xpath>
            <operation>replace</operation>
          </variable-assignment>
          <variable-assignment>
            <name>JDBC_MAX_FETCH_SIZE</name>
            <xpath>/web-app/servlet/init-param/[param-name="JDBC_MAX_FETCH_SIZE"]/param-value</xpath>
            <operation>replace</operation>
           </variable-assignment>                     
        </module-descriptor>
        <module-descriptor external="true">
          <root-element>wldf-resource</root-element>
          <uri>META-INF/weblogic-diagnostics.xml</uri>
        </module-descriptor>
      </module-override>
      <config-root>/home/oracle/ebssdk2</config-root>
    </deployment-plan>
    I can see new value reflected for "Session TimeOut" for service configuration.
    However when I use service to query certain data while considering "MAX_ROW_FETCH_SIZE" parameter, It is still querying 50 rows (Value in web.xml) at a time instead of 3 (As defined in Plan.xml)
    I am using servlet init method to get init parameters in my java file.
    Can someone help me to overcome from this issue or have any suggestion?

    You could use Apache Ant and create 2 separate WAR files , one for development and one for production.
    Normally I don't create a WAR file for the development environment. WAR file is made only for production.
    This is how my Ant task runs currently.
    1) For the development environment the ant task runs only to compile Java classes and nothing else, web.xml is that for development environment.
    2) When the app is ready for production , I run Ant to copy all files from my dev folder to a temporary build folder - during this copy I filter out the .java files (since there's no longer a need for them in production) only class files are moved.
    3) Then I treat the above temporary folder as the source folder, and run the Jasper pre-compiler which significantly alters the web.xml file .
    But the good part is that my original development web.xml stays unaltered since it is in it's own folder.
    4) Then finally I run a WAR task on the processed contents of the temporary build folder which contains the modified web.xml
    This way each environment has it's own web.xml .

  • How to get EJBs environment?

    EJBContext.getEnvironment() is deprecated.
    "Deprecated. Use the JNDI naming context java:comp/env to access enterprise bean's environment."
    I'm confused on how to use "java:comp/env" to the the EJBs environment. Can anyone shed some light on this for me?
    Thanks.
    Eric

    Thanks.
    After reading that, I think I've asked the wrong question. I want to be able to set/change an MDB's provider-url. I assume I could do this in the setMessageDrivenContext method. The problem is that our dev/test/prod environments will each have a different provider-url. Building a different weblogic-ejb-jar.xml file for each environment will pretty much ensure that someone will eventually deploy the wrong one and prod will be listening to a dev topic. Anyone have an elegant solution for this?
    Thanks.

Maybe you are looking for


HashFlare