Problem with basic tutorial!

I am following this very basic tutorial:
http://xstream.codehaus.org/tutorial.html
But when I parse this xml:
<person>
<firstname>Joe</firstname>
<lastname>Walnes</lastname>
<phone>
<code>123</code>
<number>1234-456</number>
</phone>
<fax>
<code>123</code>
<number>9999-999</number>
</fax>
</person>
to the Person object I get the error:
[Fatal Error] :1:1: Content is not allowed in prolog.
Exception in thread "main" com.thoughtworks.xstream.io.StreamException: : Content is not allowed in prolog.
This is the code:
public class Person {
private String firstname;
private String lastname;
private PhoneNumber phone;
private PhoneNumber fax;
public class PhoneNumber {
private int code;
private String number;
public void runXStream(){
String pathToXml = "testP.xml";
XStream xstream = new XStream(new DomDriver());
xstream.alias("person", Person.class);
xstream.alias("phonenumber", PhoneNumber.class);
Person p = (Person)xstream.fromXML(pathToXml);
What am I missing?

xstream.alias("person", Person.class);
xstream.alias("phonenumber", PhoneNumber.class);I'm not familiar with the API you're using, but from looking at the above, I'm guessing this means:
"Any tag named 'person' should be de-serialized into a Person object"
Ok, fine.
And
"Any tag named "phonenumber" should be de-serialized into a PhoneNumber object"
Well, I see no "phonenumber" tag in your xml. I see "phone" though.
And what about "fax"?

Similar Messages

  • Newbie to blackberry...facing problem with basics

    hi guys,
                 i got my playbook today...........facing problem with basics
             1.how do i perform file actions(like create folder, move,rename)
             2.cant  use drag gesture
             3. ppt applications doesnt show a option to create new presentation(word and xls apps seem to work fine)
             4.can we even download apps from app world to pc  bcuz  everytime it says connect the smartphone to computer even though its physically connected and blackberry desktop manager also shows the device is connected"

    To mange your files, try a file manager like Files & Folders.
    Drag gestures are available in OS 2.0 which should be available before the end of Feb (rumour has it, this week).
    In OS 2 you will also be able to create new PPT presentations.
    To download apps from App World you need to be connected to a Wifi network at the moment.
    Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands

  • Encountering Problems with Basic Sound Tutorial

    Hello everyone,
    I am encountering problems with a basic sound tutorial. I am absolutely confused as to what the problem may be because the code is so simple, and is essentially copied from the textbook. I am convinced that I have done something very silly but cannot see it.
    I have attempted to run this in an appletviewer, Firefox and Internet Explorer. I have attempted to launch it from both a .class file and a .jar file. I have uninstalled and offline installed the JDK and JRE and successfully tested the new installations.
    The audio file I am attempting to load and play is an .AU (Sun/Next 8-bit u-law) audio file I created in Audacity. It is located in the same folder as the AudioApplet.class file.
    My sound system is defintely on, since I have listened to music all day. I have attempted running the program with Media Player closed.
    package edu.myuniversityid.sandbox;
    import java.applet.Applet;
    import java.applet.AudioClip;
    * @author Ibuki
    public class AudioApplet extends Applet
         * Initialization method that will be called after the applet is loaded
         * into the browser.
        public void init()
            super.init();
            AudioClip ac = this.getAudioClip(this.getDocumentBase(), "sample.au");
            ac.play();
    }The code compiles fine, however absolutely I get a small white window when it is run. No sound.
    Thankyou for your time.
    Regards,
    Ibuki.
    PS. I am sure this worked before the university forced me to update my version of Windows to SP2. Hence, the reason for reinstalling Java. Twice.
    Edited by: Ibuki on Jan 31, 2008 11:09 AM becasuse: Added a PS.

    I have attempted this alternative, without success:
        public void init()
            try
                super.init();
                URL url = new URL(this.getDocumentBase(), "sample.au");
                AudioClip ac = this.getAudioClip(url);
                ac.play();
            catch (MalformedURLException ex)
                Logger.getLogger(AudioApplet.class.getName()).log(Level.SEVERE, null, ex);
        }The sample.au is definetly in the correct directory. Both File Explorer and NetBeans confirm this.
    Edited by: Ibuki on Jan 31, 2008 11:59 AM
    I have discovered a temporary solution that works in the applet viewer. The applet will load and plays the correct music perfectly. However, using this code it is not working when I try to deploy it using a web browser (MSIE and FF)!
    public void init()
            super.init();
            AudioClip ac = this.getAudioClip(this.getClass().getResource("sample.au"));
            ac.play();
    Edited by: Ibuki on Jan 31, 2008 12:12 PM
    Eureka!
    Having worked in the applet viewer I managed to get it working in the web browser by simply packaging my SoundApplet.class and sample.au into a .jar archive.
    <html>
         <body>
              <applet code="edu.myuniversityid.sandbox.AudioApplet.class" archive="dist/AudioApplet.jar">Unfortunately, this applet content cannot be displayed on this web page because your current browser does not support Java SE 6! Please <a href="http://www.java.com/">update your version of Java</a>.</applet>
         </body>
    </html>
    public void init()
            super.init();
            AudioClip ac = this.getAudioClip(this.getClass().getResource("sample.au"));
            ac.play();
        }Thankyou everyone.
    This thread can be closed if applicable. I'm not aware of the current moderation policy on this forum.
    Edited by: Ibuki on Jan 31, 2008 12:12 PM

  • Problem with Photoshop tutorial

    I'm trying to follow this tutorial here,
    http://www.layersmagazine.com/photoshop-cs4-a-picture-worth-a-thousand-words.html
    Which is turning a portrait into a portrait of words, and i'm having a problem with step 9.
    "9 PASTE INTO A LAYER MASK
    Show all layers and activate the layer with the painted words. Click on  the Add Layer Mask icon at the bottom of the Layers panel to add a layer  mask. Hold down Option (PC: Alt) and click on the layer mask thumbnail  (this will hide the painted text and show just the mask). Press  Command-V (PC: Ctrl-V) to paste the copied pixels onto the mask. Press  Command-D (PC: Ctrl-D) to Deselect. Press Command-I (PC: Ctrl-I) to  Invert the mask (your mask should look like a negative of the  black-and-gray pixel image that you pasted)."
    When I paste, the image comes up in a new layer, and not on the mask. I've gone over it multiple times, and went back to previous steps to make sure I did everything right, so i'm not sure what the problem is. Can anyone help?
    Thanks,
    Brian

    Did you Alt click on the mask thumbnail
    (the image turns white) and then paste?
    MTSTUNER

  • Problems with basic lower third ?

    Is anyone having a problem with the "basic lower third" template ? I keep getting a second, "ghost" copy of the first (top) line of the title created, shifted about 10 pixels above the original .. this only seems to happen after the project and/or library is saved and re-opened ... FCP X 10.1.4, Macbook Pro Retina ... thanks in advance

    Thanks, but nope, if you look closely, you can see that there is a black drop shadow already set ... unselecting it just gives you the same double image in white, just without the black drop shadow ... bizarrely, it's only ever the top line that is doubled up ... it's as if a second copy of the top line is created ... it is also un-selectable on screen, i.e. if you click on the second copy you can't edit or move it ... the second copy only appears after the project/library is closed and re-opened ... i.e. it all looks fine when you create it

  • Problem with Composition Tutorial

    Hi at first,
    I am new to this forum as well as new to the SAP composition application topics
    Since I want to learn how to build composite applications with the Netweaver Developer Studio/ Process Composer I started with the tutorial "Getting Started with Composite Designer" included  in the Studio.
    If I follow the instructions up to modeling of data objects the final step of generating the tables of the emplserv.bl.caf package fails with the error message:
    com.sap.engine.services.webservices.jaxrpc.exceptions.ProxyGeneratorException: Problem with WSDL file parsing. See nested message.
    Problem with WSDL file parsing. See nested message.
    IO Exception occurred while parsing file:unknown protocol: c
    unknown protocol: c
    Can anyone help me with this problem?
    Thanks in advance

    Hi Felixw,
    You are probably using JDK 1.6 instead of JDK 1.5.
    Please adjust the startup -vm parameter to be the javaw.exe of JDK 1.5 and you are just fine!
    For instance:
    C:\IDE\eclipse\SapNetweaverDeveloperStudio.exe -vm "c:\jdk1.5.0_18\bin\javaw.exe"
    Kind regards,
    Ivan

  • Problems with JGSS tutorial - AccessControlException

    Hi all,
    unfortunately I've got a big problem with the ClientServer JGSS tutorial.
    After doing everything like the HTML file said, I firt started the server and then the client.
    The client then produces this exception:
    Kerberos username [stnt1]: myName
    Kerberos password for benni: myPass
    java.security.AccessControlException caught
    access denied (javax.security.auth.kerberos.ServicePermission SampleServer/[email protected] initiate)
    java.security.AccessControlException: access denied (javax.security.auth.kerberos.ServicePermission SampleServer/[email protected] initiate)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
         at java.security.AccessController.checkPermission(AccessController.java:401)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
         at sun.security.jgss.krb5.Krb5Context.checkPermission(Krb5Context.java:1089)
         at sun.security.jgss.krb5.Krb5Context.initSecContext(Krb5Context.java:527)
         at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:213)
         at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:158)
         at SampleClient.main(SampleClient.java:150)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at MyAction.run(Login.java:241)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
         at Login.main(Login.java:200)
    ... and I really don't have any clue about why exactly I'm getting this error.
    Thanx a lot for hints and help ...
    Benjamin

    Hi again,
    got it ... I hat my computer name written wrong in the start script.
    Bye,
    Benjamin

  • Problem with OrderBooking tutorial

    A little problem...when i do obant in PriceQuote I have no problem with RapidDistributors but with SelectManifacturing I have:
    all:
    [bpelc]Convalida BPEL non riuscita
    lettura file wsdl non riuscita...
    in TaskManager?wsdl perchè ...PARSER ERROR...
    Accertarsi che il file esiste nella posizione specifica...
    soluzione:Se il sito dispone di un server proxy può essere necesssario configurare BPEL server, designer e browser con le impostazioni del server proxy.
    I have not proxy server!But in Preferences I have put (as the guide says) localhost|127.0.0.1 in exception.
    Thanks,
    Ema

    BPEL Process Manager 10.1.2 GA
    Bpel designer
    Oracle IDE     10.1.2.17.84
    Business Components Version     10.1.2.17.96
    UML Modelers Version     10.1.2.16.71
    Versioning Support     10.1.2.16.71
    WebDAV Support Version     10.1.2.16.71
    Struts Modeler Version     10.1.2.6.15
    BPEL Designer     10.1.2.0.0 (Build 050504)
    Designer Generators Framework     10.1.2.7.56
    ADF UIX     2.2.16
    java.version     1.4.2_06
    java.home     C:\Programmi\OracleBPELPM1\jdk\jre
    java.vm.name     Java HotSpot(TM) Client VM
    java.vm.vendor     Sun Microsystems Inc.
    java.vm.version     1.4.2_06-b03
    user.language     it
    user.region     <no value assigned>
    user.name     emanuele
    user.home     C:\Documents and Settings\emanuele
    user.dir     C:\Programmi\OracleBPELPM1\integration\jdev\jdev\bin
    os.name     Windows XP
    os.version     5.1
    os.arch     x86
    Ema

  • New to JDeveloper, having problems with EJB tutorial.

    Hi,
    I'm new to the world of JDeveloper, I'm trying to follow this tutorial
    http://st-curriculum.oracle.com/obe/jdev/obe11jdev/ps1/ejb/ejb.html
    Firstly when I create an entity from a table I get the following error;
    Starting Offline Database Synchronization
    Generating classes for Entity CbsdSecurity...
    Entity generation for CbsdSecurity failed.
    I'm not really sure why this is, however I suspect this is at the heart of the problems.
    If I continue I can get to the point where I create a EJB Diagram, however when I try to drag my autogenerated class onto the diagram I get the following error;
    "Entity does not belong to Persistence Unit xxxxEJB which is associcated with Diagram EJB3.ejb_diagram"
    In addition the log at the bottom has the following warnings.
    23-Sep-2010 10:07:46 oracle.security.jps.internal.credstore.ssp.CsfWalletManager openWallet
    WARNING: Opening of wallet based credential store failed. Reason java.io.IOException: PKI-02002: Unable to open the wallet. Check password.
    23-Sep-2010 10:07:53 oracle.adf.share.jndi.ReferenceStoreHelper getReferencesMapEx
    WARNING: Incomplete connection reference object for connection:fcs2ukd
    Now my database connection doesn't seem to remember the password even though I have ticked the 'remember password' tick box.
    I am developing under Windows XP using JDK1.6.0.21
    If anyone could point out what I'm going wrong I would be very grateful.
    Thanks
    Rich
    Edited by: Rich Carless on Sep 23, 2010 9:32 AM

    Try to test Your DB connection in JDeveloper. Is it success?
    Best regards, Debuger!

  • Problem with HelloWorld tutorial

    As I created HelloWorld process based on tutorial http://st-curriculum.oracle.com/obe/fmw/obpm/11g/r1/firstProcess/firstprocess_obpm11g.htm
    Deployment fails with exception. Anybody can help with this?
    java.lang.RuntimeException: oracle.bpm.metadata.exception.MetadataException: BPM
    -70812: Process 'HelloWorldProcess' not found. Cause: The specified process was
    not found. Action: Check that the name of the process is correct
    at oracle.bpm.bpmn.engine.model.ModelCreator_FromMetadata.createModel(Mo
    delCreator_FromMetadata.java:66)
    at oracle.bpm.bpmn.engine.model.deploy.schema.BpmnDesignSchema.init(Bpmn
    DesignSchema.java:203)
    at oracle.bpm.bpmn.engine.service.BPMNServiceEngine.deploy(BPMNServiceEn
    gine.java:406)
    at oracle.bpm.bpmn.engine.service.BPMNServiceEngine.deploy(BPMNServiceEn
    gine.java:104)

    Im facing the same problem, the same stack trace but I'm trying to deploy two BPMN processes into my composition. Any idea??
    <Nov 1, 2010 5:40:45 PM CST> <Error> <oracle.integration.platform.blocks.deploy.servlet> <SOA-21037> <Sending back error message: Error during deployment: Deployment Failed: Error occurred during deployment of component: Resguardo to service engine: implementation.bpmn, for composite: PSDProcesses: java.lang.NullPointerException..>
    java.lang.RuntimeException: oracle.bpm.metadata.exception.MetadataException: BPM-70812: Process 'Process2' not found.  Cause: The specified process was not found.  Action: Check that the name of the process is correct

  • Problem with official tutorial

    Hello fellows,
    I’ve got an doubt about tutorial that is on the net. I
    have installed trial version and wanted to start with Flex, and I
    took tour on tutorial that is on
    http://www.adobe.com/devnet/flex/articles/first_flexapp_07.html
    but I’ve meet next problems:
    1.
    <mx:Array id="identifier">
    <mx:Object>
    <label>literal string</label>
    <data>another literal string</data>
    </mx:Object>
    </mx:Array>
    This yield syntax error and only works if I write
    <mx:Object label=”…”
    data=”…” />
    2.
    After I added list, button, event and …
    <mx:List id="cart"/>
    <mx:Script>
    <![CDATA[
    function addToCart():Void {
    cart.addItem(coffeeCombo.selectedItem.label,coffeeCombo.selecte
    dItem.data);
    ]]>
    </mx:Script>
    But there is a message that function addItem doesn’t
    exist on the list object. I was looking on the documentation and
    there is only addChild method that receive object of type
    DisplayObject.
    Ok, probably you can notice by now that I am really newbie to
    Flex but I would be very thankful if someone can point me what is
    wrong and where to look for better and more accurately tutorial.
    Thanks in advance for your effort and time.
    Alex

    I should say that it is a tutorial about Flex 1.5. Flex 2 has
    changed much. So you could not compile codes of 1.5 using Flex
    Builder 2.0 . I do not know what has changed to Object class so
    that you can not complie it. But i do know the second question. In
    Flex 2.0, you can no longer use the following line:
    List.addItem();
    Instead, using the following line:
    List.dataProvider.addItem();

  • Problem with jms tutorial

    I try to run Chapter 7 simple example with j2ee in sun's jms tutorial.
    I followed instruction in tutorial to compile,create queue, create MDBApp.ear, run j2ee server and depoly message-driven ejb. But there is a strange thing
    On the client terminal
    Initiating login ...
    Binding name:'java:comp/env/jms/QueueName"
    Binding name: 'java:comp/env/jms/MyQueueConnectionFactory"
    Java(TM) Message Service 1.0.2 Reference Implementation (build b14)
    Sending message: This is message 1
    then client stop
    But on the j2ee server side, nothing happened.
    still display
    Deploying message driven bean MessageBean, consuming from jms/MyQueue
    Application SampleMDBApp deployed.
    I even tried run
    runclient -client SampleMDBApp.ear -name SimpleClient
    but the result is same.

    I'm having a similar problem when I tried to publish some message to
    my client. EJB seems to send the message but client never receives it.
    Anyone care to shed some light?

  • Problem with DVDSP4 tutorial

    Hello to all...
    I've noticed that this issue came up once before around here, but it didn't seem to get resolved.
    To step through the DVDSP4 tutorial that comes with the program, you obviously have to start off by importing assets. Unfortunately, two important files - menu files apparently built in Motion and having .motn extensions - stubbornly refuse to come in. A quick note pops up claiming that the two files are "incompatible assets" and that's it. Without them we rookies can't even get through building the project's main menu. End of lesson.
    Any suggestions for a workaround?
    Just so you know, the two unacceptable files are "WebMenu.motn" and "MotionMenu.motn" All other assets imported without issue.
    Thanks in advance for any help you can provide...
    - orson

    Thank you Ninja, but unfortunately I saw nothing on the link you offered to address my particular situation.
    There was one late breaking news item for the DVDSP tutorial, but it did not pertain to my problem importing Motion created assets provided on the DVDSP tutorial disk.
    - derek

  • Problem with Servlet Tutorial

    I am going through the servlet tutorial with a specific end in mind. I found a section that I think relates exactly to what I want to do. I want to have servlet redirect the user to another URL. The following code is given as an example.
    public class Dispatcher extends HttpServlet {     
       public void doGet(HttpServletRequest request,      
          HttpServletResponse response) {     
          request.setAttribute("selectedScreen",     
             request.getServletPath());     
          RequestDispatcher dispatcher = request.     
             getRequestDispatcher("/template.jsp");     
          if (dispatcher != null)     
             dispatcher.forward(request, response);     
       public void doPost(HttpServletRequest request,      
    }The problem is that I can't compile this. There is no HttpServletRequest.getRequestDispatcher(String) method. Am I misssing something here? Am I even on the right track?

    An extract from one of my servlets that redirects to
    another URL is
    this:response.sendRedirect(response.encodeRedirec
    URL("NoLogon"));But it appears you want to
    forward, rather than redirect. There's a difference,
    but I don't exactly know what it is. The forwarding
    example in my servlets book looks like
    this:RequestDispatcher dispatcher =
    getServletContext().getRequestDispatcher(address);
    dispatcher.forward(request, response);
    I tried pasting your first example into my code and got the follwoing error:
    Method encodeDirectURL(java.lang.String) not found in interface javax.servlet.ServletResponse
    It seems like there is still something missing here. When I look at the API I only see four methods for this class.

  • Upgraded from Tiger to Snow Leopard - now have problems with basic apps?

    I have a 2007 iMac (5.1, 2007) dual core. It's capable of running Snow Leopard and Lion (but not, I believe ML).
    I just bought the upgrade SL discs from Apple and installed them as an upgrade, moving up to 10.6.3 (from the discs). After running software update I'm now on 10.6.8.
    Since upgrading I've successfully run Time Machine. However I have the following problems:-
    A bunch of emails were present in the Inbox, but contained no body text - just the subject line. I have managed to since find most of them successfully from TM. This is a minor annoyance but I thought I'd mention it.
    ITunes won't boot up. It booted the first time I tried it, but since then the little icon just bounces up and down.
    Certain apps won't quit properly. I quit from the top menu, but the little blue light remains under the icon in the dock. I then have to 'Force Quit - Application Not Responding' *every time*.
    Safari frequently won't load up bookmarked or seach pages, the progress bar gets stuck part way across and I stare at the rainbow pinwheel for ages, before having to quit, then Force Quit, then restart Safari and try again.
    Now, I'm tempted to do a Clean Install, but after four international moves (Singapore-Australia-UK-Canada) I no longer have any of the original discs, and thus as I understand it will lose iLife. And iLife 11 needs Lion.
    I've done a disc permissions repair thing via the Mac Disc Utility. I've run a few clean-up operations via Onyx.
    Any suggestions gratefully received. My Mac as been running great for years, but this upgrade has been extremely disappointing thus far.
    thanks
    Feargus

    Hi baltwo
    Many thanks for your advice. I've read all the links and will be buying a 2nd external HD to do a SuperDuper back up. I already had a 1Tb drive with Maxtor back up on it, and I also managed to get a Time Machine back up as well, so at least my data should be safe.
    Qn - If I back up the System and Utility folders as well as the Home folder, I don't suppose I can restore them after an install and everything (eg iLife) will 'just work'?
    Anyway, I went straight from Tiger to Snow Leopard. I don't have any Tiger discs either (see reasons above) so now have no way of restoring original set up. I tried to boot from the SL install CD and then hold 'C' but must be getting something wrong as I don't get the Disk Utility pop up. It just boots as normal to the desktop.
    Anyway, via the normal Disc Utitlity I've done a Repair Permissions again with no major issues. However, my Onyx software now won't run at all so I can't clean any caches a second time.
    I've contacted the Apple rep who sold be the SL discs but she's not got back to me yet re iLife.
    This weekend I'm going to try a fresh upgrade. If that fails I'll try Erase and Install, if I can get the 'C' button timing right. I'll update if I have any successs.
    cheers
    f

Maybe you are looking for

  • 2 ISP link failover in ASA 5505

    Hi, I have ASA 5505, want to configure the 2 ISP link Tata and Airtel with failover. I want to configure the WebVPN with failover, so that user don't need to change the public address when one link goes down. thanks with regards Ashish Kumar

  • Error in deploying from Visual Studio 2010.

    Error occurred in deployment step 'Activate Features':  Field type SoftContent is not installed properly. Go to the list settings page to delete this field. Indul Hassan

  • Invalid Email Password - but its not.

    Hi - I hope you can help. I had a BB curve 8520 for past 2 years and loved it.  Over Christmas, my son had my old BB and I bought a new one - exactly the same - the Curve 8520. Both operate on orange networks.  My old BB was v4 new BB is v5.  I have

  • Problem with dnsextd when creating Wide-Area-Bonjour

    Hello, I've been struggling for some time trying to create a WAB test environment but without success and would appreciate some help. Im using a mac mini (later 2014) running Yosemite to run bind (9.10) and ISC for a testing zone with DDNS enabled. T

  • SC - Item transfer in process error

    Hello Guys Can anyone tell  me what is this below error  u2018Item transfer in processu2019 000000001 I1111 Item in Transfer Process (Active). What are the causes for this error and how to fix this. Thank you.