• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Difficulty getting servlets working in CF7

Guest
Aug 09, 2006 Aug 09, 2006

Copy link to clipboard

Copied

Hello all,

Has anybody had a successful experience deploying servlets on Coldfusion 7 ? I've compiled my servlet, tested it worked successfuly with Tomcat, so the servlet works. However I can't get it running on CFMX 7, even if I recompile with jrun.jar in the classpath.

I've been trying to get it working using the built-in HTTP server so that any third-party server issues are eliminated.

I can't see what I'm doing wrong, I've got the classes in wwwroot\WEB-INF\classes and have edited wwwroot\WEB-INF\web.xml and simply pasted in the "known-good" <servlet> and <servlet-mapping> entries from the Tomcat implementation, as below :

<servlet>
<servlet-name>myServletName</servlet-name>
<servlet-class>myClass.myServletName</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>myServletName</servlet-name>
<url-pattern>/servlets/myServletName</url-pattern>
</servlet-mapping>

Other things I have tried include :
(1) Trying to use the default-web.xml parser (i.e. accessing /servlet/myServletName, either with or without the web.xml config above)
(2) Following the syntax in web.xml, I tried adding "id="myname01"" to both the <servlet> and <servlet-mapping> tags.

Any ideas ??
TOPICS
Advanced techniques

Views

370

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 09, 2006 Aug 09, 2006

Copy link to clipboard

Copied

Have you restarted coldfusion ?

Here's a thread that indicates how I got this to work.

Ken

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 10, 2006 Aug 10, 2006

Copy link to clipboard

Copied

Hi Ken,

Indeed I have tried restarting Coldfusion, infact I did so every single time I tried a different approach to solving the problem in hand.

Thank you for the link, I will have a look....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 10, 2006 Aug 10, 2006

Copy link to clipboard

Copied

Unfortunatley the advice on the link doesn't appear to work.

I've now placed the java source in wwwroot\WEB-INF\classes, however when the server is rebooted, a directory with the package name is created (i.e. wwwroot\WEB-INF\classes\myPackageName) but no compiled classes are created.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 15, 2006 Aug 15, 2006

Copy link to clipboard

Copied

LATEST
servlets works for me, i prefer to compile them by myself but if you put
in jrun-web.xml <compile>true</compile> compilation by jrun works too.
<reload>true</reload> also works (reloading servlets and dependent
classes) but not in interaction with cf7 - it has its own classloader.


Jan

hiya wrote:
> Unfortunatley the advice on the link doesn't appear to work.
>
> I've now placed the java source in wwwroot\WEB-INF\classes, however when the
> server is rebooted, a directory with the package name is created (i.e.
> wwwroot\WEB-INF\classes\myPackageName) but no compiled classes are created.
>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation