Reply
Tuned Listener
Degree61
Posts: 26
Registered: ‎06-28-2010

Error Message

I just started getting this error message when I tried building my project:

 

ERROR - C:\Users\ejeffries\AppData\Roaming\Sage\Platform\Output\templates\Default-Class-SalesLogix.tt(0,0) : error : Error running transform: System.NullReferenceException: Object reference not set to an instance of an object.
   at Sage.Platform.Orm.Entities.OrmCodeSnippetProperty.get_CodeSnippet()
   at Microsoft.VisualStudio.TextTemplating.GeneratedTextTransformation64534205.TransformText()
   at Mono.TextTemplating.TemplatingEngine.Run(Assembly assem, String type, ITextTemplatingEngineHost host, CultureInfo culture)
   at Mono.TextTemplating.CompiledTemplate.Process()

 

 

I get a ton of these and have absolutly no clue what they mean or how to go about fixing them. It happens right after it attempts to Generate a Server Entity for each of the components of the project such as attachements, contacts and accounts.

 

Any help would be greatly appreciated!

 

Thanks,

 

Matthew

Please use plain text.
Nickel Contributor
JasonHuber
Posts: 92
Registered: ‎03-30-2009

Re: Error Message

I do not have a specific instance where I have seen this error, but have you tried to delete the contents of the output folder and perform a rebuild?

 

Did you do anything just before this starting? Which version are you on?

Please use plain text.
Tuned Listener
Degree61
Posts: 26
Registered: ‎06-28-2010

Re: Error Message

I tried to delete the output folder to no avail. I am on version 7.5.2.2151.

 

There was nothing changed that I was aware of.

 

I actually gave up and reverted back to an old copy. Though this is an odd issue it seems to be a bug of sorts.

Please use plain text.
Nickel Contributor
richardanderson
Posts: 59
Registered: ‎07-30-2010

Re: Error Message

[ Edited ]

I too had this issue, I managed to get around it by a full rebuild, i've only had this issue once, and never again since that full build. I'm not sure why a full build fixed it.

Richard Anderson
CRM Consultant
K3 CRM
Please use plain text.
Nickel Contributor
JasonHuber
Posts: 92
Registered: ‎03-30-2009

Re: Error Message

Good point. A build->rebuild might do the trick.

 

In class this week I have seen something similar and simply opening the snippet (business rule, event, whatever) in question resolved the issue. Just open the item that is failing (using the menu on the left -- not a double click on the error) and then a rebuild may let you progress.

 

I know it is strange, but something seemed to get corrupted and this resolved it.

 

We might have to add this to the boot camp presentation on debugging SalesLogix -- http://www.sagesaleslogixbootcamp.com/

Please use plain text.
Bronze Super Contributor
mlaspina
Posts: 236
Registered: ‎03-30-2009

Re: Error Message

Try a “Nuke and Pave” with the re-generate ModelIndex file option:

1.       From Application Architect, choose ‘Tools -> Build Settings’ from the menu and note the Build and Assemblies paths

2.       Close Application Architect

3.       Issue an IISRESET

4.       Delete all files and subdirectories from the following folders:

a.       The Build path from Step 1 above

b.      The Assemblies path from step 1 above

c.       C:\Documents and Settings\All Users\Application Data\Sage\Platform\WebPortal\Design\SlxClient

d.      Your deployed website (Usually C:\Inetpub\wwwroot\SlxClient)

e.      C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\slxclient

5.       Determine if you project is stored in the database VFS or on the Local Disk (LFS):

a.       Open the Project Explorer window in AA (left dockable window)

b.      Open the Project Workspaces window in AA (bottom dockable window)

c.       Look at the name of the current project in the Project Explorer window and find that name for the corresponding project in your Project Workspaces folder

                                                               i.      If the working path is “VFS:\Model”, then you are working in the database VFS.

                                                             ii.      Otherwise, you are working in an LFS (path will read something like “C:\MyProject\Model”) – note this directory as you will need it in the step below

6.       Delete the ‘ModelIndex.xml’ file.

a.       If you’re working in a VFS:

                                                               i.      Start Application Architect

                                                             ii.      Open Virtual File System Explorer (left dockable window)

                                                            iii.      Expand the root entry

                                                           iv.      Expand the ‘Model’ folder

                                                             v.      Delete the item ‘ModelIndex.xml’

                                                           vi.      Exit out of AA

                                                          vii.      Re-start AA

b.      If you’re working in a LFS:

                                                               i.      Exit out of AA

                                                             ii.      Navigate to the directory from step 5c

                                                            iii.      Open the ‘Model’ subdirectory if you have not already

                                                           iv.      Delete the file ‘ModelIndex.xml’

                                                             v.      Re-start AA

7.       Do a build and deploy.

8.       Note that these steps will force a full rebuild of your project and cause the ModelIndex.xml file to be re-generated.

Mike LaSpina
Professional Services Consultant

Sage
8800 N Gainey Center Dr Ste 200
Scottsdale AZ 85258
Tel: 480-383-5344
Cell: 480-321-6637
Fax: 480-556-4090
mike.laspina@sage.com

Your Business in Mind.
Please use plain text.
Nickel Contributor
jcouzens
Posts: 51
Registered: ‎07-31-2008

Re: Error Message

I thought I would add to this post in hopes that it would save someone else some grief.

 

I had this same issue and spent many sleepless nights working it out.  All of the above tricks didn't help.

 

What I finaly found, is that all of my C# Code Snippet Properties on my entity got corrupted.  If I tried to open the property in the editor window, it threw an error.

 

I dropped and readded my code snippet properties, and everything was right in the world again.

Please use plain text.
Employee
jboyce
Posts: 63
Registered: ‎08-06-2009

Re: Error Message

I can think of two possible reasons why you might get a null reference exception on a code snippet property.  A code snippet property is composed of a *.method.xml file, a *.codesnippet.cs file (or *codesnippet.vb file), and a reference to the method file in the *.entity.xml file.  If the snippet file or the method file are missing, you could get a null ref.  There's no good way to fix this except remove the remnants (copy out the snippet content if it still exists) and start over.

 

The other possibility is that the in-memory snippet object didn't get initialized correctly and the references between the entity and the snippet objects couldn't be resolved, resulting in a null ref exception.  I don't really know why this would happen, except I fixed a few similar types of issues in some related areas.  Maybe the snippet was left open in a previous AA session and in the following session it was opened automatically, but not correctly initialized.  Resolution may just involve touching the snippet in a different way - a full build, opening the entity and then the snippet, etc.

 

It sounds like both resolutions have been used successfully, so this may actually be two different defects and not one.  In either case we'd like to fix the underlying issue.  If you can provide steps to reproduce the issue, PLEASE share so we can get this resolved.

 

Jason Boyce

Please use plain text.
Nickel Contributor
jcouzens
Posts: 51
Registered: ‎07-31-2008

Re: Error Message

The issue is very easy for me to replicate, but it only occures with certain Entities.  they happen to be a large entities with just over 100 properties, 10 code snippet properties, and a dozen business ruels and events.

 

I've determined that if I attempt to modify the entity by adding a new field or modifying an existing one, the issue occures.  It seems the best way to trigger the issue (every time), is to change the size of a property on the Entities "Propertyies" collection.  On saving the changes, the Entity appears to rebuild.  It appears that the size of the entity causes an issue with resources, and I get an "Out of Memory Exception" almost every time.  My guess is that it is unable to complete the build, and the code snippet properties are the victim.  Deleting the CS properties and readding them is the only means for resolving the issue that I've been able to find.

 

The Out of Memory Exeptions, seem to be the source of most of my issues.  I can replicate these in our dev environment, as well as at at a clients site.  One has Windows 2003, the other has Windows 2008 R2.

 

I have gone as far as completely logging out of AA, and then loging back in, just to do the Entity change.  This will be successful about half of the time.  I get the same memory exception error when working with a large smart part (100 or so controls), and attempt to move them arround.  There seems to be certain opperations that cause a complete rebuild of the underlying XML that don't have much success with large operations.  To put it another way, there seems to be limit on the size of an entity or smart part that effects stabiltiy.

 

I'm more than happy to demonstrate the issue if you would like.

 

Please let me know if there's any additional detail you would like.

 

Jeremy Couzens

Please use plain text.
Employee
jboyce
Posts: 63
Registered: ‎08-06-2009

Re: Error Message

Thanks for the info!

It sounds like you really have more of a memory usage issue rather than specifically a code snippet issue.

That's just as serious, if not more so, so let's try to figure out what is going on.

 

Saving an entity shouldn't trigger a build.  

Are you sure a build was being performed or did you just notice a lot of disk I/O?

Did you see build messages in the output window? 

 

Were you saving a single file or multiple items?

Your large entity sounds pretty close to the out of the box Account entity.  Do you think a few more properties would push Account over the edge to manifest the problem?

Are you working with a limited amount of memory on the AA machine?

 

It might be very helpful if you could provide a video (maybe using something like  Camtasia) starting from a just logged in AA though your usage to the out of memory exception.

 

 

Please use plain text.