Closed GoogleCodeExporter closed 9 years ago
What's the use case for using ClassPath on WebLogic?
In this particular case it's circular reference but there could be not so
obvious cases where ClassPath silently ignores classes.
We've only tested ClassPath in simple J2SE environment and the main use cases
so far are for testing. ClassPath uses heuristics so it's possible that some
application server uses uncommon ClassLoader implementation that ClassPath
can't scan.
Original comment by be...@google.com
on 25 Mar 2013 at 9:54
Original comment by be...@google.com
on 25 Mar 2013 at 9:56
I think I've found an alternate way to accomplish what I was trying to do.
Specifically, I was curious if I could find a way to offer an omnibox-style
autocomplete recommendation on a field where an admin user would be typing
either a package or fully qualified classname.
I remembered ClassPath, so that was where I initially focused my energies. I
think I can get a subset of loaded classes through another means that will
serve my purpose nearly as effectively.
If you think the guard I recommended might introduce unexpected results,
perhaps the best solution would be to expand the javadocs to explain that
ClassPath's use is recommended for non-JavaEE and non-Production uses.
It's always possible there are other JARs that have the same self-referential
problem, and even in a J2SE/Testing situation you'd be unable to use ClassPath
without repackaging the JAR yourself. So although my original plea was due to
my Weblogic constraint, it still seems like fixing this might not be a bad idea
for non-Weblogic/JavaEE users.
Original comment by stephen....@gmail.com
on 26 Mar 2013 at 2:02
Yes. I agree that doing the circular reference check is reasonable and thank
you for reporting the bug.
I was just worried that if you use ClassPath for mission critical work on
WebLogic such that ClassPath needs to return *all* classes at all cases, we
didn't test it on WebLogic or other application servers to make sure it will
offer the level of guarantee.
It sounds like it's more for a tool, not for production critical things, which
sounds a lot less risky.
I'll add the fix.
Original comment by be...@google.com
on 26 Mar 2013 at 2:14
Great! Thanks for the quick reply. Correct - I'd plan to use it in a tool that
was not mission critical. I also appreciate that you took the time to make sure
I wasn't using it improperly.
Thanks again!
Original comment by stephen....@gmail.com
on 26 Mar 2013 at 2:22
In Guava 15
Original comment by be...@google.com
on 28 Mar 2013 at 3:55
Original comment by cpov...@google.com
on 28 Mar 2013 at 3:57
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<issue id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:12
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:08
Original issue reported on code.google.com by
stephen....@gmail.com
on 25 Mar 2013 at 7:16