-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: webservice problem - cannot serialize
PostPosted: Tue Jun 21, 2005 4:44 pm 
Hi,

When deploying a webservice using NHibernate, I am getting the dreaded "File or assembly name ts8kx2oy.dll, or one of its dependencies, was not found." Researching it, I found that there is a tool called XmlSerializerPreCompiler (available at http://www.sellsbrothers.com/tools/#Xml ... reCompiler ) that can tell me what's going on. Examining my webservice class with this tool, I get the error:

Code:
cannot serialize member System.ComponentModel.MarshalByValueComponent.Site of type System.ComponentModel.ISite because it is an interface


This seems to be generally quite a well-known problem with the .NET XmlSerializer, it has trouble with jagged arrays and a few other troubles. One of the suggestions for fixing it is to put a [System.Xml.Serialization.XmlIgnoreAttribute] on whatever is causing the trouble - but I have not yet been able to figure this out. Has anyone perhaps run across something like this using NHibernate before?

I'll try to cobble together a stack trace etc., I am not quite sure where to start looking though.


Top
  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 4:56 pm 
I can't seem to generate a stack trace for this, it fails with only the message "File or assembly name ts8kx2oy.dll, or one of its dependencies, was not found" when invoked, and the debugger can't seem to catch it, so all I've got to go on is what the XmlPrecompiler tells me. This thing doesn't allow you to select the error text (there is quite a lot of it) so it is tough to paste it in here (I'll mess with the command-line version tomorrow and see if I can get the error messages into the forum.

Thanks for any help,

Srimedia


Top
  
 
 Post subject:
PostPosted: Tue Jul 26, 2005 4:05 am 
Newbie

Joined: Thu Jun 02, 2005 6:00 am
Posts: 12
Location: Ostrava, Czech Republic
Yes, adding the [XmlIgnore] will help with the interface. Mapping an ISet is also tricky. I used a workaround with ArrayList property which is mapped to ISet, but it produces ugly code so I removed ISets wherever possible and replaced them with IList. Mapping IList is alot easier:
Code:
[XmlArray ("Servisy"),
XmlArrayItem("Servis", typeof(Servis))]
public IList Servisy
{
   get { return servisy; }
   set { servisy = value; }
}



the whole class has also to be [Serializable] and all members whic are interfaces have to be [NonSerialized] and [XmlIgnore] in the case you want to use nHibernateQueryAnalyzer;-)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 07, 2005 2:13 pm 
Newbie

Joined: Sun Aug 07, 2005 8:23 am
Posts: 3
I've run into these troubles with webservices and fixed it by ensuring that the TEMP directory for my user on this Windows machine is writable by all users (Everyone). This may not be so hot from a security standpoint, now that I know this is the problem I'll set it to the .NET account and remove Everyone.

Because .NET attempts to compile some of the files necessary for web services in the user's TEMP directory, if this directory is not writable by the compilation process then the whole thing fails, giving the cryptic "File or assembly name foo.dll, or one of its dependencies, was not found", and totally failing to allow a debug, etc.

I had seen the advice to "ensure your TEMP directory is writable" in some place or other on the net, but I had assumed that this referred to the TEMP directory on the *machine* rather than for my user. To see where the temp directory is for you, do a "Start --> Run --> " and type in "regedit" (no quotes) at the prompt to fire up the Registry Editor. Then navigate to HKEY_CURRENT_USER/Environment settings and it should say where your TEMP directory is located. In my case, this is %USERPROFILE%\Local Settings\Temp (you need to find where your local settings are in order to find your temp folder, e.g. C:\Documents and Settings\yourusername\Local Settings\Temp )

This may seem pretty obvious to some people but it had me stumped for quite a while; now my web services work properly and my whole life has improved. Hopefully this can help somebody else with the same troubles.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 15, 2005 6:17 pm 
Beginner
Beginner

Joined: Wed Jun 01, 2005 3:22 pm
Posts: 38
Location: Menlo Park, CA
No regedit required.

Start->Run-> %TEMP%

or at a command prompt

echo %TEMP%


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.