简体   繁体   English

JAVA:Eclispe Luna Windows 8.1 x64中的部署错误

[英]JAVA : deployment error in Eclispe Luna windows 8.1 x64

In Eclipse Luna I created a maven project enterprises-granny clone of github https://github.com/SAP/cloud-enterprise-granny.git . 在Eclipse Luna中,我创建了一个github https://github.com/SAP/cloud-enterprise-granny.git的maven项目enterprises-granny克隆。

After cloning git , all source files are imported in a project.A server JAVA WEB shipped from SAP HCP is running on local host. 克隆git之后,所有源文件都将导入到项目中。SAPHCP附带的服务器JAVA WEB正在本地主机上运行。

Few applications are running on this server for testing purpose they works fine. 出于测试目的,很少有应用程序在此服务器上运行,它们可以正常工作。 In eclipse server project , there is a folder named webapps which includes 'hello','basecamp' etc folder ie currently running apps on server , some of them includes maven as well. 在eclipse服务器项目中,有一个名为webapps的文件夹,其中包含“ hello”,“ basecamp”等文件夹,即当前在服务器上运行的应用程序,其中一些还包括maven。

When enterprises-granny project is chosen to run as -> run on server -> JAVA WEB ->finish then it deployed all files to server without any error(s) .Now webapps includes one more folder enterprises-granny which includes all deployed files and then it opens a web browser with link http://localhost:8080/enterprise-granny 当选择enterprises-granny项目以->在服务器上运行-> JAVA WEB-> finish的方式运行时,它将所有文件部署到服务器而没有任何错误。现在, webapps包含一个文件夹enterprises-granny ,其中包括所有部署的文件然后打开带有链接http:// localhost:8080 / enterprise-granny的Web浏览器

but webpage content is empty ie empty page is displayed . 但网页内容为空,即显示空白页面。

Where as http://localhost:8080/hello (Another app to display hello world ) displays a page with contents hello world . 其中http:// localhost:8080 / hello (另一个用于显示hello world应用程序)显示的页面包含内容hello world

How to resolve this error ? 如何解决此错误?

Are you sure it is actually deploying properly? 您确定它确实在正确部署吗? If eg in the Server Log (the trace one esp) you see lines reporting failure to instantiate some bean or other, then your deployment has ended in application crashing. 例如,如果在服务器日志(跟踪一个esp)中看到报告无法实例化某些bean或其他实例的行,则说明部署已结束,导致应用程序崩溃。 Like mine right now (working with Tag 1.10.1). 现在就像我的一样(使用Tag 1.10.1)。 (I know this is not a full answer to your question, but worth checking. If you are getting similar failure reason, then whoever finds the answer to that first, please share!). (我知道这不是您问题的完整答案,但是值得检查。如果您遇到类似的失败原因,那么谁先找到该问题的答案,请分享!)。

So for example my crash log spits out: Context initialization failedorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'api': Cannot resolve reference to bean 'validationInInterceptor' while setting bean property 'inInterceptors' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'validationInInterceptor' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Cannot resolve reference to bean 'validationProvider' while setting bean property 'provider'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'validationProvider' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.validation.BeanValidationProvider]: Constructor threw exception; 因此,例如我的崩溃日志弹出: Context initialization failedorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'api': Cannot resolve reference to bean 'validationInInterceptor' while setting bean property 'inInterceptors' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'validationInInterceptor' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Cannot resolve reference to bean 'validationProvider' while setting bean property 'provider'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'validationProvider' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.validation.BeanValidationProvider]: Constructor threw exception; Context initialization failedorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'api': Cannot resolve reference to bean 'validationInInterceptor' while setting bean property 'inInterceptors' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'validationInInterceptor' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Cannot resolve reference to bean 'validationProvider' while setting bean property 'provider'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'validationProvider' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.validation.BeanValidationProvider]: Constructor threw exception; ... ...

If you just need to get some version of enterprise-granny up and running, without trying to debug stuff, then the latest GitHub version that works (without hacking) is the one tagged with 1.7.0 - this one doesn't have Twitter Bootstrap and Apache Tiles, never mind the other fine things in the latest versions, but it should deploy ok for you. 如果您只需要启动并运行某种版本的企业专用工具,而无需尝试调试东西,那么可以正常工作的最新GitHub版本(不带黑客)是带有1.7.0标记的版本-该版本没有Twitter Bootstrap和Apache Tiles,不要介意最新版本中的其他优点,但是它应该可以为您部署好。 (Tip: create a new server to test it locally, or if you want to keep it on a server you already deployed a version to, then in Server-config you should delete the existing .war from the pickup folder). (提示:创建一个新服务器以在本地对其进行测试,或者如果要将其保留在已经部署了版本的服务器上,则在Server-config中,应从拾取文件夹中删除现有的.war)。

One other thing: for these "old-school" versions, which have the osintegrators "cloud-granny" look and feel, you might want to implement a couple of changes which will get the app to run also with Internet Explorer (not needed for Firefox or Chrome). 另一件事:对于这些“老派”版本,它们的外观和感觉都像osintegrator的“ cloud-granny”一样,您可能需要进行一些更改,使应用程序也可以与Internet Explorer一起运行(不需要Firefox或Chrome)。 The changes are: 更改为:

//after the page loads
        $(function() {
            app.getAllAddresses();
            $("#addressList").on("click",
            //"option", 
            function() {
                app.getAddressById(this.value);
            });
        });

... here you comment out the "option" parameter (which you don't use anyway). ...在这里,您注释掉了“ option”参数(无论如何您都不使用)。 The other change is to prevent caching of jquery ajax calls, you do this in the section, just before closing element and after loading jquery, like this: 另一个更改是防止缓存jquery ajax调用,您可以在本节中在关闭元素之前和加载jquery 之后执行此操作,如下所示:

<script type="text/javascript"
    src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">

</script>

<script>
    $(document).ready(function() {
        $.ajaxSetup({
            cache : false
        });
    });
</script>


</head>

Implementing these two changes doesn't harm Chrome or Firefox, and enables IE users to select items in the addressList, and Save/Delete them. 实施这两个更改不会损害Chrome或Firefox,并使IE用户可以选择addressList中的项目,然后保存/删除它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM