简单的Web项目部署在Tomcat 6上,而不部署在JBoss 6上 [英] Simple web project deploys on Tomcat 6, not on JBoss 6

查看:99
本文介绍了简单的Web项目部署在Tomcat 6上,而不部署在JBoss 6上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用最新的Eclipse(Java EE开发). 我在服务器视图中定义了两个服务器:Tomcat 6和JBoss 6(我必须使用它们).

I use the latest Eclipse (Java EE development). I have two servers defined in the servers view: Tomcat 6, and JBoss 6 (I have to use these).

我正在尝试测试以下简单的Web应用程序: http://viralpatel.net/blogs/spring-3-mvc-create-hello-world-application-spring-3-mvc/

I am trying to test the following simple web application: http://viralpatel.net/blogs/spring-3-mvc-create-hello-world-application-spring-3-mvc/

当我从eclipse启动Tomcat 6时,我可以访问项目主页.

When I start Tomcat 6 (from eclipse), I can access the project home page.

然后,当我停止Tomcat 6并启动JBoss 6时,当我尝试访问项目主页时-我的HTTP状态为404.

Then, when I stop Tomcat 6 and start JBoss 6, when I try to access the project home page - I get HTTP status 404.

这是怎么了?我可能会缺少什么?

What is wrong here? What may I be missing?

我不知道应该在哪里查找错误. 我可以看到该项目尚未在JBoss中部署,但是我不确定为什么(我想我忘记了一些基本知识).

I do not know where I am supposed to look for errors. I can see this project is not being deployed in JBoss but I am not sure why (I guess I forgot something basic).

推荐答案

在Eclipse中打开服务器"视图,以便您可以看到jboss服务器.右键单击您的JBoss服务器,然后选择添加和删除.这使您可以选择要添加到服务器的应用程序.

Open the Servers view in Eclipse so you can see your jboss server. Right click on your JBoss server and choose Add and Remove. This lets you choose which application to add to your server.

好吧,我能够重现您认为的问题.您应该在eclipse中的控制台中看到错误.您的控制台是否显示来自JBoss的任何内容?我收到一个错误消息,因为我的工作空间中有一个空格.我将尝试修复该问题,并查看其是否有效.

Okay I was able to recreate the issue you have I believe. You should see the errors in the Console in eclipse. Is your console displaying anything from JBoss? I'm getting an error because my workspace has a space in it. I'm going to try to fix that and see if it works.

我终于在JBoss 6.1上工作了.显然,JBoss 6.1和该项目使用3.0.1库的那些Spring库之间存在一个错误.

I finally got this to work on JBoss 6.1. Apparently there is a bug between JBoss 6.1 and those Spring libraries the project uses the 3.0.1 libraries.

您需要下载Spring的较新库.即使将其部署到正确的位置,也必须更改这些设置以解决某些部署问题.我在这里找到了它们:

You need to download newer libraries for Spring. You have to changes these to fix some deployment issues even after you get it to deploy to the right location. I found them all here: Spring 3.1.3

因此,一旦保存了这些文件,便将它们复制到lib文件夹并删除了3.0.1文件.我遇到的下一个问题是日食以使用正确的Deploy文件夹.我在c:\ jboss-6.1-final中安装了jboss.在Eclipse中,您必须双击jboss服务器以打开"JBoss概述"页面,该页面底部有一个标签为Deployment的选项卡.在该屏幕上,我必须选择使用JBoss部署"文件夹,该文件夹使用C:驱动器上的文件夹,而不是使用JBoss Tools定义的Eclipse.当您选择在服务器上运行,它应该再在C创建一个文件夹:\ jboss的-6.1-最终\服务器\ DEFAULT \部署文件夹了.

So once I saved those, I copied them to the lib folder and removed the 3.0.1 files. The next issue I had was getting eclipse to use the right Deploy folder. I have jboss installed in c:\jboss-6.1-final. In Eclipse you have to double click on your jboss server to open the JBoss Overview Page, there is a tab at the bottom of that labeled Deployment. On that screen I had to choose, Use the JBoss deploy folder, which uses the one on my C: drive instead of the one Eclipse defines with the JBoss Tools. When you choose run on server, it should then create a folder in your c:\jboss-6.1-final\server\default\deploy folder now.

这篇关于简单的Web项目部署在Tomcat 6上,而不部署在JBoss 6上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆