google-code-export / gwt-log

Automatically exported from code.google.com/p/gwt-log
1 stars 0 forks source link

symbolMaps configuration issue in jboss WEB-INF/deploy not resolved to war directory. #57

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Does the issue occur in "quirks mode", "standards mode" or both? If you
don't know, does your HTML page contains a DOCTYPE declaration?

What version of GWT are you using? 1.4.60? 2.0.4? Other?
2.2.0
What version of the gwt-log jar file or library file are you using?
3.1.0
What operating system(s) are you using? Windows? Linux? Mac?
N/A
Does the issue occur in web mode, development mode (formerly "hosted
mode"), both or don't know?
web mode

What browser(s) do you use? Chrome, Firefox, IE, Safari, other?
N/A

What is the browser version (if you know) from Help->About?
N/A

What steps will reproduce the problem? Please attach sample code if you
can.
1. Stack traces are still obfuscated.
2.
3.

What is the expected output? What do you see instead?

Problem appears to be that in jboss environment the relative directory is not 
the war dir but instead jboss' bin directory

Do you have a workaround?
Yes. specify full absoulte path, but not very portable.

A patch for RemoteLoggerServiceImpl's init method that attempts to find the 
real path is:

String symbolMaps = config.getInitParameter(PARAMETER_SYMBOL_MAPS);
    if (symbolMaps != null) {
      File symbolMapsDir = new File(symbolMaps);
      if (!symbolMapsDir.exists()) {
        symbolMaps = config.getServletContext().getRealPath(symbolMaps);
        symbolMapsDir = new File(symbolMaps);
        if (symbolMapsDir.exists()) {
          Log.warn("Updated symbol maps to: " + symbolMapsDir);
        } else {
          Log.warn("Symbol maps directory does not exist: " + symbolMapsDir);
        }
      }
    }

Please provide any additional information below.

Original issue reported on code.google.com by co...@macnaughton.com on 24 Mar 2011 at 9:52

GoogleCodeExporter commented 9 years ago
I have the same problem with Tomcat, but it can be easily fixed by changing 
line 62 of RemoteLoggerServiceImpl like this :

    deobfuscator = new StackTraceDeobfuscator(getServletContext().getRealPath("/") + symbolMaps);

Best regards,

Gilles

Original comment by gilles...@gmail.com on 13 May 2011 at 4:27

GoogleCodeExporter commented 9 years ago
I think this fix should really go into StackTraceDeobfuscator

http://code.google.com/p/google-web-toolkit/issues/detail?id=6364

Original comment by fredsa@google.com on 17 May 2011 at 4:27

GoogleCodeExporter commented 9 years ago
is there any workaround, besides of specifying an absolute path or changing 
code of the .jar? doesn't look like the problem is fixed by the gwt team in the 
near future...

Original comment by mario.pl...@gmail.com on 11 Jul 2011 at 1:44

GoogleCodeExporter commented 9 years ago
The problem is still present in the gwt-log1.3.6 jar. Is there a workaround? I 
want to avoid making a patch for RemoteLoggerServlet

Original comment by mad.mike...@gmail.com on 13 Dec 2011 at 4:48

GoogleCodeExporter commented 9 years ago
I'm sorry, i mean gwt-log-3.1.6

Original comment by mad.mike...@gmail.com on 13 Dec 2011 at 4:49

GoogleCodeExporter commented 9 years ago
I've added additional server side debugging in gwt-log 3.1.7 to help with 
diagnostics:
  http://code.google.com/p/gwt-log/source/detail?r=3c2d31957fcda7aaa0f12c69b0d7ed966e2f8a14

Note also that you can specify multiple symbolMaps locations in your web.xml, 
in order to cover multiple compiled modules/projects, or multiple deployment 
scenarios:
  http://code.google.com/p/gwt-log/wiki/GettingStarted

You may also try an absolute path rather than a relative path if that suits 
your project.

Original comment by fredsa@google.com on 15 Dec 2011 at 7:07

GoogleCodeExporter commented 9 years ago
Users can now specify multiple symbolMaps paths (see  
http://code.google.com/p/gwt-log/wiki/GettingStarted).

Original comment by fredsa on 9 Feb 2012 at 11:01

GoogleCodeExporter commented 9 years ago
Absolute path and multiple paths doesn't solve this problem, since in some JEE 
containers you don't know where the app is deployed (the directory where the 
war file is exploded). The ideal solution would be the inclusion of a servlet 
paramater, that indicate if getServletContext().getRealPath() method should be 
used. e.g.:

<init-param>
 <param-name>symbolMaps</param-name>
 <param-value>WEB-INF/deploy/module_name/symbolMaps/</param-value>
</init-param>
<init-param>
 <param-name>isContextPath</param-name>
 <param-value>true</param-value>
</init-param>

Original comment by luiz.mi...@gmail.com on 22 Feb 2012 at 4:45

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
+1 for the "isContextPath true"-solution. 
Why don't you fix this in gwt-log until it is fixed in gwt 
(https://code.google.com/p/google-web-toolkit/issues/detail?id=6364 )? We have 
to patch gwt-log cause of that stuff :(

Original comment by mse...@gmail.com on 30 Apr 2013 at 10:13