• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problems to save serialization Objects with Tomcat using XMLDecoder

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all together,

i want to save some Objects with JavaServlets using the XMLDecoder. But that does not work.

I have this Global function:


an this is the Serialtest Class


and i call the function this way


but all i got is an empty XML file looks like this:


what is my mistake?
he create an object serialtest but there must be some information - an the getter/setter are all set

thanks for your help!


 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch

matze ihnsein wrote: But that does not work.


TellTheDetails
 
matze ihnsein
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok... theres no exception. and the only data whitch is saved is the xml file i post.
to make the serialization work java need to know more --> exept this.


i try on linux and windows with java 1.5 and 1.6 on an tomcat 6 with

C:\Program Files\Java\jdk1.6.0_21\bin>javac.exe -classpath c:\classes\servlet-ap
i.jar;c:\classes\jsp-api.jar;c:\classes\el-api.jar "c:\classes\*.java"

but in my testcase there i not even "extends HttpServlet"

--- in the end i want to save data whitch is saved in Hashmaps (user-data username password etc) i have a class login with a static hashmap...

i hope you no what i mean because my english is not very well...
 
matze ihnsein
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i found my problem.

i had to save the static hashmap by its own.


in login



this works !
 
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic