2017-09-02 9 views
0

に2.5.5アプリをGrailsの。私は、Intellij 14でコマンドwar -stacktrace -verboseを使用してwarファイルを作成しました。私のtargetディレクトリの中にwarファイルが正常に作成されました。それをmyapp-0.1.warとしましょう。次に、端末(私はLinuxのミントを使用しています)で、私は私のサーバーにコピーするには、次のコマンドを使用展開は、私は(Ubuntuのサーバー上で実行されている)のTomcat 7へのGrails 2.5.5アプリを展開しようとしているのTomcat 7

rsync -rtvW --delete /home/mypcusername/NetbeansProjects/myapp/target/myapp-0.1.war/ [email protected]:/home/myserverusername/myapp-0.1.war/ 

しないでください(私はmypcusernamemyserverusername123.123.123.123のように、以下の例では、私の詳細は置換されました)上記のコマンドの一部であるNetbeansProjectsについても心配していましたが、もともとはNetbeansプロジェクトでした。その後、元のROOTディレクトリを削除するには、sudo cp -a myapp-0.1.war/ /var/lib/tomcat7/webapps/とそれに続いてsudo rm -R ROOTを使用しました。それから、私はsudo service tomcat7 restartを実行しました。これが問題の場所です。ログは私に次を与えた:

Sep 03, 2017 10:23:39 AM org.apache.coyote.AbstractProtocol pause 
INFO: Pausing ProtocolHandler ["http-bio-8080"] 
Sep 03, 2017 10:23:39 AM org.apache.catalina.core.StandardService stopInternal 
INFO: Stopping service Catalina 
Sep 03, 2017 10:23:39 AM org.apache.coyote.AbstractProtocol stop 
INFO: Stopping ProtocolHandler ["http-bio-8080"] 
Sep 03, 2017 10:23:39 AM org.apache.coyote.AbstractProtocol destroy 
INFO: Destroying ProtocolHandler ["http-bio-8080"] 
Sep 03, 2017 10:23:43 AM org.apache.coyote.AbstractProtocol init 
INFO: Initializing ProtocolHandler ["http-bio-8080"] 
Sep 03, 2017 10:23:43 AM org.apache.catalina.startup.Catalina load 
INFO: Initialization processed in 1734 ms 
Sep 03, 2017 10:23:43 AM org.apache.catalina.core.StandardService startInternal 
INFO: Starting service Catalina 
Sep 03, 2017 10:23:43 AM org.apache.catalina.core.StandardEngine startInternal 
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu) 
Sep 03, 2017 10:23:43 AM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT 
Sep 03, 2017 10:24:18 AM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://www.springframework.org/tags is already defined 
Sep 03, 2017 10:24:18 AM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://www.springframework.org/tags/form is already defined 
2017-09-03 10:24:26,325 [localhost-startStop-1] ERROR context.ContextLoader - Context initialization failed 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [CacheGrailsPlugin]! 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:473) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622) 
    at java.lang.Thread.run(Thread.java:748) 
Caused by: org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [CacheGrailsPlugin]! 
    ... 5 more 
Caused by: java.lang.UnsupportedClassVersionError: grails/plugin/cache/CacheConfigArtefactHandler : Unsupported major.minor version 52.0 (unable to load class grails.plugin.cache.CacheConfigArtefactHandler) 
    at CacheGrailsPlugin.<init>(CacheGrailsPlugin.groovy:49) 
    ... 5 more 
2017-09-03 10:24:26,330 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing the application: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [CacheGrailsPlugin]! 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [CacheGrailsPlugin]! 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:473) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622) 
    at java.lang.Thread.run(Thread.java:748) 
Caused by: org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [CacheGrailsPlugin]! 
    ... 5 more 
Caused by: java.lang.UnsupportedClassVersionError: grails/plugin/cache/CacheConfigArtefactHandler : Unsupported major.minor version 52.0 (unable to load class grails.plugin.cache.CacheConfigArtefactHandler) 
    at CacheGrailsPlugin.<init>(CacheGrailsPlugin.groovy:49) 
    ... 5 more 
2017-09-03 10:24:26,332 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing Grails: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [CacheGrailsPlugin]! 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [CacheGrailsPlugin]! 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:473) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622) 
    at java.lang.Thread.run(Thread.java:748) 
Caused by: org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [CacheGrailsPlugin]! 
    ... 5 more 
Caused by: java.lang.UnsupportedClassVersionError: grails/plugin/cache/CacheConfigArtefactHandler : Unsupported major.minor version 52.0 (unable to load class grails.plugin.cache.CacheConfigArtefactHandler) 
    at CacheGrailsPlugin.<init>(CacheGrailsPlugin.groovy:49) 
    ... 5 more 
Sep 03, 2017 10:24:26 AM org.apache.catalina.core.StandardContext startInternal 
SEVERE: Error listenerStart 
Sep 03, 2017 10:24:26 AM org.apache.catalina.core.StandardContext startInternal 
SEVERE: Context [] startup failed due to previous errors 
Sep 03, 2017 10:24:26 AM org.apache.coyote.AbstractProtocol start 
INFO: Starting ProtocolHandler ["http-bio-8080"] 
Sep 03, 2017 10:24:26 AM org.apache.catalina.startup.Catalina start 
INFO: Server startup in 43228 ms 

EDIT suricattaにおかげで、私はすべてのそれらの警告が消える行われたすべてのディレクトリを作成し、chowningによって彼の指示に従いました。私はログを更新しています。

元々、私は実際に私のサーバーに.warファイルをコピーしたことがないことに気付きました。ファイルを解凍しようとすると「ディレクトリを抽出できません」というようなことが分かりました。 rsync -rtvW --delete /home/mypcusername/NetbeansProjects/myapp/target/myapp-0.1.war/ [email protected]:/home/myserverusername/myapp-0.1.war/を使用するたびにmyapp-0.1.warという名前の空のディレクトリが作成されていることを確認してください。

私はscp /home/mypcusername/NetBeansProjects/myapp/target/myapp-0.1.war [email protected]:/home/myserverusernameを使って実際に戦争を私のサーバにコピーしました。今回は/ var/lib/tomcat7/webapps/ROOTで実際のファイルを解凍した後、Tomcatを再起動して、上記のログを取得しました。私は123.123.123.123:8080に行くとき、私はGET http://123.123.123.123:8080/ 404 (Not Found)を言っjavascriptのエラーで空白のページを取得し、私は同じ結果と<ip>:8080/myapp<ip>:8080/myapp/homeすべてのようなさまざまなバリエーションを試してみました。

私はthis答えをチェックアウトしましたが、それは私のapplicationContext.xmlにその質問のOPにある値と同じ値がありません。 applicationContext.xmlを投稿する必要がある場合は、私に知らせてください。

+0

ディレクトリ_警告の問題が原因であるかどうかわかりません_このページは見つかりませんでしたが、mkdir/usr/share/tomcat7/common/classesなどのディレクトリを作成して解決しました。 'chown -R tomcat7:tomcat7/usr/share/tomcat7/common/classes'の権限を与えることを忘れないでください。 – suricatta

+0

私はwebappが "myapp-0.1"ディレクトリにうまく配置されていると思います。 "123.123.123.123:8080/myapp-0.1"を開くとどうなりますか? "できます!" Tomcatからではなく、Apacheのhttpdからのデフォルトのウェルカムページです。 – andi

+0

はあなたのプロジェクトのように見えますが、grailsがJava 8用にコンパイルされていて、UbuntuサーバがJava 7を実行しています。 https://stackoverflow.com/questions/22489398/unsupported-major-minor-version-52-0 – andi

答えて

0

私は新しいプロジェクトを開始しました。新しいプロジェクトを開始しました。新しいプロジェクトに私のものをすべてコピーして、新しいプロジェクトに配備して展開しました。

関連する問題