log.entering / log.exiting prints org.apache.struts.util.PropertyMessageResources loadLocale - struts

When I try to log method entering and exiting using log.entering(CLASS_NAME, METHOD_NAME); or log.exiting(CLASS_NAME, METHOD_NAME); I see console message as
PropertyMessa W org.apache.struts.util.PropertyMessageResources loadLocale Resource ../resources/ApplicationResources_en.properties Not Found.
While all other logging works perfectly. Please advice how to remove this message from console.

To remove this message from the console, in
struts-config.xml
add the code snippet as <message-resources parameter="...resources.ApplicationResources_en_US" /> with in <struts-config></struts-config>
And place the file
ApplicationResources_en_US in class path..
this message vanishes.

Related

Invalid content error on compression:extract

I am attempting to use the zip-extract method in a foreach loop to unzip several files. When I attempt to deploy the project the following error is returned:
Invalid content was found starting with element 'compression:extract'. One of >'{"http://www.mulesoft.org/schema/mule/core":annotations, >"http://www.mulesoft.org/schema/mule/core":abstract-message-processor, >"http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor}' is expected.
The actual code is:
<compression:extract doc:name="Extract" doc:id="9119d722-95eb-4aee-a734-50e2a2825449" >
<set-payload value="#[payload]" />
<compression:extractor >
<compression:zip-extractor />
</compression:extractor>
</compression:extract>
I have not been able to find anything online that would point towards a solution.
It look like accidentally a <set-payload> was put inside the <compression:extract> element. Also it doesn't make sense at all because it puts the payload as the payload, which it is already is. Just remove that line.
Maybe the intention was to use <compression-compressed>?
Example:
<compression:extract>
<compression:compressed>#[payload]</compression:compressed>
<compression:extractor>
<compression:zip-extractor/>
</compression:extractor>
</compression:extract>
payload is already the default, so it is not needed.

Selenium - FileNotFound in OpenFileDialog

After clicking a button on a page, a file dialog opens up.
I wrote the following code to send keys:
Driver.SwitchTo().ActiveElement().SendKeys(
"\"Q:\\OneDrive\\Documents\\Production\\01-Intro.mp4\""
);
The file is there and the path is correct but I catch:
System.InvalidOperationException: 'invalid argument: File not found : "Q:\OneDrive\Documents\Production\01-Intro.mp4\"
Any clues on how to fix that?
You can directly send the file location to the input element which handles the upload.
driver.findElement(path to input).sendKeys(location of the file);
In your case try with one double quote:
Driver.SwitchTo().ActiveElement().SendKeys("Q:\\OneDrive\\Documents\\Production\\01-Intro.mp4");

Cache files always created with wrong permissions in Yii 2

I get this error in my log files every time a cache file doesn't exist it seems. On the first page load, I always get this error
[message] => filemtime(): stat failed for [...]/runtime/cache/my/myapp03eab921185f7b68bbca50d8debc0dda.bin
[file] => [...]/vendor/yiisoft/yii2/caching/FileCache.php
[line] => 113
It doesn't happen anymore on next page loads but that one time is really annoying since the slack bot watcher is spamming our channel with this useless warning. Is there a way to avoid that, or is it a permission problem?
The "runtime", "cache" and "my" folders all have 775.
Update
Turns out the issue is that I'm using error_get_last() that is also getting warning-level errors. So it's a different issue entirely, not Yii-related
Make sure that you don't have enabled scream in your php.ini. Warnings from this filemtime() call should be suppressed by # operator, but scream setting can override this operator and generate warning anyway.
if (#filemtime($cacheFile) > time()) {
// ...
}
You must be getting this in PHP 7.1. try to run this with PHP 5.5 and see if you are getting the same error.
To reproduce you need to delete all files from runtime/cache directory
Then start app again(reload page) and look into runtime/cache. It is empty
Yii2 doesn't make cache again
Got same issue in Yii. The error was on the same string (FileCache.php:113)
if (#filemtime($cacheFile) > time()) {...
In my case reason was that my custom php error handler (heir
of the class yii\base\ErrorHandler) didn't check if
error type need to be handled according error_reporting().
Custom handlers allways gets every error, even muted by Error Control operator (#)
https://www.php.net/manual/en/function.set-error-handler.php
error_reporting() settings will have no effect and your error handler will be called regardless

logging program info to file in twisted

I have written a code in twisted .I need to write the log information in when we have call
d.addErrback(on_failure).
from twisted.python import log
log.startLogging(open('/home/crytek.etl/foo.log', 'w'))
def on_failure(failure):
log.msg(failure)
d.addErrback(on_failure)
Is this the correct way of implementing this.I don't get any values written to the file.Can someone suggest on how this can be implemented
You probably want to consider opening your log file in append mode. Otherwise, every time your application starts you'll wipe out all your old logs. This could make it appear as though the log messages you're expecting to see aren't being logged.
from twisted.python import log
log.startLogging(open('/home/crytek.etl/foo.log', 'a'))
You should also log failures using log.err instead of log.msg
def on_failure(failure):
log.err(failure)
And you can do this more easily since on_failure has exactly the same signature as log.err. Just write:
d.addErrback(log.err)
Also, I liked, log.err doesn't have exactly the same signature as on_failure. It is better, it accepts a 2nd argument which is used to present a header for the failure in the log file. You can use it like this:
d.addErrback(log.err, "Frobbing the widget failed")
This will present "Frobbing the widget failed" together with the failure in the log file.

Like Box - Blogger Error

I'm tring to put facebook Like Box to my blog but after I put Javascript SDK (right after opening body it show me error
**
The reference to entity "appId" must end with the ';' delimiter.
**
and I cant fix it ... :(
What I need to do/edit ???
I had the same problem: fbml=1 appId where I just deleted & and put the closing script right after Load the SDK line. I checked it with the debugger and now there are no errors.
I'm not asking for other permissions, just the "like my page."
{edit. had to change to closing script as the brackets and script didn't show.
Yes, Change the &appId to &appId ant it will work.