Could not load Logmanager "org.apache.juli.ClassLoaderLogManager" #500

Closed
anilg opened this Issue Jan 17, 2013 · 3 comments

Comments

Projects
None yet
4 participants
@anilg

anilg commented Jan 17, 2013

Getting following error :

Could not load Logmanager "org.apache.juli.ClassLoaderLogManager"
java.lang.ClassNotFoundException: org.apache.juli.ClassLoaderLogManager
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.util.logging.LogManager$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.logging.LogManager.<clinit>(Unknown Source)
    at java.util.logging.Logger.getLogger(Unknown Source)
    at org.jruby.util.log.JavaUtilLoggingLogger.<init>(JavaUtilLoggingLogger.java:43)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.jruby.util.log.LoggerFactory.<clinit>(LoggerFactory.java:48)
    at org.jruby.Main.<clinit>(Main.java:76)

I am using jruby-1.7.1, Rails 3.2.8 and tomcat-6

@Ivansek

This comment has been minimized.

Show comment Hide comment
@Ivansek

Ivansek Mar 4, 2013

I have a same problem. Did anyone found a solution?

Ivansek commented Mar 4, 2013

I have a same problem. Did anyone found a solution?

@cforcey

This comment has been minimized.

Show comment Hide comment
@cforcey

cforcey Mar 4, 2013

For our group, it was a result of our Tomcat start up script setting JAVA_OPTS:

We changed the tomcat script to use CATALINA_OPTS in start.sh#3 (xtext)

export CATALINA_OPTS="$CATALINA_OPTS -Xms1024m -Xmx4096m -XX:PermSize=512m -XX:+UseParallelGC"
$EXECUTABLE -Djava.io.tmpdir=../tmp/ -Djruby.debug.loadService=true

And then we tweaked out Rails bootstrap to be sure to check for the error:

# patch for avoiding catalina logger getting used in jruby automations
# config/initializers/bootstrap.rb
env_java_opts = ENV["JAVA_OPTS"]
begin
  if(env_java_opts && env_java_opts.include?   ("Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"))
    ENV["JAVA_OPTS"].gsub!("-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager","")
  end
rescue
  Rails.logger.warn("WARNING: Automation may not run properly because JAVA_OPTS couldn't be updated. (#{env_java_opts})")
end

Rails.logger.info("\n**** Automation Configuration ****")
Rails.logger.info("\nRUBY_PATH=#{RUBY_PATH}")
Rails.logger.info("\nJAVA_OPTS=#{ENV["JAVA_OPTS"]}")
Rails.logger.info("\nJAVA_HOME=#{ENV["JAVA_HOME"]}")
Rails.logger.info("\nJRUBY_OPTS=#{ENV["JRUBY_OPTS"]}\n")

Hope this helps. Other insights? C

cforcey commented Mar 4, 2013

For our group, it was a result of our Tomcat start up script setting JAVA_OPTS:

We changed the tomcat script to use CATALINA_OPTS in start.sh#3 (xtext)

export CATALINA_OPTS="$CATALINA_OPTS -Xms1024m -Xmx4096m -XX:PermSize=512m -XX:+UseParallelGC"
$EXECUTABLE -Djava.io.tmpdir=../tmp/ -Djruby.debug.loadService=true

And then we tweaked out Rails bootstrap to be sure to check for the error:

# patch for avoiding catalina logger getting used in jruby automations
# config/initializers/bootstrap.rb
env_java_opts = ENV["JAVA_OPTS"]
begin
  if(env_java_opts && env_java_opts.include?   ("Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"))
    ENV["JAVA_OPTS"].gsub!("-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager","")
  end
rescue
  Rails.logger.warn("WARNING: Automation may not run properly because JAVA_OPTS couldn't be updated. (#{env_java_opts})")
end

Rails.logger.info("\n**** Automation Configuration ****")
Rails.logger.info("\nRUBY_PATH=#{RUBY_PATH}")
Rails.logger.info("\nJAVA_OPTS=#{ENV["JAVA_OPTS"]}")
Rails.logger.info("\nJAVA_HOME=#{ENV["JAVA_HOME"]}")
Rails.logger.info("\nJRUBY_OPTS=#{ENV["JRUBY_OPTS"]}\n")

Hope this helps. Other insights? C

@headius

This comment has been minimized.

Show comment Hide comment
@headius

headius Nov 13, 2014

Owner

I'd like to understand why this happens, but I suspect it's going to be very specific to how the server's classloaders work. We have had many classloader improvements since the last comment, and there has been no other insights, so I'm closing this.

Owner

headius commented Nov 13, 2014

I'd like to understand why this happens, but I suspect it's going to be very specific to how the server's classloaders work. We have had many classloader improvements since the last comment, and there has been no other insights, so I'm closing this.

@headius headius closed this Nov 13, 2014

@headius headius added this to the Invalid or Duplicate milestone Nov 13, 2014

eregon added a commit that referenced this issue Oct 28, 2017

Squashed 'spec/ruby/' changes from 691755d..a6b8805
a6b8805 Fix the 2.5 example of Warning.warn to be independent of $VERBOSE
65f80f6 Make the Warning.warn specs work indepent of the external warning level
9daa40d Fix for loop for old before C99 compilers
b25e9ec Add a couple more expectations for post + kwargs
ea6c301 Fix style
f04a632 Improve warnings when there are leaked process before the Process.wait2 specs
e186683 Add an example for readlink with unicode characters
43adad3 Add spec for a binary Symbol
aa792e7 Add rb_str_new example with offset
e6b67cd Add spec verifying $VERBOSE allows truthy values.
61e7f32 Add rb_yield passing block with each spec
3e945e7 Recompile spec cexts if the ruby library changed
f398b2c Improve SafeStringValue by sharing the specs of StringValue
1bbcba9 Fix SafeStringValue, add spec
be895f7 Test rb_class_of() with an object with a singleton class
b2e08d2 Use stub! when there is no guarantee if and how many times it is called
4125eca Add specs for [Feature#13983] Rational and Complex should be frozen
6b6d33e Revert "Dir.glob with FNM_EXTGLOB is optimized [Feature#13873]"
6019e87 io.c: write a newline together
4c42133 Dir.glob with FNM_EXTGLOB is optimized [Feature#13873]
07576e1 Revert "ignore server side error"
00a6585 ignore server side error
ad5eb0a spec/ruby/optional/capi/io_spec.rb: speling fics
e79f3eb array.c: improve operations on small arrays
340826a Use #gets instead of recv(2014) for FTP specs
bc5521a Avoid warnings in if with multiple assignments
8916cca Fix ruby_bug version range and expectation
061ac41 Make it clear top-level return specs specify the ruby 2.4.2 behavior
9a26eda Clarify how to use ruby_bug
6078bba Add specs for Integer.sqrt [Feature #13219]
45e578a Add more specs for Date#next_month, Date#prev_month
fb5a97b Improve specs for Date#next_day, Date#prev_day
d9c1c83 Code review. Mark some test cases as bugs
63b3d78 Code review. Replace excessive `ruby_exe` calls with temp file loading
04fd5be Add specs for top-level return (tested with Ruby 2.4.2)
847d901 spec for regexp absent operator
6ea9b6b Rename file to match standard naming conventions
9cfced0 Fix a couple spec descriptions
53dc62f Add spec for REXML::Element#[]
81c9b4f Remove unnecessary top-level version guard in Module#refine specs
ab3765e Add specs for Module#using
7cf3b1d Update specs for main#using
37a2e86 Add specs for Module#refine for Ruby 2.4
dca2e4f Add specs for Module#refine
214743d Update specs for Module#refine
44a1368 Restore specs for main#using (45fe77547a063284cbc04faf6708a426ed68f712)
84c940e Restore specs for Module#refine (45fe77547a063284cbc04faf6708a426ed68f712)
58154a0 Fix misspell with https://github.com/client9/misspell
21f7385 Use multiple lines in StringIO chomp: true examples
b6ed5bf Changed incorrect carriage return usage to newline characters
74190bb Add chomp specs for StringIO#gets, StringIO#readline, StringIO#each_line, StringIO#readlines, StringIO#each and StringIO#lines
863f342 Changed incorrect carriage return usage to newline characters
e8f16ca Add chomp specs for IO#gets, IO#readline, IO#each_line, IO#readlines and IO.foreach
9457cc8 close logger
93a2219 test shift_period_suffix
92a38a8 Code review. Update case descriptions
c135a65 Add spec for CSV#readlines to test parsing illegal input
d98f29b Add spec for CSV.parse to test parsing illegal input
d3dc4b8 Add specs for CSV#liberal_parsing?
5be6e46 DateTime.now uses be_close to avoid day rollover
9c73504 Properly implement be_close on timing assertion
8258707 Be close enough on time
d691fbd Replace data shell out with Process#clock_gettime
44bd7e6 Better describes the Timezone preservation for DateTime.now
fa464db Time.now preserves local timezone
fc8dad7 Date.today checks against local date
0ac7b33 Time.now spec checks time
a2d4732 Expands coverage of DateTime#now
feef77e Adds DateTime#to_s
dae126d Adds DateTime#to_date
d62a273 Adds DateTime#to_datetime
f48b4a4 add spec for ConditionVariable#marshal_dump
3516c4a Update RuboCop to 0.51.0
92e2231 Remove spec, a better one is coming in PR 528
9dc9897 test instantiating logger with keyword arguments
441b94b Recommend to not use should_not raise_error
b006666 fix a couple typos
3ce41f7 Add spec for OptionParser#parse into argument
da9f1eb Add spec for OptionParser#order into argument
213041c Avoid printing the return value of Warning.warn/IO#puts
8d35f67 Move parser warnings to 2.4
da55149 Add spec for overriding Warning.warn
ebcdd4c Add a few more specs to Warning.warn
f7da018 Add spec for Warning.warn
4ca0dd0 Code review. Fix spec description
3b46c0c Add spec for Shelwords.shelwords bug with backslash escaping
76d9649 try to clarify when to use ruby_bug
0f1c23e Add spec for `IPAddr#==` bug
2602cd8 Add specs for Net::HTTP.post
f6a1941 Refactoring spec for Date#wday
cb0fd00 Add spec for Date#friday?
d72d05d Add Date#saturday? spec
e84fba1 Add Date#friday? spec
0b6d255 Add Date#thursday? spec
0cda9f2 Add Date#wednesday? spec
134361c Add Date#tuesday? spec
eebb66f Add Date#monday? spec
36ebba9 Add Date#sunday? spec
0f78774 Add Date#wday spec
e78f0ba transform_values: add spec for partial modification
fa11325 transform_values: test for empty frozen hash
fb65f5a Add spec for Hash#transform_values
7e4033a remove extra proc, clean up desc
08d6e68 use scratchpad for mult. assign test
149faaf catch error to get other ruby versions passing
6e55b81 Add spec for multiple assignment conditional
5c705c1 Merge pull request #522 from 284km/fix-typo
75129db Fix a typo
559bc18 Enable Thread.report_on_exception = true by default in ruby/spec
5ea6848 Add specs for Thread{.,#}report_on_exception{=,}
66a6754 Mark behavior with the reported upstream bug
d33bc13 Code review. Check both "\n" and "\r\n"
0a1ac1a Add specs for `chomp` argument of `String#lines` and `String#each_line`
a8d352e Ensure that Ruby 2.4 supports rescue in method arguments #473
d4892bd Add specs for \X character class
8c1b3f5 Add a list of common guards
b54e8c6 Add a list of frequently-used matchers to get started
a0ae256 enable the leak checker on macOS since we get EBADF errors
14a951a Improve descriptions
4854304 add missing :
b59a9ca changed assertion language and used symbol literals
6f4f946 added missing do after assertion
d4e2148 Character manipulation coverage for symbol ruby 2.4
5a0f22a Code review. Check string content instead of not raising exception
e873562 Add simple test for `capacity` argument of `String.new` method
77f23fa Core review. Add case with long buffer and use `equal`
35307dd Add specs for `Array#pack`'s `buffer` option
9e81f33 Add specs for TracePoint#callee_id
0ba04d7 Add Set#compare_by_identity & Set#compare_by_identity? specs
fa456b4 Add specs for Set#compare_by_identity
6345a38 Add a spec for deprecation warnings on Fixnum/Bignum
e3b13f1 Add missing version guard and improve description
9027d74 Code review. Replace `==` with `equal` and add spec for `Integer`
7626b75 Update Fixnum specs
b894db3 Update Bignum specs
25883f4 spec: covered String#upcase!
0e937c3 spec: covered String#swapcase!
7e97cb8 spec: covered String#downcase!
199a0b7 spec: covered String#capitalize!
ae5fc98 Fix style of a couple specs breaking lines when not needed
ba295cb Add missing should in Array#permutation spec
d245974 Check the return value of & to avoid warnings
2144b2a Merge pull request #500 from joshgelbard/more-missing-should
0d5a424 Add more missing .should calls
770b3bf Improve specs description
0f3e461 Add specs for `half` option in `Rational#round`
3e43ae5 Add missing ".should" and fix subsequent failure
38b085c Add a spec testing what calls are made for Array#sum
e3e3ffa Code review. Implement test case without refinements
232dcc7 Add specs for Array#sum
a68c5e9 Spec Constant ||= for all scoping possibilities.
f5146f1 Make sure the returned time is the same instance
c4cdc6b Moves the to_time call into the with_timezone to verify no timezone shift
50bf0a9 Version guard on timezone preservation of DateTime#to_time
d8bb344 Updates for clarity on to_time
dd6fbc0 Adds timezone comparison
04cbc22 Adds specs for DateTime#to_time
a538fa9 Time#to_time spec
f8a9f7c Fix some typos in test descriptions
1915741 Adds specs for Complex with infinity on the real part
43df951 Adds Complex#finite? and Complex#infinite?
e2a9b65 Add Numeric#finite? and Numeric#infinite?
0a2d315 Supplement specs for Enumerable#uniq
fa47230 Add spec for complex expression in ().
ef70ce7 Adds String#unpack1 (#488)
6d04a08 Skip failing spec on Travis CI due to the special Travis environment
de02faa Update to latest MRI releases
487a79d Enable the TrailingWhitespace cop
1af928f Update to RuboCop 0.50
ec7a116 Add spec for CGI::Cookie.parse about handling , separator
64c06f9 Fix integer rounding-related specs for the new behavior on 2.5
75b1a1f Add more specs for Integer#ceil and Integer#floor
100bec0 Add specs for Integer#truncate that takes optional digits
8d097ed Add specs for Integer#floor that takes optional digits
c0f73bd Add specs for Integer#ceil that takes optional digits
dea4eb7 Changes on Pathname#empty? specs per Peer-Review
d19fcad Adding Pathname#empty? specs
819a4e4 Clarifies Integer#digits radix mechanics
d59065a Adds specs for Integer#digits
04add34 Removes dependence on DirSpecs fixtures
9d8e136 Nitpick: it's Dir.empty?, not Dir#empty?
36a81ce Adds specs for Dir#empty?
bd9eda1 Add specs for symbol#casecmp? (#480)
7904658 Add spec for Integer#round(half:)
8501780 Symbol with invalid bytes are detected at parse time
3d5efd7 Symbol are unique so also test their identity with #equal?
1ff0e0a Improve String#to_sym spec to specify the encoding of the resulting Symbol
8f96e83 Use UTF-8 characters instead of escape sequences when possible
6f182f9 Move to utf-8 encoding in the Symbol#casecmp spec
c33c429 Improve String#casecmp? spec and use String literals when possible
f4ade8d spec for String#casecmp?
88036c3 Add spec for Net::FTP#status(pathname)
2429bba Add spec for Float#round(half:)
6bf1725 Add spec for File.empty?
2c43fec Adds specs for Float#ceil, Float#floor, and Float#truncate (#475)
c073cd3 Fix whitespace [ci-skip]
1153e30 Tweak spec so it doesn't assume that number literals are always the same object.
6e943e1 Fix whitespace [ci-skip]
f07c3de Spec that Array#min,max are defined and not just from Enumerable
a6c4f6e Fix of MRI Bug 12367 was backported to 2.3 and 2.2
24515bc add specs for 2.4+ MRI behavior on duping numerics,nil,false and true
e778d17 Create objects in before blocks in super specs
61db431 improved specs for super arguments

git-subtree-dir: spec/ruby
git-subtree-split: a6b8805fe3fe9cea81bbcebffb8a0fac5b09dbc2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment