Tomcatで実行されているSpringMvc Hibernate MySqlアプリケーションをBluemixクラウドにプッシュする方法は?

briantaurostack7

私はWebアプリのデプロイの初心者です。MySQLデータベースを使用してTomcatで実行されている既存のGitプロジェクトをBluemixクラウドにプッシュする方法を誰かに教えてもらえますか?

cf pushコマンドを使用しようとすると、次のエラーが発生しました。

cf push Indus -p /Users/briantauro/Documents/workspace-sts-3.8.1.RELEASE/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Indus3 -b java_buildpack

これは出力です:

Creating app Indus in org brian7 / space brian as [email protected]...
OK

Creating route indus.mybluemix.net...
OK

Binding indus.mybluemix.net to Indus...
OK

Uploading Indus...
Uploading app files from: /Users/briantauro/Documents/workspace-sts-3.8.1.RELEASE/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Indus3
Uploading 253.7K, 57 files
Done uploading               
OK

Starting app Indus in org brian7 / space brian as [email protected]...
-----> Downloaded app package (19M)
-----> Java Buildpack Version: v3.6 | https://github.com/cloudfoundry/java-buildpack.git#5194155
-----> Downloading Open Jdk JRE 1.8.0_91-unlimited-crypto from https://java-buildpack.cloudfoundry.org/openjdk/trusty/x86_64/openjdk-1.8.0_91-unlimited-crypto.tar.gz (2.3s)
       Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.9s)
-----> Downloading Open JDK Like Memory Calculator 2.0.2_RELEASE from https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64/memory-calculator-2.0.2_RELEASE.tar.gz (0.0s)
       Memory Settings: -Xms768M -Xss1M -Xmx768M -XX:MaxMetaspaceSize=104857K -XX:MetaspaceSize=104857K
       Modifying /WEB-INF/web.xml for Auto Reconfiguration
-----> Downloading Tomcat Instance 8.0.36 from https://java-buildpack.cloudfoundry.org/tomcat/tomcat-8.0.36.tar.gz (0.2s)
       Expanding Tomcat Instance to .java-buildpack/tomcat (0.2s)
-----> Downloading Tomcat Logging Support 2.5.0_RELEASE from https://java-buildpack.cloudfoundry.org/tomcat-logging-support/tomcat-logging-support-2.5.0_RELEASE.jar (0.0s)
-----> Downloading Tomcat Access Logging Support 2.5.0_RELEASE from https://java-buildpack.cloudfoundry.org/tomcat-access-logging-support/tomcat-access-logging-support-2.5.0_RELEASE.jar (0.0s)
-----> Downloading Tomcat Lifecycle Support 2.5.0_RELEASE from https://java-buildpack.cloudfoundry.org/tomcat-lifecycle-support/tomcat-lifecycle-support-2.5.0_RELEASE.jar (0.0s)

-----> Uploading droplet (72M)

0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 failing
FAILED
Error restarting application: Start unsuccessful

TIP: use 'cf logs Indus --recent' for more information

使ってみるとcf log Indus --recent次のような結果になります

    Connected, dumping recent logs for app Indus in org brian7 / space brian as [email protected]...



  java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at java.lang.Thread.run(Thread.java:745)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.covenant.app.dao.DealRepository com.covenant.app.services.DealService.dealRepo; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dealRepository': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.persistence.EntityManagerFactory] is defined
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:558)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    ... 26 more
    2016-08-26T17:01:04.71+0530 [App/0]      OUT Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dealRepository': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.persistence.EntityManagerFactory] is defined
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:357)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1127)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1051)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:530)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    ... 28 more
    2016-08-26T17:01:04.71+0530 [App/0]      OUT Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.persistence.EntityManagerFactory] is defined
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findDefaultEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:572)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:528)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:694)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:667)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:155)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:354)
    2016-08-26T17:01:04.71+0530 [App/0]      OUT    ... 39 more
    2016-08-26T17:01:04.71+0530 [App/0]      OUT [CONTAINER] org.apache.catalina.core.StandardContext           SEVERE  One or more listeners failed to start. Full details will be found in the appropriate container log file
    2016-08-26T17:01:04.88+0530 [App/0]      OUT [CONTAINER] org.apache.catalina.util.SessionIdGeneratorBase    INFO    Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [161] milliseconds.
    2016-08-26T17:01:04.88+0530 [App/0]      OUT [CONTAINER] org.apache.catalina.core.StandardContext           SEVERE  Context [] startup failed due to previous errors
    2016-08-26T17:01:04.88+0530 [App/0]      OUT [CONTAINER] lina.core.ContainerBase.[Catalina].[localhost].[/] INFO    Closing Spring root WebApplicationContext
    2016-08-26T17:01:04.93+0530 [App/0]      OUT [CONTAINER] org.apache.catalina.loader.WebappClassLoaderBase   WARNING The web application [ROOT] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
    2016-08-26T17:01:04.93+0530 [App/0]      OUT [CONTAINER] org.apache.catalina.loader.WebappClassLoaderBase   WARNING The web application [ROOT] registered the JDBC driver [com.mysql.fabric.jdbc.FabricMySQLDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
    2016-08-26T17:01:04.93+0530 [App/0]      OUT [CONTAINER] org.apache.catalina.loader.WebappClassLoaderBase   WARNING The web application [ROOT] registered the JDBC driver [org.hsqldb.jdbc.JDBCDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
    2016-08-26T17:01:04.94+0530 [App/0]      OUT [CONTAINER] org.apache.catalina.loader.WebappClassLoaderBase   WARNING The web application [ROOT] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
    2016-08-26T17:01:04.94+0530 [App/0]      OUT  java.lang.Object.wait(Native Method)
    2016-08-26T17:01:04.94+0530 [App/0]      OUT  java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
    2016-08-26T17:01:04.94+0530 [App/0]      OUT  com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)
    2016-08-26T17:01:04.95+0530 [App/0]      OUT [CONTAINER] org.apache.catalina.startup.HostConfig             INFO    Deployment of web application directory /home/vcap/app/.java-buildpack/tomcat/webapps/ROOT has finished in 11,953 ms
    2016-08-26T17:01:04.95+0530 [App/0]      OUT [CONTAINER] pplicationStartupFailureDetectingLifecycleListener SEVERE  Error: Application 'Archetype Created Web Application' failed (state = STOPPED): see Tomcat's logs for details. Halting Tomcat.
    2016-08-26T17:01:05.53+0530 [App/0]      ERR 
    2016-08-26T17:01:05.63+0530 [DEA/162]    ERR Instance (index 0) failed to start accepting connections
    2016-08-26T17:01:05.67+0530 [API/1]      OUT App instance exited with guid fe627d1a-3823-4174-8d70-32eeb604a601 payload: {"cc_partition"=>"default", "droplet"=>"fe627d1a-3823-4174-8d70-32eeb604a601", "version"=>"5dc8e37a-3be5-4a54-89a6-ca2c8158e848", "instance"=>"76b6a7864ec84ecda4a441ff1fbca5ff", "index"=>0, "reason"=>"CRASHED", "exit_status"=>148, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1472211065}
    2016-08-26T17:01:05.68+0530 [API/8]      OUT App instance exited with guid fe627d1a-3823-4174-8d70-32eeb604a601 payload: {"cc_partition"=>"default", "droplet"=>"fe627d1a-3823-4174-8d70-32eeb604a601", "version"=>"5dc8e37a-3be5-4a54-89a6-ca2c8158e848", "instance"=>"76b6a7864ec84ecda4a441ff1fbca5ff", "index"=>0, "reason"=>"CRASHED", "exit_status"=>148, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1472211065}

アップデートSpringBootアプリケーションを実行できますが、Spring MVC4ブートレスアプリケーションを実行しようとすると、次のエラーが発生します。アプリケーションが初期化されないのかわかりません。

Error 500: javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception created by servlet

man:cf pushを試しましたが、https://api.ng.bluemix.netのターゲットURLが無効であると表示されます。これは、JavaWebアプリケーションのデプロイ中に正常に機能します。

このアプリケーションをBluemixにデプロイする手順を誰かが親切に提供できますか?何をすればいいのかわからない

briantaurostack7

私はついにLibertyfor Javaに移行し、アプリケーションは問題なくブルーミックスでデプロイされました。

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

Related 関連記事

ホットタグ

アーカイブ