CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Java

 problems with compiling CCS 3.0 and JDK 1.5 configuration

Print topic Send  topic

Author Message
greenoh

Posts: 7
Posted: 03/19/2007, 8:58 AM

I just want to configure and test our Code Charge Studio using JSP, Apache TomCat 6.0 JDK 1.5. I'm running TC 6.0 on the same PC with CCS 3.0.

I setup environmentals for ANT_HOME, CATALINA_HOME, and set my class path to tom cat 6.0 lib\servlet-api.jar.

I'm using 1st the tutorial example in the quick start tutorial. I getting the following error.
Can someone tell me what version 49.0 vs. 48.0 means?

output***************************************************
Generating "Helloworld"
Generating Common Files
call "C:\Program Files\netbeans-5.0\ide6\ant\bin\ant.bat" -buildfile "C:\DOCUME~1\msuser\LOCALS~1\Temp\~HelloWorld\CCSBuild\build.xml" -logfile "C:\DOCUME~1\msuser\LOCALS~1\Temp\~HelloWorld\CCSBuild\build.log"
=======================================
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.5.0_09\lib\tools.jar
Apache Ant version 1.6.5 compiled on June 2 2005
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.5.0_09\lib\tools.jar
Buildfile: C:\DOCUME~1\msuser\LOCALS~1\Temp\~HelloWorld\CCSBuild\build.xml
init:
[echo] ServletTemplates build: 3.0.0209

check.servlet.lib:

compile:
[mkdir] Created dir: C:\DOCUME~1\msuser\LOCALS~1\Temp\~HelloWorld\CCSBuild\app\WEB-INF\classes
[javac] Compiling 219 source files to C:\DOCUME~1\msuser\LOCALS~1\Temp\~HelloWorld\CCSBuild\app\WEB-INF\classes
[javac] C:\DOCUME~1\msuser\LOCALS~1\Temp\~HelloWorld\CCSBuild\src\com\codecharge\Action.java:25: cannot access javax.servlet.ServletContext
[javac] bad class file: C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar(javax/servlet/ServletContext.class)
[javac] class file has wrong version 49.0, should be 48.0
[javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
[javac] import javax.servlet.ServletContext;
[javac] ^
[javac] 1 error

BUILD FAILED
C:\DOCUME~1\msuser\LOCALS~1\Temp\~HelloWorld\CCSBuild\build.xml:45: Compile failed; see the compiler error output for details.
Total time: 5 seconds
=======================================
Error:
BUILD FAILED
Compile failed; see the compiler error output for details.




Error:Error during publish page
View profile  Send private message
matheus

Posts: 386
Posted: 03/19/2007, 12:06 PM

This was java version error.

I think your servlet-api.jar wasn't compiled in Java 1.5.
_________________
Matheus Trevizan

Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br
View profile  Send private message
negociant

Posts: 31
Posted: 03/20/2007, 12:58 AM

It's just version of compiled classes.
Tomcat jars for tomcat 6, seemingly, is compiled for JDK 1.6.
All jars in Tomcat 6.X.X must be compatible with JDK 1.6.
Tomcat 6.0.X jars usually works with previous version (Here 1.5), but better way is to install products for one java version. E.G. JDK 1.5, Tomcat 5.5.20, Ant 1.6.5.
View profile  Send private message
greenoh

Posts: 7
Posted: 03/20/2007, 3:38 AM

Thanks for the responses. My initial problem was related to Java version problems, but I'm not of of the woods yet.

* I uninstalled Netbeans 5.0, J2SE 1.5.0.09.

* Reinstalled TomCat 4.1. Set TC properties, Java to J2re1.4.2.

This got TC 4.1 working correctly.

I changed my CCS project to reflect the changes.

*Set my Project, Data, class path to TC4.1\lib.

*Set my Options:

*Java SDK : c:\program files\Java\j2re1.42

*Ant Home: c:\program files \ ASF..\TC4.1\

F9 -Build, but my build failed. Error states my ant.bat not found.

How can I install Ant and have it work correctly?

Thanks in advance.
View profile  Send private message
matheus

Posts: 386
Posted: 03/20/2007, 4:37 AM

Download Ant.

Configure ant.bat, put java_home.

Put ANT in Codecharge Path.


_________________
Matheus Trevizan

Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br
View profile  Send private message
miko

Posts: 50
Posted: 03/20/2007, 5:02 AM

Quote greenoh:
*Ant Home: c:\program files \ ASF..\TC4.1\

Please try to use "short" folder name to install Ant. For example, c:\ant
_________________
Regards,
Michael
View profile  Send private message
greenoh

Posts: 7
Posted: 03/22/2007, 4:53 AM

I've been able to get my test CCS web app created and the build runs without any errors. It deploys to my TC 4.1 running on the same pc.

But when I try to view the web app, I get the following error:

HTTP Status 404 - /Helloworld.jsp
--------------------------------------------------------------------------------
type Status report
message /Helloworld.jsp
description The requested resource (/Helloworld.jsp) is not available.
--------------------------------------------------------------------------------
Apache Tomcat/4.1.34

My TC 4.1 works fine because I can run all the example apps and admin apps without a problem.

I think this is related to something I'm not setting properly with CCS, I just don't know what.
My project, settings seem to be correct, but I'm not sure.

publishing
server path c:\program files\apache software foundation\tomcat 4.1\webapps
server url : http://127.0.0.1:8084
class path c:\program files\apache software foundation\tomcat 4.1\common\lib\servlet.jar
context path: /HelloWorld

I increased my logging to debug, but my log files don't show anything obvious.

Can some offer some assistance, please?!
View profile  Send private message
miko

Posts: 50
Posted: 03/22/2007, 5:09 AM

I'd like to advise:
1. Clear "Context Path" property. By default CCS uses project name as context path. This setting is a little advanced and it is better not to use it.
2. Check if autodeployment is enabled for Tomcat
3. Check if <projectName>.war file is in webapps folder
4. Check if <projectName> folder is created inside webapps (it must be created by autodeployment)

_________________
Regards,
Michael
View profile  Send private message
greenoh

Posts: 7
Posted: 03/22/2007, 5:49 AM

I cleared the "Contex Path" in the project properties, data tab and rebuild.

Same http 404 error.

Here is a directory listing:

Directory of C:\Program Files\Apache Software Foundation\Tomcat 4.1\webapps

03/21/2007 11:47 PM <DIR> .
03/21/2007 11:47 PM <DIR> ..
09/03/2006 10:21 PM 695 admin.xml
03/22/2007 09:37 AM 360 DatePicker.html
03/22/2007 09:37 AM 36,649 DatePicker.js
03/18/2007 05:52 PM <DIR> examples
03/22/2007 09:37 AM 13,893 Functions.js
03/20/2007 03:07 PM <DIR> HelloWorld
03/21/2007 11:45 PM 338 Helloworld.html
03/22/2007 09:37 AM 1,653 Helloworld.jsp
03/21/2007 09:57 PM 489,368 HelloWorld.war
03/22/2007 09:37 AM 492 Helloworld.xml
03/22/2007 09:37 AM 1,595 HelloworldHandlers.jsp
09/03/2006 10:21 PM 433 manager.xml
03/18/2007 05:52 PM <DIR> ROOT
03/18/2007 05:52 PM <DIR> tomcat-docs
03/21/2007 11:47 PM <DIR> WEB-INF
03/18/2007 05:52 PM <DIR> webdav
10 File(s) 545,476 bytes
View profile  Send private message
miko

Posts: 50
Posted: 03/22/2007, 5:58 AM

ok. As I see autodeployment works correctly.
please try the following URL

http://127.0.0.1:8084/HelloWorld/<yourJspPage>.jsp


_________________
Regards,
Michael
View profile  Send private message
greenoh

Posts: 7
Posted: 03/22/2007, 11:43 AM

I tried using different URL paths in IE & within CCS, but I still get the http 404 error.
I checked the logs and there isn't anything obvious again.

I'm really at a loss for what could be the problem.
View profile  Send private message
matheus

Posts: 386
Posted: 03/22/2007, 11:47 AM

In can enter tomcat's page?

http://127.0.0.1:8084/

Maybe your tomcat was in another port.

_________________
Matheus Trevizan

Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br
View profile  Send private message
greenoh

Posts: 7
Posted: 03/22/2007, 12:46 PM

My TC 4.1 works fine with the 8084 port. But I did discover one thing. From the TC Web Application manager page(127.0.0.1:8084/manager/html), all the published web applications are shown including /HelloWorld. The page has links to each app, so you can run each one from the manager page. When I click on the /HelloWorld application, I get
the same http 404 error.

I also get the same error with the /examples link. There another TC page that has an exmples link, and the examples runs fine.

127.0.0.1:8084/examples - http 404 error

127.0.0.1:8084/examples/jsp - works and brings up the index.html page

So theres got to be something wrong with my context; I think;
View profile  Send private message
negociant

Posts: 31
Posted: 03/23/2007, 1:36 AM

I can propose, install tomcat 5.X.X. e.g. 5.5.20.
And go (in browser) to the any concrete page.
I propose it because old (don't remember how old) werison of tomcat can't works with servlet start page. So index.do was not requested when you go to context uri.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.