We're getting errors in our JSP compiles "ambiguous class:
package1.exc_norowsfound and package2.exc_norowsfound" etc. We have a common
PB library that all packages use - ancestors etc. We've put in there some
common exception objects (e.g. exc_norowsfound and
exc_mandatoryfieldmissing). When we generate stubs for the components, it
generates the class files for the exceptions in that package - and each
package.
Trouble is, we have a JSP page that calls a component in each of the two
packages, so we have import statements at the top of the JSP file to import
package1.* and package2.* - to import the stubs (and exception). There's the
issue and hence the error; there's two classes of the same name; the common
exception we put in our common PBL !
So, how does one do this (common exception object in a common ancestor PBL)?
Should you not, and have different names for all your exceptions?
Thoughts appreciated!
Regs
Rob
Why not import the classes you use from those packages individually, instead of
using the .* form, and only import the exception from the package that's
relevant?
If you do need to use the exception from both packages (e.g. you're calling
components in both packages and their interfaces each say they throw the one
from their package) then don't import either exception and use the fully
qualified names insead. Make sure you catch the right one each time or you'll
probably get ClassCastExceptions.
Andrew.
Regs
Rob
"Andrew Stevens" <at...@hotmail.com> wrote in message
news:fJEAzUQ...@forums.sybase.com...
You already knows this but I never recommend doing the .* technique.
Can only cause you issues - as you found. Just a lazy way out<g>
Mark