Enterprise Library 5.0: Bug in exception logging to rolling log file? - enterprise-library

So, what I'm trying to accomplish is that my exceptions get logged into the rolling log file (which I use for other things, especially tracing - which is VERY important in the environment I'm working in - too).
Problem is that I get all traces into rolling.log, but the exceptions get logged into files with the following name scheme:
{guid}rolling.log
Smells like a bug...
Edit:
Found the solution. The log - file is locked, EntLib creates a new one with that "Guided" (pun not intended, it just happened) name. Case closed. :-)

Related

pydbg thread refuses to print log information

I am running the Sulley fuzzing tool, which uses pydbg to debug the target process. The pydbg threads are spawned in the process_monitor.py module of the Sulley environment. My problem is that when a test case (malformed packet) causes the process to crash, the debugger thread continues to run, and the following test case triggers an access violation.,This is then sent to the session module saying the wrong packet, the second test case caused the access violation.
I am trying to print the log information from pydbg to debug exactly what is happeneing, but nothing I do seems to be working. Obviously since this a thread it has no console to print to, so I've tried many different methods of writing to a file.
Even a very straight forward
logFile = open('C:\sulley_build\sulley\logFile.txt', 'w')
logFile.write("test")
won't create a file at that location. I know the pydbg thread is spawned, yet even putting that code in the _init__ function does nothing.
Help?
It's been a while since I've worked with the process monitor, but here's my advice:
Sulley had several procmon bugs when I used it. I submitted two patches here:
https://github.com/OpenRCE/sulley/pull/94
https://github.com/OpenRCE/sulley/pull/83
These bug fixes may be related to your issue (hard to tell with Sulley's architecture). I would give them a try. The fixes are already applied on my fork, or you can manually apply them in your own fork.
It sounds like the procmon is not reporting the crash properly. I distinctly remember this issue, but can't recall if the fixes mentioned above resolve it. If you do try to get it working, the key method is ProcessMonitorPedrpcServer.post_send.
If you want to report more crash details, try writing them into self.last_synopsis. See ProcessMonitorPedrpcServer.get_crash_synopsis.
Happy fuzzing!

Groovy debugger out of sync

I am having a difficulty while attempting to debug some code in grails. It is difficult to put into text, so I have posted a screencast showing exactly what the problem is here. In short, while I am debugging the debugger starts jumping from place to place and not following the program logic I have in place. The only other similar question I have found is a year old, had no solution, and can be found here.
The best guess I have so far is that the debugger is displaying the text I have typed in, but is actually executing an older version of the class file which it has cached somewhere. Therefore, I tried:
cleaning the project
manually deleting all of the class files from the target folder and from the target-eclipse folder
Searching my entire hdd for additional files with similar names
removing my project from the workspace and re-adding it
closing and reopening the IDE
grails refresh-dependencies
Importing the project into a new IDE (I was using GGTS, I switched to IntelliJ)
None of those solutions had any effect. I realized that the issue was in a .groovy file, and I was writing almost pure Java, so I deleted the .groovy file, and re-created the class in a .java file. That solved my problem. Unfortunately I am having the problem again, and this time it is in a controller that heavily relies on the grails framework, so that solution is not an option. Other than also being in a .groovy file, another similarity is that the code breaks on an if statement.
My next steps:
Verify that the application is not executing the code I see by using print functions to monitor actual execution flow.
comment out the entire function and re-add functionality one line at a time to see if I can see what breaks it.
Delete the .groovy file, and re-create it as another .groovy file.
Any help is appreciated, and since I can't find any answers online I will continue to update this question as I learn more.
See my comment on the jira issue that you raised. You have found a problem with the groovy compiler and how it calculates line numbers. This is not a problem with executing the wrong class files or using a broken debugger. The debugger is doing exactly what it is expected to do. It is the compiler that is providing erroneous line number information.
The next step, as described in the issue, is to provide a simple project that recreates the bug. I tried to do so myself, but could not. So, please supply something that we can work with. Then we can notify the groovy compiler team.

How to get Eclipselink samples to work: "student" and "mysports" samples

I've been trying to get the following Eclipselink samples to work, with less than 0% success:
A)
http://wiki.eclipse.org/EclipseLink/Examples/JPARS/Simple
B)
git://git.eclipse.org/gitroot/eclipselink/examples/mysports.git
Both samples are quite recent and should work "out of the box". My results:
A) starts and deploys on glassfish, but application is totally unresponsive
B) does not deploy, since glassfish does not find the data-source mentioned in the persistence xml's: java:global/mysports
For both I tried to get information on how they are supposed to work, but after two days of searching for documentation, I can safely state: there is literally NOTHING documented.
For A) I am totally clueless, there is nothing to configure for this sample, but the provided URLs for interacting with the REST service always return with 404 and no log or error message whatsoever.
For B) Beside the broken data source (I guess my fault), I tried setting default JDBC data-sources, to see if at least the REST service itself works: it looks dead, I get exceptions when opening the sample JSF pages (the reference variables inside the pages all resolve to NULL).
Anybody ever tried to actually run these samples? I am totally frustrated after many hours of being far away to anything testable...
Maybe some questions as a starting point:
- How does the JPA-RS get registered in the appserver? how do I tell if it was at all? And which URL it maps to?
- How does this magic "java:global/mysports" data source work?
- The maven configuration acts funny, I couldn't get any of the two samples to properly debug (no breakpoints were hit at any point in time). Any ideas?
If you are using Glassfish earlier than Glassfish 4.0 (http://dlc.sun.com.edgesuite.net/glassfish/4.0/promoted/) you will need to download newer version of EclipseLink 2.4.2 binaries from http://www.eclipse.org/eclipselink/downloads/nightly.php (2.4.2 Nightly Build Results) and replace following files under $GLASSFISH_HOME/glassfish/modules with corresponding jars you downloaded above:
org.eclipse.persistence.antlr.jar
org.eclipse.persistence.jpa.jar
org.eclipse.persistence.asm.jar
org.eclipse.persistence.jpa.modelgen.jar
org.eclipse.persistence.core.jar
org.eclipse.persistence.oracle.jar
javax.persistence.jar
org.eclipse.persistence.dbws.jar
org.eclipse.persistence.jpa.jpql.jar
Make sure you clear Glassfish osgi cache by removing the $GLASSFISH_HOME\glassfish\domains\your_domain\osgi-cache directory after you replaced the bundles listed above, and before you restart the Glassfish.
These are both advanced examples, unless you are looking for these specific features, I would recommend starting out with simpler examples.
There are many EclipseLink JPA examples documented here,
http://wiki.eclipse.org/EclipseLink/Examples
Most of the examples are still in SVN here,
http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/examples/
For documentation on the JPA-RS examples see,
http://wiki.eclipse.org/EclipseLink/Examples/JPA#JPA-RS
Try adding question to the example's wiki discussion page if you are having specific problems.
The MySports example is very advanced. Unless you are looking for extendable entities and multi-tenancy, I would not recommend starting with this example.
To add to James' comments, if you are specifically interested in JPA-RS, perhaps these additional comments will help. I also recommend asking questions on the wiki discussion page.
JPA-RS gets registered in the appserver by the existence of the org.eclipse.persistence.jpars_[version].jar in the WEB-INF/lib directory. This jar contains the web-fragment.xml which is what defines the JPA-RS service. You will know if it was deployed if the following URL pattern returns persistence unit metadata:
http://<server>:<port>/<applicationName>/persistence
Some additional documentation for JPA-RS:
- http://www.eclipse.org/eclipselink/documentation/2.4/solutions/restful_jpa001.htm
- wiki.eclipse.org/EclipseLink/Development/2.4.0/JPA-RS/REST-API
One thing that will help you debug is to view the Glassfish server log. If you are running in Eclipse, right click on your Glassfish server in the Server view, go to Glassfish->View Log File, which will open the server log in your console view. This will show you what is happening with deployment, and will alert you to any errors. Also be sure to double check your URLs.
Ok, ladies. A friend of mine had the brilliant idea of forcing ALL logging on eclipselink-jpars library (by setting this value in every single file we could think of) and indeed we found an exception that is FOR NO GOOD REASON hidden in the lowest log level:
javax.xml.bind.PropertyException: name: eclipselink.json.include-root value: false
Whatever that means, but that again convinces me that I will not use this feature/lib for the time being. An exception should be visible on all log levels, especially if I go down to FINE (as stated in the samples!)! I almost lost three days just because of this.

Is there a workaround for the following VSTO Word 2010 word addin click once deployment error?

When deploying a Word Add in , which publishes without error. I get the following error after the files have been copied.
I do not have much to go on. This is the stack trace.
************** Exception Text **************
System.ArgumentException: Value does not fall within the expected range.
at System.Deployment.Internal.Isolation.IActContext.ApplicationBasePath(UInt32 Flags, String& ApplicationPath)
at System.ActivationContext.get_ApplicationDirectory()
at System.AppDomainSetup..ctor(ActivationArguments activationArguments)
at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.CreateAppDomainSetup(ActivationContext context, Uri deploymentManifestUri, AddInInstallationStatus installStatus)
at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()
here's an answer to what you are looking for:-
the problem:-
open Process Monitor during the failed update and see if Winword.exe is browsing the following registry key->
HKCU\Software\Classes\Software\Microsoft\Windows\CurrentVersion\Deployment\SideBySide\2.0\Marks\mmiw..vsto_510943deeecbc925_0002.0000_2055f5031035ea75\appid
in this someone managed to check the Compatibility Mode checkbox for Word, running it default under Windows XP SP2 (see if you can make the program compatibile with your system in short).
if this is not the issue
Then read further into this :- deploy a VS 2008 SP1 Word 2007
There is another post i have found on this topic HERE. it shows a possible work around that you could try to get a result? i'm not entirely sure but in this, the developer was using outlook 2008, i think he removed the instances of outlook within his code and re-implemented parts of it and left out others. Perhaps this could be a temporary fix or help you understand what the problem is?
(I'm sorry my answers aren't so clear, i don't have much time for stack overflow at the moment, i will clean up the answer when i have more time(it will flow)) ++ this is all i can find regarding this error, but there are people with the same issue on the Microsoft forums, maybe you could find an answer faster on there? if you follow the links I've posted you should be able to find some information that might be able to give you a decent fix.
PS. if this doesn't work, reply asap and i will search asap, i think I've found something else which might be of use, just have to understand it myself before i post.
I recently came across this problem too after messing with some dependencies. None of the noted solutions worked (either on MSDN or here).
How I fixed it:
Find an old published version that worked.
Find the .dll.manifest file.
Diff that manifest with the one that is erroring.
In my case, I saw that a .dll was incorrectly referenced there (I thus had a v2 of it and a v4). I removed this reference and, thank god, it works.

WebApp ignores patched perl pm file

I never really came in touch with perl before, so I really hope, this is a real newbie question and I can solve the problem pretty quick...
We've one perl based web application installed on a windows 2003 server environment. The installed version contains a bug and I know where to apply the patch. Basically: I have carefully changed two lines in one of the web apps pm files.
To my surprise, the file change is ignored and I still get the same error messages with references to the old version of the file - clearly identifiable by the line numbers.
I've cleared the browser caches, restarted the web application (including apache) - no luck.
Now I think/hope that this is some kind of perl feature, but I even don't know enough of that language to ask google the right questions. One tutorial said, that perl is an interpreted language and that changes to source files are effective immediately. This isn't true for my site...
Are there some more caches/files I have to touch or delete in order to make my changes effective?
Are you sure your Perl is actually using the latest version of said pm file? There is no other version somewhere else included which is getting used?
Take a look at #INC
Step through your programming using a debugger
Sprinkle warnings around the code and see if it gets called.
Problem solved and the solution was outside perl - thanks for your patience.
The web application contained some javascript / css caching. After
deleting the caches (js-chache, css-cache)
clearing the browser cache
restarting Internet Explorer (!)
it started working again. Don't ask me why...