Loading external and internal property files - spring-boot

I am trying to load both external and internal property files for my app but I am having an issue with it. I have two property files, one is inside /src/main/resources, let's call it p1.properties. The second file is located at my c:\poc\p2.properties. So when I declared spring.config.location = file:c://poc/p2.properties. It will only load the external one. then I try to add the classpath:myapp/src/main/resources but still it only loads the external file only. And throws an exception saying not able to find p1.properties. I don't want to use PropertyPlaceholderConfigurer to hard code my external file path. Any ideas? Thanks!

If you are still facing the issue you can specify the internal property to be loaded like below from the command line argument.
-Dspring.config.location=file:c://poc/p2.properties,classpath:p1.properties
Hope this helps!

Related

SwiftAutomation custom record compiler error

I'm using the SwiftAutomation framework to drive a scriptable app that searches for lyrics and returns a AS record. Everything was working correctly, until...
I mapped the AppleScript record to a custom Swift structure according to the SwiftAutomation documentation. The code in the xxxGlue.swift file looks correct, but the compiler complains about SwiftAutomation.SelfUnpacking, with several follow-on errors, when building the MacOSGlues framework.
public struct LFBLyricsInfoRecord: SwiftAutomation.SelfPacking, SwiftAutomation.SelfUnpacking { ... }
--> .../MacOSGlues/LyricsFBAGlue.swift:700:81: No type named 'SelfUnpacking' in module 'SwiftAutomation'
The SelfPacking public protocol is defined in SwiftAutomation, and SelfUnpacking protocol is defined right under it, but without the public keyword. Is that the cause of the compiler error, and if so, how do I fix it?
OK, I finally found a resolution. Seems you have to use different options for the aeglue utility when generating the glue file for the MacOSGlues framework and for the swift file where you actually use your automation, such as in the test project. In my case, where my scriptable app is named LyricsFBA.app, these were:
aeglue -S LyricsFBA.app
for MacOSGlues (generates a LyricsFBAGlue.swift that references SwiftAutomation, but does not include the custom record structure definition), and
aeglue -D -s 'LyricsInfo:lyricsInfo=score:Int+title:String+artist:String+composer:String+link:String+lyrics:String' LyricsFBA.app
for the test program (generatea a LyricsFBAGlue.swift that does not reference SwiftAutomation, but does include the custom record structure definition).

Tried disabling an extension, now I get a Fatal Error

I tried to disable a magento extension by setting it as "False" in /public_html/app/etc/modules/{extension folder} but now I am receiving an error
"Fatal error: Class 'Mage_Enquireproducts_Helper_Data' not found in /home/devbseatedglobal/public_html/app/Mage.php on line 546"
Why is this happening?
The extension probably has an XML file that has an attribute that looks something like this.
module="enquireproducts"
This XML instruction tells Magento to load the module's data helper to translate a string.
When Magento loads all those XML files, it places them into a cache so it only needs to load them once. Although you've disabled the extension, my guess is there's still a cached XML file somewhere. Try manually clearing your cache. (If you're running stock, cache files are stored in /var/cache/* -- you can clear them by deleting them)
It's also possible a different extension has XML configured that includes the attribute
module="enquireproducts"
If that's the case, these modules are dependent on that first module, and disabling that first module will basically break things unless you disable the dependent modules.
Hope that helps!

How to load PHPMailer on cakePHP 3 [duplicate]

I'm currently building a new CakePHP app with version 3.0.0-RC1, and trying to install and use the jasig/phpCAS plugin. Using this guide, I've run the following command from the command prompt: composer require jasig/phpcas
This correctly copies the jasig/phpcas files into the vendor directory of my app, but one of the other files that the guide says should be updated (vendor/cakephp-plugins.php) doesn't even exist.
I've had a tough time accessing the plugin. I want to be able to call its static methods, and I keep getting errors of the form: Error: Class 'App\Controller\phpCAS' not found. (The exact directory in the error changes depending on where I'm calling the method from.)
I don't know if this is due to not having the cakephp-plugins.php file, or if I'm not calling the plugin correctly. It's my understanding that if the plugin is loaded I should just be able to call static methods on it like this: phpCAS::methodName()
First of all jasig/phpcas is not a CakePHP plugin. And the vendor/cakephp-plugins.php file is created by the CakePHP plugin installer, so if you don't see such a file, you seem to have either not installed any plugins yet, or you are not using a recent version of the installer, as the creation of this file has been introduced just recently.
Regarding the error about the class not being found, you are missing the leading namespace separator (\phpCAS::methodName()) to access the class in the global namespace, respectively you are missing a proper import (use phpCAS;) that would make the class available in the current namespace.
In case you are not familiar with namespaces, you may want to start with: http://php.net/namespaces

using an image embedded in a directory of a dll

I have a .NET 4.0 class library with a directory called Resources, with an image called Logo.bmp inside it set to be compiled as an embedded resource.
In my main application I add the dll reference and set a Uri to pack://application:,,,/ResourceImages;component/Resources/logo.bmp and then I try to get the resource stream to that resource (using Application.GetResourceStream(myUri)) but it can't find the resource specified.
If however I put the image in the root directory of my dll and take out the Resources/ it can find and return the resource stream without issue.
Any suggestions?
to anyone else who might be having this particular issue, make sure that you build the string to pass into the new uri BEFORE you make the new call, not during. I changed it so that the pack: location string is all created ahead of time and now it works

VS2010, MSDeploy and declaration of parameters

I'm trying to deploy an ASP.NET MVC 2 app using MsDeploy. I use VS2010 to generate the package as a ZIP. Inside that ZIP is a parameters.xml file that declares the parameters that I can set.
I want to be able to set more parameters, using the auto-generated deploy.cmd file like this:
MySite.deploy.cmd
"-setParam:name='IIS Web Application Name',value=MySite"
"-setParam:name=IisVirtualDirectoryPhysicalPath,value=C:\inetpub\MySite"
"-setParam:name=httpBinding,value=*:80:www.mysite.dk"
That works fine, except for the httpBinding param. That is because that parameter is not declared inside the parameters.xml file that is added to the ZIP container.
I could go and add that parameter declaration manually, but isn't there a way to do it from the command line and have it declare parameters I have in another XML file?
Are you saying that the value param was not declared when the package was created? If so then I think you would have to add it. Either manually or you can use the -setParam switch and sync the package from and to itself. If you use -setParam with a name which was never declared as a param to begin with I'm pretty sure that value is just ignored.
I'm only just looking at this, but is the section on MSDN about the matching of declareParam with setParam the way to go ?
I'm using MsDeploy to update my deployment zip following the idea in this stackoverflow post
Apologies if I'm completely off on this

Resources