J2EE tutorial (June 17 '04) servlet example compilation error
This is a copy of my previous post on the same topic, but this one has a more self-desriptive subject line. Apologies for duplication.
I am trying the first servlet example in the J2EE tutorial, June 17, 2004, pgs 443 - 448. I have completed all the steps as described. However, the URL results in the following error. I would like to point out that I am using the URL http://localhost:8081/bookstore1/bookstore (instead of port 8080 because the admin console suggests that port 8081 is an available http port):
Assistance would be appreciated.
HTTP Status 404 - /bookstore1/bookstore
type Status report
message /bookstore1/bookstore
description The requested resource (/bookstore1/bookstore) is not available.
Sun-Java-System/Application-Server-PE-8.0
I looked at the logviewer and there are 3 severe errors in the log:
1. Application Server
Log Entry Detail
Details
Timestamp: Aug 6, 2004 14:36:28.375
Log Level: SEVERE
Logger: javax.enterprise.system.container.web
Name-Value Pairs:
_ThreadID=12;
Record Number: 754
Message ID: WebModule[bookstore1]Exception sending context initialized event to listener instance of class listeners.ContextListener java.lang.NoClassDefFoundError
Complete Message
exception/OrderException
at listeners.ContextListener.contextInitialized(Unknown Source)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3679)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4140)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:873)
at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:171)
at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:855)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:623)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:947)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:729)
at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:147)
at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:224)
at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEventListener(AdminEventMulticaster.java:488)
at com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployEvent(AdminEventMulticaster.java:475)
at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:302)
at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:107)
at com.sun.enterprise.admin.server.core.mbean.config.ManagedServerInstance.multicastEvent(ManagedServerInstance.java:3880)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.enterprise.admin.server.core.jmx.Introspector.invokeMethodOn(Introspector.java:181)
at com.sun.enterprise.admin.server.core.mbean.config.AdminBase.invoke(AdminBase.java:86)
at com.sun.enterprise.admin.server.core.mbean.config.ConfigMBeanBase.invoke(ConfigMBeanBase.java:680)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:221)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:228)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:823)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:792)
at sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:54)
at $Proxy1.invoke(Unknown Source)
at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:282)
at com.sun.enterprise.deployment.phasing.DeploymentService.multicastEvent(DeploymentService.java:341)
at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:284)
at com.sun.enterprise.deployment.phasing.StartPhase.runPhase(StartPhase.java:115)
at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:74)
at com.sun.enterprise.deployment.phasing.DeploymentService.executePhases(DeploymentService.java:233)
at com.sun.enterprise.deployment.phasing.DeploymentService.deploy(DeploymentService.java:150)
at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.deploy(ApplicationsConfigMBean.java:275)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:287)
at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:280)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:221)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:228)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:823)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:792)
at sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:54)
at $Proxy1.invoke(Unknown Source)
at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:282)
at com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:38)
at com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(MBeanServerRequestHandler.java:92)
at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:69)
at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost(RemoteJmxConnectorServlet.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:768)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:289)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:205)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:102)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:192)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:156)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:569)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:261)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:215)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:156)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:583)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:569)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:200)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:156)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:180)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:582)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:134)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at com.sun.enterprise.security.web.SingleSignOn.invoke(SingleSignOn.java:254)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at com.sun.enterprise.web.VirtualServerValve.invoke(VirtualServerValve.java:209)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:569)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:161)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:156)
at com.sun.enterprise.web.VirtualServerMappingValve.invoke(VirtualServerMappingValve.java:166)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:569)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:979)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:692)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:647)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:691)
at java.lang.Thread.run(Thread.java:534)
2. Application Server
Log Entry Detail
Details
Timestamp: Aug 6, 2004 14:36:28.375
Log Level: SEVERE
Logger: tomcat.server./bookstore1.Context
Name-Value Pairs:
_ThreadID=12;
Record Number: 755
Message ID:
Complete Message
Error listenerStart
3. Application Server
Log Entry Detail
Details
Timestamp: Aug 6, 2004 14:36:28.375
Log Level: SEVERE
Logger: tomcat.server./bookstore1.Context
Name-Value Pairs:
_ThreadID=12;
Record Number: 756
Message ID:
Complete Message
Context startup failed due to previous errors
I had the same problem. It was caused by not including \j2eetutorial14\examples\web\bookstore\dist\bookstore.jar in the bookstore1.war. You may need to build the bookstore.jar file first if you haven�t already.
Similar Messages
-
[import javax.servlet.*;] Compilation error
Hi,
The java compiler cannot find javax.servlet.*; in Windows XP.
I tried copying servlet-api.jar under c:\sun\SDK\lib and c:\Sun\sdk\jdk\lib.
Also I set the CLASSPATH to:
.;C:\Sun\SDK\jdk\lib;C:\Sun\SDK\lib;
But I still get the error at compilation time.
Also I don't know how to create a project that would use the correct library and compile just that servlet code.
Many thanks for your help.Hi Xakep,
I have managed to compile the servlet, thanks to your help.
I have copied the servlet-api.jar under the directory C:\Sun\SDK\jdk\jre\lib
But in fact that was not enough if I chose to create a Java Project, because then the IDE is blind and can't see servlet-api.jar.
So I created a new project "Tomcat Project" and this time the .jar was visible, so I managed to build the servlet.class.
Also I wanted to compile from the command line so I used the classpath flag:
javac -classpath c:\sun\sdk\jdk\jre\lib\servlet-api.jar WelcomeServlet.javaMany thanks for your help -
Hi, I am a beginner picking up J2EE with the online tutorial. I tried to deploy,run,clean,build the hello1 and hello2 tutorial but netbeans is giving me an error as shown:
C:\Documents and Settings\Smith\My Documents\javaeetutorial5\examples\web\hello2\build.xml:37: Cannot find ../../bp-project/main.xml imported from C:\Documents and Settings\Smith\My Documents\javaeetutorial5\examples\web\hello2\build.xml
Anyone can help me with this error? I googled for similar errors but i did not find anything that could help.
I am using netbeans 6.7.1 and JDK 6 update 14.
Any help greatly appreciated.You seem to have installed two versions of the J2EE application server and are running the 1.3 tutorial on the 1.4 server.
You have two choices. If you want to use the 1.3 tutorial, please see the following workaround for this error:
http://java.sun.com/j2ee/tutorial/doc/information/faq.html#compile
A better option would be to download the 1.4 tutorial to run on the 1.4 server:
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html -
Getting a compilation error when deploying a web service to OC4J.
The following are the error that I got from Oracle AS server console:
[Feb 5, 2007 11:31:14 AM] Application Deployer for edsssaws STARTS.
[Feb 5, 2007 11:31:14 AM] Copy the archive to D:\product\10.1.3\OracleAS_1\j2ee\home\applications\edsssaws.ear
[Feb 5, 2007 11:31:14 AM] Initialize D:\product\10.1.3\OracleAS_1\j2ee\home\applications\edsssaws.ear begins...
[Feb 5, 2007 11:31:14 AM] Unpacking edsssaws.ear
[Feb 5, 2007 11:31:14 AM] Done unpacking edsssaws.ear
[Feb 5, 2007 11:31:14 AM] Unpacking edsssaws-web.war
[Feb 5, 2007 11:31:16 AM] Done unpacking edsssaws-web.war
[Feb 5, 2007 11:31:16 AM] Initialize D:\product\10.1.3\OracleAS_1\j2ee\home\applications\edsssaws.ear ends...
[Feb 5, 2007 11:31:16 AM] Starting application : edsssaws
[Feb 5, 2007 11:31:16 AM] Initializing ClassLoader(s)
[Feb 5, 2007 11:31:16 AM] Initializing EJB container
[Feb 5, 2007 11:31:16 AM] Loading connector(s)
[Feb 5, 2007 11:31:16 AM] Starting up resource adapters
[Feb 5, 2007 11:31:16 AM] Initializing EJB sessions
[Feb 5, 2007 11:31:16 AM] Committing ClassLoader(s)
[Feb 5, 2007 11:31:16 AM] Initialize edsssaws-web begins...
[Feb 5, 2007 11:31:16 AM] Initialize edsssaws-web ends...
[Feb 5, 2007 11:31:16 AM] Started application : edsssaws
[Feb 5, 2007 11:31:16 AM] Binding web application(s) to site default-web-site begins...
[Feb 5, 2007 11:31:16 AM] Binding edsssaws-web web-module for application edsssaws to site default-web-site under context root edsssaws
[Feb 5, 2007 11:31:35 AM] Operation failed with error: Error compiling :D:\product\10.1.3\OracleAS_1\j2ee\home\applications\edsssaws\edsssaws-web: compilation error occurred
I don't have any problem to build the webservice using oracle:assemble command in ant script, nor compilation error in the build time.
The error log shows as the following:
<MESSAGE>
<HEADER>
<TSTZ_ORIGINATING>2007-02-05T11:31:35.392-06:00</TSTZ_ORIGINATING>
<COMPONENT_ID>oc4j</COMPONENT_ID>
<MSG_TYPE TYPE="TRACE"></MSG_TYPE>
<MSG_LEVEL>16</MSG_LEVEL>
<HOST_ID>w2gzfdx801</HOST_ID>
<HOST_NWADDR>148.94.36.32</HOST_NWADDR>
<MODULE_ID>admin.jmx.client.EventManager</MODULE_ID>
<THREAD_ID>26</THREAD_ID>
<USER_ID>SYSTEM</USER_ID>
</HEADER>
<CORRELATION_DATA>
<EXEC_CONTEXT_ID><UNIQUE_ID>148.94.36.32:33615:1170696695392:16</UNIQUE_ID><SEQ>0</SEQ></EXEC_CONTEXT_ID>
</CORRELATION_DATA>
<PAYLOAD>
<MSG_TEXT>1 events to be dispatched for: oracle.oc4j.admin.management.mejb.MEjb@a8c31b and domain: oc4j-w2gzfdx801.amer.corp.eds.com-12401-default</MSG_TEXT>
</PAYLOAD>
</MESSAGE>
<MESSAGE>
<HEADER>
<TSTZ_ORIGINATING>2007-02-05T11:31:35.392-06:00</TSTZ_ORIGINATING>
<COMPONENT_ID>oc4j</COMPONENT_ID>
<MSG_TYPE TYPE="TRACE"></MSG_TYPE>
<MSG_LEVEL>1</MSG_LEVEL>
<HOST_ID>w2gzfdx801</HOST_ID>
<HOST_NWADDR>148.94.36.32</HOST_NWADDR>
<MODULE_ID>admin.jmx.client.CoreRemoteMBeanServer</MODULE_ID>
<THREAD_ID>26</THREAD_ID>
<USER_ID>SYSTEM</USER_ID>
</HEADER>
<CORRELATION_DATA>
<EXEC_CONTEXT_ID><UNIQUE_ID>148.94.36.32:33615:1170696695392:16</UNIQUE_ID><SEQ>0</SEQ></EXEC_CONTEXT_ID>
</CORRELATION_DATA>
<PAYLOAD>
<MSG_TEXT>Dispatching event type: deploy.edsssaws and message: Application Deployer for edsssaws FAILED. to listener with id: 0 on MBeanServer proxy: oracle.oc4j.admin.management.mejb.MEjb@a8c31b</MSG_TEXT>
</PAYLOAD>
</MESSAGE>
<MESSAGE>
<HEADER>
<TSTZ_ORIGINATING>2007-02-05T11:31:35.392-06:00</TSTZ_ORIGINATING>
<COMPONENT_ID>oc4j</COMPONENT_ID>
<MSG_TYPE TYPE="ERROR"></MSG_TYPE>
<MSG_LEVEL>1</MSG_LEVEL>
<HOST_ID>w2gzfdx801</HOST_ID>
<HOST_NWADDR>148.94.36.32</HOST_NWADDR>
<MODULE_ID>admin.deploy.spi.status.ProgressObjectImpl</MODULE_ID>
<THREAD_ID>26</THREAD_ID>
<USER_ID>SYSTEM</USER_ID>
</HEADER>
<CORRELATION_DATA>
<EXEC_CONTEXT_ID><UNIQUE_ID>148.94.36.32:33615:1170696695392:16</UNIQUE_ID><SEQ>0</SEQ></EXEC_CONTEXT_ID>
</CORRELATION_DATA>
<PAYLOAD>
<MSG_TEXT>java.lang.InstantiationException: Error compiling :D:\product\10.1.3\OracleAS_1\j2ee\home\applications\edsssaws\edsssaws-web: compilation error occurred</MSG_TEXT>
<SUPPL_DETAIL><![CDATA[oracle.oc4j.admin.jmx.shared.exceptions.InternalException: java.lang.InstantiationException: Error compiling :D:\product\10.1.3\OracleAS_1\j2ee\home\applications\edsssaws\edsssaws-web: compilation error occurred
at oracle.oc4j.admin.jmx.shared.deploy.NotificationUserData.<init>(NotificationUserData.java:107)
at oracle.oc4j.admin.internal.Notifier.reportError(Notifier.java:429)
at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:123)
at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)
at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:819)
at java.lang.Thread.run(Thread.java:595)
Caused by: oracle.oc4j.admin.internal.DeployerException: java.lang.InstantiationException: Error compiling :D:\product\10.1.3\OracleAS_1\j2ee\home\applications\edsssaws\edsssaws-web: compilation error occurred
at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:214)
at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:96)
at oracle.oc4j.admin.internal.ApplicationDeployer.bindWebApp(ApplicationDeployer.java:541)
at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:197)
at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
... 4 more
Caused by: java.lang.InstantiationException: Error compiling :D:\product\10.1.3\OracleAS_1\j2ee\home\applications\edsssaws\edsssaws-web: compilation error occurred
at com.evermind.server.http.WrapperClassGenerator.generateWebServiceArts(WrapperClassGenerator.java:98)
at com.evermind.server.http.HttpApplication.generateWebServiceArtifacts(HttpApplication.java:8403)
at com.evermind.server.http.HttpApplication.populateLoaderWithWebServicesDeploymentCache(HttpApplication.java:5465)
at com.evermind.server.http.HttpApplication.populateLoader(HttpApplication.java:5394)
at com.evermind.server.http.HttpApplication.initClassLoader(HttpApplication.java:5333)
at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:645)
at com.evermind.server.ApplicationStateRunning.getHttpApplication(ApplicationStateRunning.java:428)
at com.evermind.server.Application.getHttpApplication(Application.java:512)
at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.createHttpApplicationFromReference(HttpSite.java:1975)
at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.<init>(HttpSite.java:1894)
at com.evermind.server.http.HttpSite.addHttpApplication(HttpSite.java:1591)
at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:206)
... 8 more
]]></SUPPL_DETAIL>
</PAYLOAD>
</MESSAGE>
Any idea why it happened?
Thanks,
JasonHello,
I do not see why you have this error, is it the only log entry that you have? Anything in the application.log?
Can you send me the ear? tugdual [dot] grall [at] oracle [dot] com
Regards
Tugdual Grall -
WebServices: compilation error occurred
Created a webservice from a java class. The method that i am exposing in the webservice takes a java object (Serializable) as input and gives another java object (Serializable) as output.I am creating webservice from JDeveloper. While i am creating webservice from JDeveloper, While Specifying Custom Data Type Serializers, i have two xsds one for input object and one for output object. After creating the webservice if i try to deploy my webservice, it gives me an error
Error compiling :C:\product\10.1.3.1\OracleAS_1\j2ee\home\applications\ObjectJava-MyEmpJavaProj-WS\WebServices: compilation error occurred
and there is no further info on this. How can resolve this? any ideas?I'm having the same problem except I used a top-down approach and created the web service from the WSDL. I go to deploy the web service and then I get the error:
Binding WebServices web-module for application {"application directory"} to site default-web-site under context root {"context-root"}
Operation failed with error:
Error compiling :C:\product\10.1.3.1\OracleAS_1\j2ee\home\applications\{"application directory"}\WebServices: compilation error occurred
I'm assuming this refers to the .war file since that is what the \WebServices points to but I haven't been able to figure out what Oracle JDeveloper is having problems compiling.
Thanks! -
"asant build" for bookstore1 example in j2ee tutorial gives "compile error"
Hello everybody,
I am trying to run "asant build" command to build package for bookstore1 example given in j2ee tutorials.
I installed my j2ee tutorial 1.4 in "c:\java\j2eetutorial14" and my example is in "c:\java\j2eetutorial\examples\web\bookstore1".
My j2ee SDK with appliation server is installed in C:\sun\appserver.
When i run the "asant build" command in "c:\java\j2eetutorial\examples\web\bookstore1" directory i get compile error with last few lines as follows.
[javac] location: class servlets.ShowCartServlet
[javac] } catch (BookNotFoundException ex) {
[javac] ^
[javac] C:\Java\j2eetutorial14\examples\web\bookstore1\src\servlets\ShowCartServlet.jav
:136: cannot resolve symbol
[javac] symbol : class ShoppingCartItem
[javac] location: class servlets.ShowCartServlet
[javac] ShoppingCartItem item = (ShoppingCartItem) i.next();
[javac] ^
[javac] C:\Java\j2eetutorial14\examples\web\bookstore1\src\servlets\ShowCartServlet.jav
:136: cannot resolve symbol
[javac] symbol : class ShoppingCartItem
[javac] location: class servlets.ShowCartServlet
[javac] ShoppingCartItem item = (ShoppingCartItem) i.next();
[javac] ^
[javac] C:\Java\j2eetutorial14\examples\web\bookstore1\src\servlets\ShowCartServlet.jav
:137: cannot resolve symbol
[javac] symbol : class BookDetails
[javac] location: class servlets.ShowCartServlet
[javac] bd = (BookDetails) item.getItem();
[javac] ^
[javac] 69 errors
BUILD FAILED
file:C:/Java/j2eetutorial14/examples/web/bookstore1/build.xml:68: Compile failed; see the compiler error output for details.
Total time: 2 seconds
Can some one please help me.
thanksWhen i run the "asant build" command in
"c:\java\j2eetutorial\examples\web\bookstore1"
directory i get compile error with last few lines as
follows.Did you package the bookstore common files as described in Chapter 3? My guess is that you didn't include bookstore.jar from <INSTALL>/j2eetutorial14/examples/build/web/bookstore/dist/.
-Ian Evans
Sun Microsystems
J2EE Tutorial team -
Error when compiling the J2ee tutorial source files on win2k professional
Hi,
Could you help me?
I'm trying to complete the j2ee tutorial.
I have downloaded the example code, J2EE Sdk, J2SE and Ant from the web site (these files� name are: j2ee-1_3-doc-tutorial-draft3.zip, j2sdkee-1_3_01-win.exe, j2sdk-1_3_1_01-win.exe, jakarta-ant-1.3-bin.zip) and installed the �j2sdkee-1_3_01-win.exe, j2sdk-1_3_1_01-win.exe� and unzipped �j2ee-1_3-doc-tutorial-draft3.zip, jakarta-ant-1.3-bin.zip� to their default subdirectory.( jdk1.3.1_01,
j2sdkee1.3,jakarta-ant-1.3)
According to instructions, I have set the Environment Variables as the below:
ANT_HOME=c:\jakarta-ant-1.3
CLASSPATH=c:\sybtools\ASEP\Monclass.zip;c:\sybtools\ASEP\3pclass.zip;c:\program files\microsoft sql server 2000 jdbc\lib\mssqlserver.jar;c:\program files\microsoft sql server 2000 jdbc\lib\msbase.jar;c:\program files\microsoft sql server 2000 jdbc\lib\msutil.jar;c:\orcle\ora81\jdbc\lib\classes12.zip; c:\orcle\ora81\jdbc\lib\nls_charset12.zip;c:\program files\oracle\jdevelop 3.2.3\jdbc\lib\oracle8.1.7\classes12.zip;c:\j2sdkee1.3\lib\j2ee.jar;c:\jdk1.3.1_01\lib\tools.jar;c:\jdk1.3.1_01\lib\classes.zip;c:\jakarta-ant-1.3\lib\ant.jar
HOMEPATH=\
J2EE_HOME=c:\j2sdkee1.3
JAVA_HOME=c:\jdk1.3.1_01
OS=Windows_NT
Os2LibPath=C:\WINNT\system32\os2\dll;
Path=C:\oracle\ora81\bin;C:\oracle\ora81\Apache\Perl\5.00503\bin\mswin32-x86;C:\Program Files\Oracle\jre\1.1.7\bin;C:\PROGRA~1\REFLEC~1;C:\Program Files\Reflection;C:\WINNT\SYSTEM32;C:\WINNT;C:\WINNT\SYSTEM32\WBEM;C:\DMI\WIN32\BIN;C:\Program Files\Symantec\pcAnywhere\;C:\MSSQL7\BINN;C:\Sybase\DLL;C:\Sybase\BIN;C:\sybtools\WIN32;C:\sybtools\ASEP;c:\oracle\ora81\jdbc\lib;c:\j2sdkee1.3\bin;c:\jdk1.3.1_01\bin;c:\jakarta-ant-1.3\bin
SystemRoot=C:\WINNT
windir=C:\WINNT
�
After finishing the above actions, I have started the j2ee server and deploytools successfully. But when I executed the following command( ANT CONVERTER ) under the appointed subdirectory, the error occurred.
The information is
�Exception in thread �main� java.lang.NoClassDefFoundError: files\Microsoft �.
Looking forward to the answer!
Arthur Ward
2001-12-21by the way, after checking the ant_home\bin\ant.bat(see bellow)
-------end quote----
@echo off
if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"
if not "%OS%"=="Windows_NT" goto win9xStart
:winNTStart
@setlocal
rem %~dp0 is name of current script under NT
set DEFAULT_ANT_HOME=%~dp0
rem : operator works similar to make : operator
set DEFAULT_ANT_HOME=%DEFAULT_ANT_HOME:\bin\=%
if %ANT_HOME%a==a set ANT_HOME=%DEFAULT_ANT_HOME%
set DEFAULT_ANT_HOME=
rem On NT/2K grab all arguments at once
set ANT_CMD_LINE_ARGS=%*
goto doneStart
:win9xStart
rem Slurp the command line arguments. This loop allows for an unlimited number of
rem agruments (up to the command line limit, anyway).
set ANT_CMD_LINE_ARGS=
:setupArgs
if %1a==a goto doneStart
set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
shift
goto setupArgs
:doneStart
rem This label provides a place for the argument list loop to break out
rem and for NT handling to skip to.
rem find ANT_HOME
if not "%ANT_HOME%"=="" goto checkJava
rem check for ant in Program Files on system drive
if not exist "%SystemDrive%\Program Files\ant" goto checkSystemDrive
set ANT_HOME=%SystemDrive%\Program Files\ant
goto checkJava
:checkSystemDrive
rem check for ant in root directory of system drive
if not exist "%SystemDrive%\ant" goto noAntHome
set ANT_HOME=%SystemDrive%\ant
goto checkJava
:noAntHome
echo ANT_HOME is not set and ant could not be located. Please set ANT_HOME.
goto end
:checkJava
set _JAVACMD=%JAVACMD%
set LOCALCLASSPATH=%CLASSPATH%
for %%i in ("%ANT_HOME%\lib\*.jar") do call "%ANT_HOME%\bin\lcp.bat" "%%i"
if "%JAVA_HOME%" == "" goto noJavaHome
if "%_JAVACMD%" == "" set JAVACMD=%JAVAHOME%\bin\java
if exist "%JAVA_HOME%\lib\tools.jar" call "%ANT_HOME%\bin\lcp.bat" "%JAVA_HOME%\lib\tools.jar"
if exist "%JAVA_HOME%\lib\classes.zip" call "%ANT_HOME%\bin\lcp.bat"
"%JAVA_HOME%\lib\classes.zip"
goto checkJikes
:noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=java
echo.
echo Warning: JAVA_HOME environment variable is not set.
echo If build fails because sun.* classes could not be found
echo you will need to set the JAVA_HOME environment variable
echo to the installation directory of java.
echo.
:checkJikes
if not "%JIKESPATH%" == "" goto runAntWithJikes
:runAnt
%_JAVACMD% -classpath %LOCALCLASSPATH% -Dant.home="%ANT_HOME%" %ANT_OPTS%
org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS%
goto end
:runAntWithJikes
%_JAVACMD% -classpath %LOCALCLASSPATH% -Dant.home="%ANT_HOME%" -Djikes.class.path=%JIKESPATH%
%ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS%
:end
set LOCALCLASSPATH=
set _JAVACMD=
set ANT_CMD_LINE_ARGS=
if not "%OS%"=="Windows_NT" goto mainEnd
:winNTend
@endlocal
-------end quote----
i found something is wrong with the sentence in ":runAnt".
--------quote-----
%_JAVACMD% -classpath %LOCALCLASSPATH% -Dant.home="%ANT_HOME%" %ANT_OPTS%
org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS%
--------end quote-----
No value was set for %ANT_OPTS% and %ANT_CMD_LINE_ARGS% -
Error when executing EJB example in J2EE Tutorial
Hi,
I am trying Converter example in J2EE tutorial.
I have created ConverterJAR and ConverterWAR
ConverterJAR is verified sucessfully when using verifier option
When verifying ConverterWAR i am getting the following error
Error: Class [ converter.ConverterHome ] not found in WEB-INF/classes or WEB-INF/lib.
For [ /ConverterWAR ]
Error: class [ converter.ConverterHome ] cannot be found within this jar [ war-ic.war ].
Error: Class [ converter.Converter ] not found in WEB-INF/classes or WEB-INF/lib.
For [ /ConverterWAR ]
Error: class [ converter.Converter ] cannot be found within this jar [ war-ic.war ].
Please let me know if anybody aware of this problemI have created ConverterJAR and ConverterWAR
ConverterJAR is verified sucessfully when using
verifier option
When verifying ConverterWAR i am getting the
following errorCreate an EJB-client JAR which will contain only the home and remote interfaces. Place it in WEB-INF/lib of your webapp and recreate your WAR. This should solve the problem. :)
$ -
Error when compiling the J2ee tutorial source files
HI,
I have installed ant, j2ee tomcat-3.2.2 and jdk1.3 and when i tried to compile the source file downloaded from java.sun by
ant converter, it prompted
"Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/main"
I am running it on win98 with the autoexec.bat containing the followings:
set J2EE_HOME=c:\j2sdkee1.3
set JAVA_HOME=c:\jdk1.3.1
set ANT_HOME=c:\jakarta-ant-1.3
set TOMCAT_HOME=c:\tomcat\jakarta-tomcat-3.2.2
set classpath=;.;c:\jdk1.3.1\jre\lib\rt.jar;c:\j2sdkee1.3\lib\j2ee.jar;c:\jaxp\xalan.jar;c:\jaxp\crimson.jar;c:\jaxp\jaxp.jar;c:\C:\jakarta-ant-1.3\lib\ant.jar;C:\jakarta-ant-1.3\lib\jaxp.jar;C:\jakarta-ant-1.3\lib\parser.jar
PATH=%PATH%;"C:\Program Files\Mts";C:\PROGRA~1\ULTRAE~1;c:\jdk1.3.1\bin;c:\j2sdkee1.3\bin;c:\jakarta-ant-1.3\bin;C:\PROGRA~1\MICROS~4\80\TOOLS\BINN
Really thx for help !!!!Hi.
I am compiling the sample converter.ear downloaded from
the j2ee tutorial bundle form java.sun. I am using jakarta-ant-1.4alpha-bin.zip downloaded from jakarta
oh..yes it should be org.apache.tools.ant.Main ....sorryfor typo.....
look forward to any helpful reply -
J2ee tutorial bookstore2 example - again
Folks,
I've been trying to run the bookstore2 example of the j2ee tutorial.
When I click on the start shopping link nothing happens.
I found this in the server.log file
[#|2005-05-11T11:26:22.353+0100|WARNING|sun-appserver-pe8.1|javax.enterprise.system.stream.err|_ThreadID=18;|
org.apache.jasper.JasperException: /bookcatalog.jsp(39,2) The end tag "</c:forEach" is unbalanced
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:43)
I have tried to fix this and redeploy the application but I continue to get the same error. Obviously I am not deploying this correctly. Can someone tell me the steps involved? Thanks?
Here is the offending code.
<c:if test="${!empty param.Add}">
<c:set var="bid" value="${param.Add}"/>
<jsp:setProperty name="bookDB" property="bookId" value="${bid}" />
<c:set var="addedBook" value="${bookDB.bookDetails}" />
<p><h3><font color="red" size="+2">
<fmt:message key="CartAdded1"/> <em>${addedBook.title}</em> <fmt:message key="CartAdded2"/></font></h3>
</c:forEach>
</c:if>Somehow you accidentally added an incorrect tag. That section should be:
<c:if test="${!empty param.Add}">
<c:set var="bid" value="${param.Add}"/>
<jsp:setProperty name="bookDB" property="bookId" value="${bid}" />
<c:set var="addedBook" value="${bookDB.bookDetails}" />
<p><h3><font color="red" size="+2">
<fmt:message key="CartAdded1"/> <em>${addedBook.title}</em> <fmt:message key
="CartAdded2"/></font></h3>
</c:if>
That is, remove the </c:forEach>.
-Ian Evans -
How to use ant1.3 in Wndows ME to build the examples in J2EE Tutorial?
When I tried to build the examples bundled with j2ee tutorial in the ..\j2eetutorial\examples directory using the ant 1.3 on Wndows ME I get the following exception.Anybody please help me.Is there any other build tool available for download?
StringIndexOutOfboundsException
D:\JAVATUTORIAL\J2EE\j2eetutorial\examples> ant -verbose all
Ant version 1.3 compiled on March 2 2001
Buildfile: build.xml
Detected Java Version: 1.3
Detected OS: Windows Me
parsing buildfile D:\JAVATUTORIAL\J2EE\j2eetutorial\examples\build.xml with URI
= file:D:/JAVATUTORIAL/J2EE/j2eetutorial/examples/build.xml
Project base dir set to: D:\JAVATUTORIAL\J2EE\j2eetutorial\examples
Build sequence for target `all' is [init, savingsaccount, bank, cart, checker, c
onfirmer, converter, enroller, order, salesrep, storagebin, teller, htmlreader,
warehouse, simplemessage, cmproster, ejb, date, hello1, hello2, bookstore1, web-
ejb, bookstore2, bookstore3, web, all]
Complete build sequence is [init, savingsaccount, bank, cart, checker, confirmer
, converter, enroller, order, salesrep, storagebin, teller, htmlreader, warehous
e, simplemessage, cmproster, ejb, date, hello1, hello2, bookstore1, web-ejb, boo
kstore2, bookstore3, web, all, create-storagebin-table, get-cci-jar, procs, cci,
connector, create-salesrep-table, create-procs-alias, create-coffee-table, abou
t, create-enroller-table, create-savingsaccount-table, create-web-db, create-war
ehouse-table, create-bank-table, clean, create-order-table, create-teller-table,
prepare, create-ejb-db]
init:
[property] Loading Environment myenv.
BUILD FAILED
D:\JAVATUTORIAL\J2EE\j2eetutorial\examples\build.xml:19: D:\JAVATUTORIAL\J2EE\j2
eetutorial\examples\build.xml:19: java.lang.StringIndexOutOfBoundsException: Str
ing index out of range: -1
--- Nested Exception ---
D:\JAVATUTORIAL\J2EE\j2eetutorial\examples\build.xml:19: java.lang.StringIndexOu
tOfBoundsException: String index out of range: -1
--- Nested Exception ---
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1476)
at org.apache.tools.ant.taskdefs.Property.loadEnvironment(Property.java:
248)
at org.apache.tools.ant.taskdefs.Property.execute(Property.java:172)
at org.apache.tools.ant.Target.execute(Target.java:153)
at org.apache.tools.ant.Project.runTarget(Project.java:898)
at org.apache.tools.ant.Project.executeTarget(Project.java:536)
at org.apache.tools.ant.Project.executeTargets(Project.java:510)
at org.apache.tools.ant.Main.runBuild(Main.java:421)
at org.apache.tools.ant.Main.main(Main.java:149)
Total time: 2 seconds
D:\JAVATUTORIAL\J2EE\j2eetutorial\examples>
*********************************************************************Please Help Me
-
Run client execution problem when running Sun J2EE tutorial example
Hi,
I'm trying to run the Sun J2EE tutorial example, CartApp.
When come to run the client application I got the following error:
The command:
E:\Dev\src\J2EE_J2EE_tutorial\examples\ears>runclient -client CarApp.ear -name CartClient -textauth
The error:
Application threw an exception:java.io.IOException: CarApp.ear does not exist
The deployment complete without error.
I tried to the the APPCPATH to :
set APPCPATH=E:\Dev\src\J2EE_J2EE_tutorial\examples\ears\CartAppClient.jar
set APPCPATH=CartAppClient.jar
On both set, it gave the same error above.
Did someone known the problem I have ?
Thnakshi ,
I think u have given other disply name to your J2EE client ,
Anyway check disply name of J2EE client through deploytool.
u have to use that display name to access the j2ee client .
suppose ur j2ee client displyname is testclient, u can use:
runclient -client ConverterApp.ear -name testclient
hope this will help u,
babu. -
Running examples from J2EE Tutorial
Has anyone been successfully running examples from
J2EE Tutorial on Creator?
I tried to import the JSP but Creator complains that it is
not an XHTML document. Clicking on the 'Convert to XHTML'
button or 'Preview...' button does not seem to do anything.
Openning the Source panel shows parsing problems on
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
Does anyone know how to run these in Creator correctly?
- weijyhYes,
It runs successfully....
I have download the examples from Sun,
unzipped It into my Projektfolder and open it in Creator, start it and works fine ...
No error messages .... -
Am getting the following error while running the servlet example
Hi,
am getting the following error while running the servlet example
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.NullPointerException
edu.dao.StudentDao.insertStudent(StudentDao.java:18)
edu.servlet.StudentServlet.doGet(StudentServlet.java:25)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.
Thanks
//sreekanthHi,
the following code i have written in StudentDao
package edu.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import org.apache.commons.dbutils.DbUtils;
import edu.model.Student;
import edu.util.DBUtil;
public class StudentDao {
public void insertStudent(Student student) {
String stuQuery = "INSERT INTO STUDENT VALUES(?,?)";
Connection connection = DBUtil.getConnection();
PreparedStatement preparedStatement = null;
try {
preparedStatement = connection.prepareStatement(stuQuery);
preparedStatement.setString(1,student.getStudentNo());
preparedStatement.setString(2, student.getStudentName());
preparedStatement.executeUpdate();
} catch(SQLException e){
System.out.println("..Sql exception......");
}finally {
DbUtils.closeQuietly(connection,preparedStatement,null);
} -
Hi All,
I am getting this error at this step of tutorial. Please help.
To apply the workflow to the Product of the Day page:
1.Open the Product of the Day page in edit mode. If the page is still open from a previous procedure, reload it.
2. In Sidekick, click the Workflow tab and select the Product of the Day workflow. Click Start Workflow.
3. Open the Inbox page. (http://localhost:4502/libs/cq/workflow/content/inbox.html)
4. Select the Step 1 item for the Product of the Day content, and click Open.The form1 page opens.
At this step i am getting the below error.
javax.servlet.ServletException: javax.servlet.jsp.JspException: Error while executing script body.jsp
Please helpNot sure which workflow tutorial you are reffering. The stack trace in log should tell you what is exactly wrong.
Maybe you are looking for
-
Dropdown menu in APEX 4.0
Hi, I am wondering how to create the Dropdown menu in APEX 4.0. Similar to the Oracle Application Express Homepage or the one gets created in any Websheet Application. I have tried to use the List but unable to place into the right position (Display
-
JRE version requirement for browser based Webtop connections ?
I've been looking but I can't see a documented require version number for JRE for SGD browser webtop connections. Can anyone point me in the direction of something that says 'must use JRE 1.5 or higher' or something like that ? Edited by: Slimm on Fe
-
Coherence "out of process" topology question
Hi, We consider using Coherence as a distributed cache (messaging) in out product As far as I can understand from Coherence's whitepapers the only option to use an out of process cache (a dedicated process for the coherence ) Is by using Coherence*We
-
How to create a button on icon shape?
i have a requirement that when i put the icon on button then the button will take the icon shape. i need to create buttons for icons shape. suppose i have star image icon so button will be of star shape, if icon is of triangle or arc shape then butto
-
Problems with downloading the ipod software...please help!
I am trying to reinstall my ipod software through the CD that was sent to me however, whenever I'm trying to do so, a window pops up saying the following: 1607: Unable to install InstallShield Scripting Runtime. Now I have no idea what that means and