Same package between two jars

A

aaronfude

Hello,

I always thought that it was possible for two diffirent jars to
contribute classes to the same package.

I have been doing that successfully, but now, on one of our machines
running tomcat, we are getting the following error for a class in a
"split" package.

(Does it make any difference if the jars are signed?)

root cause

java.lang.SecurityException: html/Feel$Head
org.apache.jsp.ErrorPage_jsp._jspService(org.apache.jsp.ErrorPage_jsp:
118)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:
703)

org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:
670)

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:
818)

org.apache.jasper.runtime.PageContextImpl.handlePfageException(PageContextImpl.java:
791)
org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:149)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Thank you very much in advance!

AF
 
T

Tom Hawtin

I always thought that it was possible for two diffirent jars to
contribute classes to the same package.

I have been doing that successfully, but now, on one of our machines
running tomcat, we are getting the following error for a class in a
"split" package.

What did you change? Can you reproduce that change with a minimal
example? Are you sure you have an up to date, consistent copy of everything.
(Does it make any difference if the jars are signed?)

There are a few rules.

Classes loaded by different class loaders are effectively in different
packages for access purposes, even though they can share the same
'namespace'.

The signers of all class in a package loaded by one class loader must be
the same.

Packages may be sealed, so that all classes must come that one JAR.

Random other restrictions that the container might wish to impose. For
instance Java WebStart requires that all jars loaded by the same jnlp
file have the same signer.

Tom Hawtin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top