aspose file tools*
The moose likes JSP and the fly likes IllegalAccessException when creating object instance in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "IllegalAccessException when creating object instance in jsp" Watch "IllegalAccessException when creating object instance in jsp" New topic
Author

IllegalAccessException when creating object instance in jsp

DC Dalton
Ranch Hand

Joined: May 28, 2001
Posts: 287
Hey all, Im attempting a quick jsp page (I usually do 100% servlets) and am getting this exception when I try to make an instance of an object that is in my classes folder:

500 Servlet Exception

java.lang.IllegalAccessError: tried to access method ProductRotator.<init>()V
from class _index__jsp
at _index__jsp._jspService(/index.jsp:114)
at com.caucho.jsp.JavaPage.service(JavaPage.java:87)
at com.caucho.jsp.JavaPage.subservice(JavaPage.java:81)
at com.caucho.jsp.Page.service(Page.java:398)
at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:166)
at com.caucho.server.http.Invocation.service(Invocation.java:272)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:128)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:216)
at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:158)
at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
at java.lang.Thread.run(Thread.java:534)

I have done an import that works fine but this keeps happening one this code:

ProductRotator pr = new ProductRotator();

As I said Im not much of a jsp page guy but this site demands it & Im at a loss .... any help would be greatly appreciated!
Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327
Are you sure that your ProductRotator class has a public no argument constructor?
DC Dalton
Ranch Hand

Joined: May 28, 2001
Posts: 287
OH, I have been working WAY too long today (major deadline) sure enough the constructor was package protected .... all good now!

As always this place RULES ... now lets see if I can get the rest of this thing done before my brain melts! Thanks a TON!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IllegalAccessException when creating object instance in jsp