When navigating to "/elmah.axd" it throws a 'Root Element is missing' error - elmah

Posting this to resolve a question I couldn't find an answer to elsewhere.
I'm running "elmah" for error logging in a legacy .NET framework project. It works fine in all of my testing / production environments. However, navigating to it locally produces an XML error:
Root element is missing
within ProcessRequestMain, which seemed to be internal to elmah. Changing configuration didn't help, and I couldn't find a reference to this elsewhere, where it only didn't work locally.

The solution was to navigate to my logPath directory specified in the errorLog section of the web.config. Poking around the generated XML logfiles, I found that for some reason, one or two of them were actually malformed. This meant I couldn't launch the /elmah.axd page at all, without it throwing that error, presumably generated when it tried to parse them to display the page.
Deleting the offending logfiles resolved the issue.

Related

Dart2JS Pub Build Fails to Traverse Project Folders Correctly

I'm working on a long-term project for some time now. After moving some folders around, correctly refactoring different parts of the code, Webstorm's Dart analyser is showing NO errors, but running either pub serve or pub build fails.
Pub or Dart2JS doesn't seems to be traversing folders correctly.
This is the first error I get:
[Error from Dart2JS on CS_Game_Engine|web/main.dart]:
web/UIElements/NodeSettingsItems/TextVariableEditor.dart:4:1:
Can't read 'file:///Data/ownCloud/cybersecgame/CS%20Game%20Engine/web/UIElements/Data/Variables/Variable.dart' (Could not find asset CS_Game_Engine|web/UIElements/Data/Variables/Variable.dart.).
import '../../Data/Variables/Variable.dart';
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is interesting, because the file TextVariableEditor.dart, as you see in the error, is located in the web/UIElements/NodeSettingsItems/ directory.
The file I am trying to access (Variables.dart) is located in web/Data/Variables/Variable.dart.
The import statement moves 2 folders up with the ../../, but Pub or Dart2JS is not going 2 folders up, its only going 1 folder up. See the error again:
Can't read 'file:///Data/ownCloud/cybersecgame/CS%20Game%20Engine/web/UIElements/Data/Variables/Variable.dart'
It's looking for the file in the wrong place. I'm not sure what to do to fix this, and I've looked around and can't really find anything. Again, Webstorm's Dart Analyzer shows no issues, but the pub build or pub serve both fail, unable to find the file.
I've used the ../../ many times before in my code, but this is the first time it is causing issues. There are other errors similar to this, but having the same issue of not reading the ../../ correctly.
Update 1:
I've done more testing, and adding an additional ../ to the path's beginning fixes the error during the pub build. However, now Webstorm and it's Dart Analyzer is showing lots of errors since the path is obviously wrong (1 too many ../). This is a workaround, but not a fix. Does anybody know why pub or the Dart2JS is reading the path incorrectly? Somehow skipping one of the ../?
Code within the web directory should only access files in two places:
Things in the web directory, via relative paths
Things in packages via package: imports
#2 is interesting. This can include files within your own project, you just need to put those files in the lib directory and access them via a package:my_proj URI.
See https://github.com/dart-lang/sample-pop_pop_win/ as an example
See also https://www.dartlang.org/tools/pub/package-layout

Creating a file via python on OpenShift application

with io.open("filepath/filename",mode="w",encoding="utf8") as file:
file.write(jsondata)
But it seems something wrong.
my flaskapp return 500 and no error logs
But when i remove it everything can run as normal.
what should i do?
If you are using OpenShift 2, it is likely your web application is running under Apache/mod_wsgi. You shouldn't in that case be using relative path names as the current working directory of the application is effectively undefined and likely not writable. Instead construct an absolute path name. Depending on what file is for, you may be best to write files into the data directory provided to you and specified by the OPENSHIFT_DATA_DIR environment variable, if it potentially needs to persist. Or OPENSHIFT_TMP_DIR if a temporary file. Details of important variables for directories can be found in:
https://developers.openshift.com/managing-your-applications/environment-variables.html#directory-variables
As to why you aren't seeing any error, this is likely because Flask is swallowing the error up when generating the 500 response. You would need to configure Flask to log details of the error.

Automatically generated WAF solution fails to load

Cryengine as an SDK has recently switched from providing pre-made solutions to forcing developers to use a WAF based build system to automatically generate a visual studio solution. Right now, there's very little communication coming from Crytek about problems everyone is having with the new build system so I was hoping someone here might be able to help.
I'm getting Cry-WAF (Crytek's WAF based build system) to generate a solution, but when I open it it provides an error (quoted below) and in the solution explorer appends (load failed) to each project in the solution. I first had an issue generating the solutions with Cry-WAF's msvs.py script saying it couldn't gather properties for platforms/configurations, but that eventually stopped and allowed the solution to be generated with the quoted problem.
A generic google search on the root cause suggested I try enabling IIS, but that has done nothing to fix the problems. Editing the .vcxproj files shows that they're correctly listing the paths to all files associated with that project. The only thing missing in the solution seems to just be the information that would tell what compiler to use, target names, target paths, etc. With what little I know about WAF as a build system, I'd assume that the python code Crytek is using to gather that information is just utterly failing.
Does anyone have a suggestion on what could possibly be done?
c:\Program Files (x86)\Steam\SteamApps\common\CRYENGINE\CRYENGINE_pc_eaascode\Solutions.depproj\CryAction.vcxproj : error : The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.
1) Specified argument was out of the range of valid values.
Parameter name: index
Resulting in: An exception occurred while trying to get the value of property 'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigurationMef.VCConfigurationShim'.
Resulting in: Cannot get export 'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigurationMef.VCConfigurationShim (ContractName="Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigurationShim")' from part 'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigurationMef'.
Element: Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigurationMef.VCConfigurationShim (ContractName="Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigurationShim") --> Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigurationMef
Resulting in: Cannot set import 'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCLegacyEventsTranslator.VCConfiguration (ContractName="Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigurationShim")' on part 'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCLegacyEventsTranslator'.
Element: Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCLegacyEventsTranslator.VCConfiguration (ContractName="Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigurationShim") --> Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCLegacyEventsTranslator
Resulting in: Cannot get export 'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCLegacyEventsTranslator (ContractName="Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCLegacyEventsTranslator")' from part 'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCLegacyEventsTranslator'.
Element: Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCLegacyEventsTranslator (ContractName="Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCLegacyEventsTranslator") --> Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCLegacyEventsTranslator
Resulting in: Cannot set import 'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigurationMef.EventsTranslator (ContractName="Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCLegacyEventsTranslator")' on part 'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigurationMef'.
Element: Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigurationMef.EventsTranslator (ContractName="Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCLegacyEventsTranslator") --> Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigurationMef
Resulting in: Cannot get export 'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigurationMef.VCConfigurationShim (ContractName="Microsoft.VisualStudio.ProjectSystem.ConfiguredProject.HostObject")' from part 'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigurationMef'.
Element: Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigurationMef.VCConfigurationShim (ContractName="Microsoft.VisualStudio.ProjectSystem.ConfiguredProject.HostObject") --> Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCConfigurationMef
At the moment only Visual Studio 2012 is supported, so issues with Visual Studio 2013 are to be expected.
There is a thread on their forums dedicated to helping with WAF problems, which includes getting it up and running with Visual Studio 2013: http://www.cryengine.com/community/viewtopic.php?f=314&t=130850
The WAF documentation is here: http://docs.cryengine.com/display/SDKDOC4/Getting+Started+with+WAF
You will find help much more quickly on the CRYENGINE forums - few users habitually check Stack Overflow for these types of questions.

Pentaho DI / Kettle / Spoon Configuration with External Jars

I am deveoloping a custom plugin for Pentaho DI / Kettle 4.4 and use custom Validation and XSLT jars as part of it.
Those jars are referenced in plugin.xml along with the plugin's jar itself and deployed in the same location as the plugin's jar.
When I try to load this plugin in Spoon GUI, I can see and run the plugin fine till I reach the reference to the external jars and after that I get ClassNotFOund Exception.
I have tried following so far but has not worked :
Add the expernal Jars to libext folder and expect those to be picked up automatically. - Failed. Jars not loaded.
Add -cp command line option to Spoon.bat and specify the Jar files - Did not work.
Turned on -verbose option and search everywhere in the output but the Jars are ignored.
Deployed the Jars next to the plugin's Jar file in the plugin's folder. - Jars are not recognized.
From Within the plugin, if I dynamically load (using Reflection and URL Class Loader) I am able to force the loading of the Jars and it works that way but I would like a simpler classpath fix.
Any class that I reference in the Jar through XSL externsion (XALAN-J Java Extension) is still not recognized / loaded and XSL terminates at the beginning of Extension call.
Searched Google and this site for something similar but did not find specific answers on why SPoon behaves so differently and avoids external code and content.
A similar issue is reported here though its too old and has not shown final conclusive fix. I tried all that it said. http://forums.pentaho.com/archive/index.php/t-77190.html
Requesting someone to help me identify whats missing. Thanks in advance,
Thanks to this seemingly obscure website and it fixed all pain.
http://www.arulraj.net/2014/09/how-to-access-external-java-libraries-with-in-pentaho.html
Basically, go to the launcher folder and edit the launcher.properties file to include any path, library etc. and it fixes all the issues I reported above. Wish Kettle documentatation had answers like this.

Default documents in web.xml not being respected (developer/stand-alone server)

For some reason, when browsing to URL that ends in a folder (ex. //localhost:8500/website/directory/), index.cfm is not loading and instead a 404 error page is returned. I have confirmed that the ...\web-inf\web.xml file is being used by modifying filter-mappings to enable the display of .htm and .txt files. In fact, none of the files in the welcome-file-list section are being used even if they exist which leads me to believe that there is something wrong with this section of the web.xml file.
The web.xml files are as follows:
{install-root}\cfusion\runtime\conf\web.xml
{install-root}\cfusion\wwwroot\web-inf\web.xml
Both files contain the same XML listed below.
<web-app>
...
<welcome-file-list id="WelcomeFileList_1034013110672">
<welcome-file>index.cfm</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.txt</welcome-file>
</welcome-file-list>
...
</web-app>
I have just recently patched to Update 6, but I believe that the problem was always there from the initial install. Please note that this is the development stand-alone server.
Has anyone already solved this or have any ideas on how to proceed other than re-installing CF10 and using IIS?
Late to the party, IMO there are two possible reasons that i can think of for this issue
Either your have additional mapping like "/" in place which is taking over servletcontainer's builtin default servlet who is the one responsible for going to the right root path
your folder name is something which CF already have a mapping for e.g. /flashservices/gateway/, CFFormGateway, cfform-internal, WSRPProducer, JSDebugServlet, flex2gateway
I think sharing your web.xml could have helped pin point the issue here.
I had this issue recently and it was a case-sensitivity issue in Tomcat (despite this being a ColdFusion 10 install on Windows).
My default index.cfm would load when I navigated to http://127.0.0.1 but as soon as I went to http://127.0.0.1/mysite, I got a 404. The folder was named mySite in Windows. As soon as I changed my URL to http://127.0.0.1/mySite it began working.