XPages - Can't instantiate class: 'Cannot find class <<classname>> in NSF' - xpages

I have an XPages application that has been running quite happily for the last couple of years.
The application uses some Java classes as converters that are used to convert data entry on certain fields to upper case, proper case, etc. This functionality has been present and working since the app was first deployed.
Today I was asked to make a change to one of the pages, adding a new field. The change was made in a test copy of the database, the app rebuilt and tested and all was fine.
The same change was then promoted into the live database, but after being rebuilt the error
Can't instantiate class: 'Cannot find class uk.co.xxx.beans.UpperCase in NSF'.
is being returned.
I have tried rebuilding the app and cleaning the project numerous times without success. I have also tried amending the code in the Java class and rebuilding.
If I remove all references to the UpperCase class it then complains about the ProperCase class. It appears as if the app has lost its reference to the Java classes and rebuilding isn't fixing the problem.
As an interim solution I have removed all uses of these classes so that users can at least display the page - but this is obviously not a long term solution. As soon as I reinstate one instance and rebuild, the error returns.
The only change in the app has been the addition of the new field. Removing it makes no difference.
Can you suggest anything else I can try and what may be causing the problem?

Open production db in designer and using Navigator view open WebContent/WEB-INF and delete classes folder. Then rebuild the app or refresh it from template again.
Sometimes classes are not updated correctly. I've seen it few times.

I have seen this too (domino 8.5.3). I recompile until it eventually works. With a restart of the http task thrown in for good measure. How are you deploying the classes within the db or as jar files in lib/ext?

I ran into similar issues with 8.53 FP2 with the same "can't instantiate errors" if accessed by a designer client. I even put a PRD in at IBM for it.
In order to fix this problem we had to update to the server and clients to FP5. We had a work around before we could update the FP5. We had to modify how the application was rolled out. Once the database was updated from a template we had to do a clean then a build while use our Application ID used for signing applications.
http://www-01.ibm.com/support/docview.wss?uid=swg21639571
JDAE8ZV2CX
XPage With Java Design Element Breaks When Domino Designer opens after applying 8.5.3 Fix Pack 2 interim fix of any 853 Fix Pack 2/Fix Pack 3 hotfix

Related

Unable to remove references to UIWebView from IOS Builds. (Xcode 11.5, Swift 5)

Warning! I am beginner.
Apple testflight is refusing to accept any builds of a previously healthy project, sending out this message;
*
TMS-90809: Deprecated API Usage - New apps that use UIWebView are no
longer accepted. Instead, use WKWebView for improved security and
reliability. Learn more
OK, I understand that the UIWebView is now fully deprecated and no longer allowed.
I have scoured all the files in may app manually using the Xcode editor and find there is no reference to the deprecated string ( UIWebView ) in any file that I can edit.
Using the Xcode "find in project" tool also says it's not there.
If I build & archive, then run grep in CLI to examine the resulting package contents, the report is that the string "UIWebView" IS found in the app and the dSYM file.
Also, again using grep, I have examined the various framework files referenced in the editor, the report is that framework 'UIKIT' contains many references to UIWebView. The check does not reveal any other references to the string.
UIKIT is still shown as required in the build list.
I have cleaned the project, deleted all derived data, closed and opened the project and xcode.
Could any kind soul point me in the right direction here - I am stumped.
Thanks, Max
After learning a lot more, I found it was the PayPal external framework which had deprecated references in it. They no longer maintain it. I had to remove that and I added Braintree instead which is kept updated.
I had failed to check the external frameworks when trying to sanitise the cause. There is no magic bullet here...I just had to plod through all the components.
This was mostly caused by my inexperience and failure to understand the function of the various components of an app.

getting jHipster project working with Atomikos JTA/XA transactions

I've been playing with the jHipster yeoman generator for the past week and I'm trying to get my application working with atomikos for JTA/XA transactions and I'm running into a number of problems, which is to be expected since I'm new to spring boot and a number of the other components in the jHipster stack.
I have been using the example found here as my starting point for configuring atomikos. I've implemented everything described there, replacing HikariCP entirely.
At the moment I have eliminated Metrics and liquibase from my configuration as they were giving me problems and I wanted to get the basics working and then add them back in. However, I'm now hitting a Hibernate issue.
Hibernate is complaining that second-level cache is used but hibernate.cache.region.factory_class is not given. The factory_class setting is specified in the configuration and I'm not able to figure out what I'm missing.
Has anyone managed to get atomikos (or maybe bitronix) working with this stack?
I've managed to get this working. For some reason I had to explicitly set hibernate.cache.use_second_level_cache to false. Not sure why it would require this given that I am not setting any second level cache flags anywhere that I can see.
Never the less. It's working now.

Exclude Certain Database Objects from the Build Depending on Configuration Settings

I have a database project in Visual Studio 2012 with SSDT (latest as of this writing). In the database project, I have a schema called "UNITTEST" which contains tons of stored procedures that create, destroy, and provide other helper functionality for the unit tests. We do this because it gives us the ability to control our test data centrally rather than inside each unit test. Now that's fine and all however, I don't want to publish this schema or any of the objects inside of this schema to production.
So my question.. Is there a way to stop SSDT/VS2012 from including the UNITTEST schema in the production build deployment script?
I'm thinking there should be a way to do it depending on the solution configuration settings and publish profiles. If my configuration is set to "Release" then I want the build to perform a bit differently.
Builds are very new to me. I found this question: build-different-scripts-depending-on-build-configuration but I can't seem to get the answer to fulfill my problem. This question also doesn't help although it's very similar: bind-the-deploy-and-publish-destination.
Is anyone else managing something like this? The other developers in my team are just modifying the published script to remove these objects but I HATE manual work, there HAS to be a solution! :)
Thanks all!
One of my schemas references a lot of sys.* objects which created a lot of errors in the build. I created another project in the solution and moved that schema to the new project.
Luckily you can build and publish at the project level.
This allows me to keep the other schema in change control at least.
(It may also help to set the Properties on the SQL files to Build Action: None)
Partial/Composite projects might be useful here. Main project contains all of your necessary DB objects for your apps to run. The partial project references the main project, but then contains all of the "Test" code.
Here are a couple of options from Jamie Thomson:
http://sqlblog.com/blogs/jamie_thomson/archive/2013/03/10/deployment-of-client-specific-database-code-using-ssdt.aspx --This may be the simplest way to handle this
http://sqlblog.com/blogs/jamie_thomson/archive/2012/01/01/implementing-sql-server-solutions-using-visual-studio-2010-database-projects-a-compendium-of-project-experiences.aspx --Lots of good information in this post and most of it also applies to SSDT SQL Projects.
http://msdn.microsoft.com/en-us/library/dd193415.aspx - Composite projects for larger DBs. This could potentially work for you as well.

model backing the context has changed since the database was created. Consider using Code First Migrations to update the database

I am using MVC5 and EF6 CodeFirst migrations. My model is in a separate project from my MVC web app and I keep getting this error when trying to access the model classes. I have automatic migrations already enabled. I can drop the entire database and then using update-database to regenerate everything I still get this error. The error is wrong because the context has not changed since I created the database. Also, through a Unit Test project, using the same calling code as I have in my MVC app, I can reference the same Model project, access the model classes and data. I have the Model separate from the MVC project because I need to be able to reuse the Model outside of the web.
The model backing the "xx" context has changed since the database was created. Consider using Code First Migrations to update the database
Database.SetInitializer<DbContext>(null);
http://patrickdesjardins.com/blog/the-model-backing-the-context-has-changed-since-the-database-was-created-ef4-3
I got a similar problem :
The model backing the 'ApplicationDbContext' context has changed since
the database was created. Consider using Code First Migrations to
update the database
I have one project for MVC and another project for the model, context and repositories. I've been working on it for weeks but today it said stop.
I have tried to delete database, enable-migration, add-migration and update-database so many times that I've lost count. I've added initializers to MigrateDatabaseToLatestVersion as well as DropCreateDatabaseIfModelChanges.
What finally made it work was to move model, context and repositories into the MVC project (not something I was keen on)...then it worked right out of the box without any code changes at all (besides namespaces)! Very strange...
I've read so many blog posts during the day trying to solve this problem. One of them (I don't know which one) mentioned a bug in Visual Studio 2013 where reference to DLL files weren't always updated as they should, suggesting that my MVC project missed out something when I was running add-migration and update-database in my separate project. But it's just a guess.
I'm using EF 6.1 and .Net 4.5.1 in my solution.
Just to elaborate on RouR's answer:
I had an MVC web project that had a model attached.
I then created a console app that consumes this model.
My console app, only is aware of the connection string and has EF reference, just doesn't know how to let each one communicate.
Hence, the model backing database changed error appears
The engine is just confused how to proceed it sees and expects an entity, as was reference, just losses it when it fails to find the proper context, and assumes context wan't migrated properly.
So here we are,
Database.SetInitializer<MyProject.Models.MyModel>(null);
We are having the same issue. What solved it for me was not necessarily to move the Model, Context into the MVC project, but move my seperate project to the same solution as the MVC project and reference it by project folder.
This worked, but referencing a DLL instead of a project did not work.
Funnily enough, when creating a new Console Application and referencing the DLL assembly, we did not get this issue... only from an MVC project
We use EF code migrations to keep databases schemas up to date. The other day I had the same problem, in my case I was working with 2 database instances (QA and DEV databases of the same client with exact same data however QA environment was throwing this error. I've fixed the problem by deleting the _MigrationHistory folder and problem solved.

Core Data warning: "Version hash information not available for all models"

I get this warning for my xdatamodeld file: "Version hash information not available for all models". How do I get rid of this? I've also started to get a crash at startup when I install the app as new ... wonder if they're related? This is the crash:
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Cannot create an NSPersistentStoreCoordinator with a nil model'
This is a iOS5 beta issue, caused by having a fetch request in your model file. For now, removing the fetch request fixes it.
I am experiencing the same thing once I have installed Xcode 4.2 with iOS 5 beta 5, maybe it's something there?
I did not have is last night while working on my production system, with Xcode 4.1. Unfortunately I am reinstalling it now, and it'd take a while before i know whether that's the cause.
The first error indicates that you have multiple .xcdatamodel files with the same name but different versions. One of more of the multiples lacks an internal version number i.e. the version hash.
The second error is caused by the first because the managed object model cannot create itself by merging model files of the same name but different and unknown versions. A persistent store coordinator in turn cannot intialize without a valid managed object model.
If this is occurring in development and you don't have multiple versions intentionally, then you probably have an old compiled .mom or .momd file on the simulator from a previous build. Delete the app off the simulator entirely, then clean the entire project in Xcode and rebuild and reinstall. That usually resolves the problem.
I ran into this problem on iOS 5 SDK and it wasn't any of the above problems. My problem was because I had a lot of attributes in a single entity, that I inadvertently had a duplicate (i.e. two lastUpdatedDate attributes in the same entity).

Resources