Where does Spring's <import resource=""> get its configuration from? Sees some app-contexts but not others? - spring

Working on a large project I just got assigned to and I am new to J2EE/Spring/Maven and the project consists of ~20 modules.
I cant seem to figure out why in a Module A, works, but can not find the resource, even if [Module B].xml has the same code as common.xml. Where are some possible locations/configurations/code I can look to figure out where the resource context is coming from?

I'm not completely sure of what you are asking but first read Spring documentation about importing resources. There it says:
All location paths are considered relative to the definition file doing the importing.

Related

Embedded keycloak application throws FreeMarkerException while files for customized themes are existing

The goal is to customize the login of an embedded keycloak application. It worked seamlessly for the standalone version, but the embedded version makes some small troubles
Setup
<keycloak.version>17.0.1</keycloak.version>
<spring.version>2.6.7</spring.version>
I followed the tutorials on https://www.baeldung.com/spring-keycloak-custom-themes and https://www.keycloak.org/docs/latest/server_development/. The files are under "themes/<myTheme>/..." and the reference to this path is set accordingly e.g. over System.property(...,...) . However, when the application runs and the theme is invoked a FreeMarkerException is thrown with the hint that it's not existing.
The exception is thrown by FreeMarkerUtil.
The mainpoint is, that the reference was not taken by embedded keycloak. I don't know exactly why. Researching the path by the DefaultThemeManager indicates that it's searching for the path theme/<myTheme>/... As you might (not) noticed, the "s" is missing. So it can't find the file.
In case you get a similar error, you can check the file reference.

Location of drools-spring.xsd on git hub (or reliable source)

My project depends on drools 5.6.0.Final version. As part of that I'm trying to find a uri that I can rely for the drools-spring.xsd file. I'm trying to locate a reliable URI for that file I can reference, so that eclipses doesn't show issues, and so that spring can also intercept the requests and replace with the files in the jar as it sees fit.
I can drill into drools-spring-5.6.0.Final.jar in eclipse and see the xsd files in org.drools.container.spring. I also can see the xsd file here: http://grepcode.com/file_/repository.jboss.org/nexus/content/repositories/releases/org.drools/drools-spring/5.6.0.Final/org/drools/container/spring/drools-spring.xsd/?v=source
Going to drools.org and following their link to github and follow the rename of their group shown in the README file to https://github.com/kiegroup. I've searched this group for the xsd file(s) but have had no luck. e.g. https://github.com/kiegroup/droolsjbpm-integration/find/5.6.0.Final and https://github.com/kiegroup/drools/find/5.6.0.Final
This makes me think that the xsd files
are generated? Can someone confirm this and if so, is there a reliable URI that I can reference for this?
For some reason, the Drools' team doesn't maintain a hosted version of this schema.
Here you have an old post from Mark Proctor explaining it.
As far as I understand, they policy is still the same: do not host any .xsd file.
Hope it helps,
The drools-spring.xsd file location on drools website will give you a 404 error. You can have below two approaches which i could find while searching on the net.
One : Host the file on your local machine
Two : Place the .xsd file in the same directory as the location of the xml file referencing it.
Please refer to the below information . This will give a better understanding of the two methods mentioned above.

MEAN stack add new module

I created new module with name "mean.recipes". But it's javascript files are not loaded.
I am missing injection of dependency to load those modules but not able to find the place.
I went through javascript files but could not find the exact file.
can someone point me to right file ?
Starting with the documentation helps.. If it's MEAN.io you can find more information here: http://learn.mean.io/#mean-stack-packages-dependency-injection

ZF2 data table - configuring ZFTable

I am looking at zfmodules to get a datatable module, and have found the perfect one :
https://github.com/dudapiotr/ZfTable
..however there is very little explanation of how to configure it into an existing project, change the data source etc.
Does anyone have any experience of this module, or is successfully using it in production?
The thing that i understood from Question is " You want to inject this
Module in your current Application ", well i have checked the link [https://github.com/dudapiotr/ZfTable][1] and the module seems perfect to inject to your Application. *The only thing which seems unfitting is the 'data' folder, you should compile
'customer.sql' onto your database, and then remove the folder 'data', since it does not matches to the framework structure
**Try these steps **
*
create your sql database exactly as mentioned in customer.sql
copy this module to your application, with other residing modules (if any).
Add the module name to application.config.php in Application/config/autoload directory ( since you are adding module manually, you must add your module name there by yourself)
And last, Routing configuration of your module in Application/config/module.config.php
if you need any help in routing of step 4, go here [Zend framework not able to route the translated child routes
*

Core Data Migration error message "'Model does not contain configuration 'XYZ'.'"

I have a Managed Object Context to which I add two different SQLite stores. I use Configurations in the Mananged Object Model to assign certain entities to one store and other entities to the other. The Configurations are called "UserDB" and "MainDB".
Everything works okay until I try to use automatic migration. After creating a new Managed Object Model version, and adding a new attribute to one of the entities in the UserDB Configuration, I get an exception when adding the old version store (for the UserDB related store) to the store coordinator: 'Model does not contain configuration 'UserDB'.' I can find no hits for this error on Google. Anyone out there using multiple stores with Configurations? Anyone have an idea what I might be doing wrong?
The stack looks like this:
objc_exception_throw
-[NSManagedObjectModel isConfiguration:compatibleWithStoreMetadata:]
-[NSStoreMigrationPolicy sourceModelForStoreAtURL:metadata:error:]
-[NSStoreMigrationPolicy(InternalMethods) _gatherDataAndPerformMigration:]
-[NSPersistentStoreCoordinator addPersistentStoreWithType:configuration:URL:options:error:]
-[MyAppDelegate persistentStoreCoordinator]
This looks like a bug with migration+configurations. I was able to work around the problem by going through the same motions and passing nil for configuration when calling addPersistentStoreWithType. The migration happens, and then I can make a new persistent store coordinator and add the stores again with the proper Configuration string arguments.
This is the second configuration related bug I've run into. Not a well tested feature apparently.
I had the same problem. The fact pattern was identical and the error message the same. It turned out, however, to be the result of my own mistake.
Let's say the old model was Blah.xcdatamodel and the new Blah 2.xcdatamodel. I had started making changes to Blah before realising my mistake and creating Blah 2. I then used my version control system (Git) to revert to the old Blah and then recreated Blah 2. Everything looked right. But I must have done something wrong in the reversion process, because when I thought to double check that Blah.xcdatamodel in my current project folder was really the same as Blah.xcdatamodel in the project folder I used to build the previous version of the app (fortunately I always keep a zipped archive of the project folder for each released version as I don't fully trust version control systems), I found that they were in fact different, albeit that they looked identical in XCode. The file size was different, for instance.
I substituted the old Blah into my current project folder, and lo and behold it all went perfectly, without any need for the workaround described by Ken.
I am not saying that Ken had necessarily made a similar mistake, but if you do encounter this message it is at least worth confirming that the model you are migrating from is REALLY the model that was used to create the data in question.

Resources