This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 12101 - Server executor does not enhance classes, that reside in a web module, for persistence-capability
Summary: Server executor does not enhance classes, that reside in a web module, for pe...
Status: CLOSED INVALID
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: PC Windows 3.1/NT
: P3 blocker (vote)
Assignee: issues@javaee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-05-11 07:08 UTC by John Baker
Modified: 2001-07-20 20:36 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Baker 2001-05-11 07:08:13 UTC
A bug report had been entered against the TP module, which is now closed
in favor of this enhancement request. 
Please see some comments about this issue at the bottom of this description.

I am attempting to update the Boston CDShopCart application. In Boston, the TP
classes were enhanced into a jar, and the original classes had to be removed
before the app would run reliably. When customers looked at the supplied
example, they were not able to examine the TP classes. For Pilsen, we wanted to
leave the TP classes under the WEB-INF/classes directory, so the user could
examine them. When I removed the CDclasses.jar file, generated TP classes from
dbschema into the WEB-INF/classes directory, modified CheckOutBean so it would
compile with the new name scheme, and executed the app, I get the following
error:
Location: /PlaceOrder.jsp

Internal Servlet Error:

javax.servlet.ServletException: Class Sequence has not been enhanced for
Transparent Persistence. Use the IDE's JAR or WAR packager to package your
persistence-capable classes before running. Or, set the Executor property on the
main class to Persistence Executor to run from the IDE.
        at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
        at
_0002fPlaceOrder_0002ejspPlaceOrder_jsp_2._jspService(_0002fPlaceOrder_0002ejspPlaceOrder_jsp_2.java:152)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
        at
org.netbeans.modules.web.tomcat.JspServlet.service(JspServlet.java:88)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
        at org.apache.tomcat.core.Handler.service(Handler.java:286)
        at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
        at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
        at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
        at java.lang.Thread.run(Thread.java:484)

Root cause: 

com.sun.forte4j.persistence.JDOFatalUserException: Class Sequence has not been
enhanced for Transparent Persistence. Use the IDE's JAR or WAR packager to
package your persistence-capable classes before running. Or, set the Executor
property on the main class to Persistence Executor to run from the IDE.
NestedException: java.lang.NoSuchMethodException: 
        at
com.sun.forte4j.persistence.internal.runtime.jdo.PersistenceManagerImpl.newInstance(PersistenceManagerImpl.java:749)
        at
com.sun.forte4j.persistence.internal.runtime.core.SqlResultDesc.setFields(SqlResultDesc.java:188)
        at
com.sun.forte4j.persistence.internal.runtime.core.SqlResultDesc.getResult(SqlResultDesc.java:153)
        at
com.sun.forte4j.persistence.internal.runtime.core.SqlStore.select(SqlStore.java:1221)
        at
com.sun.forte4j.persistence.internal.runtime.core.SqlStore.retrieve(SqlStore.java:1040)
        at
com.sun.forte4j.persistence.internal.runtime.jdo.PersistenceManagerImpl.retrieve(PersistenceManagerImpl.java:767)
        at
com.sun.forte4j.persistence.internal.query.QueryImpl.executeWithArray(QueryImpl.java:496)
        at
com.sun.forte4j.persistence.internal.query.QueryImpl.execute(QueryImpl.java:411)
        at CheckOutBean.getSequenceNumber(CheckOutBean.java:99)
        at CheckOutBean.checkout(CheckOutBean.java:63)
        at
_0002fPlaceOrder_0002ejspPlaceOrder_jsp_2._jspService(_0002fPlaceOrder_0002ejspPlaceOrder_jsp_2.java:123)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
        at
org.netbeans.modules.web.tomcat.JspServlet.service(JspServlet.java:88)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
        at org.apache.tomcat.core.Handler.service(Handler.java:286)
        at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
        at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
        at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
        at java.lang.Thread.run(Thread.java:484)


Comments about this issue:

Classes get enhanced for persistence-capability when a jar or WAR file is
created or the PersistenceExecutor is used.

So, if an explicit deployment with a WAR file (via the server plugins)
is anticipated it is OK to have unenhanced classes in the WEB-INF/classes
directory, since they get enhanced on creation of the WAR file.

The option of directly executing a JSP with the ServerExecutor on
unenhanced classes in the WEB-INF/classes directory is not available.
Comment 1 Jesse Glick 2001-05-11 12:49:52 UTC
I presume this stuff was intended for the web module, whatever it is.
Comment 2 Petr Jiricka 2001-05-13 15:31:29 UTC
The definition of "server execution" (for Tomcat, at least) is such that files 
on the filesystem are just passed to the server, not requiring any additional 
steps such as packaging, enhancement etc. This enables a quick preview of web 
applications. Without this feature, the behavior of the IDE would be less 
convenient to use than using e.g. just a server and a text editor, so the IDE 
wouldn't really be of much help to the user. For this reason, the execution 
step can not enhance the classes for transparent persistence.

The solution should be to assure that classes are enhanced before execution, 
for example during the compilation step of a TP class. (BTW, this is also the 
approach used for RMI, and this approach makes interoperation of RMI and web 
apps seamless).

Comment 3 Marek Fukala 2001-07-16 12:39:08 UTC
See Petr's comment above.