我使用Tomcat 7 e PostgreSQL在Openshift中创建了一个应用程序。
用Vraptor 4,JPA和Gradle构建我的应用程序。
当我建立战争并且运行和本地tomcat时,效果很好。所以当我在openshift中部署时,不起作用。似乎没有读取.class文件和index.html是打开的,而不是登录jsp。
我尝试找到部署应用程序的位置来比较结构,但我没有。
认为问题可能是Gradle构建,我通过SFTP推进战争e也有同样的问题
我做错了什么或遗忘了什么?我在哪里可以找到问题?
遵循战争结构
- .sass-cache
- css
- font
- images
- js
- META-INF
----- MANIFEST.MF
- WEB-INF
----- classes
----------- br (and others packages and class files)
----------- META-INF
---------------- beans.xml
---------------- log4j.xml
---------------- persistence.xml
---------------- validation.xml
---------------- ValidationMessages.properties
----------- development.properties
----------- environment.proporties
----------- logback.xml
----------- messages.properties
----------- production.properties
----- jsp
----- libs
----- web.xml
- index.html
编辑:根据要求,按照我的日志。
我的詹金斯日志
Startedding remotely on librarybldr (library-build) in workspace /var/lib/openshift/56ce7d537628e1937000006c/app-root/runtime/repo
Checkout:repo / /var/lib/openshift/56ce7d537628e1937000006c/app-root/runtime/repo - hudson.remoting.Channel@17bd581:librarybldr
Using strategy: Default
Last Built Revision: Revision e38eb58e23605eebd6d10218a38d40b2a71189cf (origin/HEAD, origin/master)
Checkout:repo / /var/lib/openshift/56ce7d537628e1937000006c/app-root/runtime/repo - hudson.remoting.LocalChannel@1f2cd7f
Wiping out workspace first.
Cloning the remote Git repository
Cloning repository origin
Fetching upstream changes from [mygitrepo]
Seen branch in repository origin/HEAD
Seen branch in repository origin/master
Commencing build of Revision e38eb58e23605eebd6d10218a38d40b2a71189cf (origin/HEAD, origin/master)
Checking out Revision e38eb58e23605eebd6d10218a38d40b2a71189cf (origin/HEAD, origin/master)
Warning : There are multiple branch changesets here
[repo] $ /bin/sh -xe /tmp/hudson6919511635576326381.sh
+ source /usr/lib/openshift/cartridge_sdk/bash/sdk
++ '[' false == true ']'
++ OO_BASH_SDK=true
+ alias 'rsync=rsync --delete-after -azS -e '\''/usr/libexec/openshift/cartridges/jenkins/bin/git_ssh_wrapper.sh'\'''
+ upstream_ssh=56cc6da77628e117cd0001a8@library-bukaholic.rhcloud.com
+ rm -f /var/lib/openshift/56ce7d537628e1937000006c//app-deployments/current/metadata.json
+ marker_present force_clean_build
+ '[' -f /var/lib/openshift/56ce7d537628e1937000006c/app-root/runtime/repo//.openshift/markers/force_clean_build ']'
+ set +e
+ rsync --delete-after -azS -e /usr/libexec/openshift/cartridges/jenkins/bin/git_ssh_wrapper.sh '56cc6da77628e117cd0001a8@app-domain.rhcloud.com:$OPENSHIFT_BUILD_DEPENDENCIES_DIR' /var/lib/openshift/56ce7d537628e1937000006c/app-root/runtime/build-dependencies/
Warning: Permanently added 'app-domain.rhcloud.com,172.16.11.161' (RSA) to the list of known hosts.
+ rsync --delete-after -azS -e /usr/libexec/openshift/cartridges/jenkins/bin/git_ssh_wrapper.sh '56cc6da77628e117cd0001a8@library-bukaholic.rhcloud.com:$OPENSHIFT_DEPENDENCIES_DIR' /var/lib/openshift/56ce7d537628e1937000006c/app-root/runtime/dependencies/
Warning: Permanently added 'app-domain.rhcloud.com,172.16.11.161' (RSA) to the list of known hosts.
+ set -e
+ gear build
Building git ref 'origin/HEAD', commit e38eb58
+ '[' '!' -d /var/lib/openshift/56ce7d537628e1937000006c/app-root/data//gradle-2.11 ']'
+ cd /var/lib/openshift/56ce7d537628e1937000006c/app-root/data/
+ mkdir gradle
+ wget http://services.gradle.org/distributions/gradle-2.11-bin.zip
DOWNLOAD GRADLE
Skipping Maven build due to absence of pom.xml
+ cd /var/lib/openshift/56ce7d537628e1937000006c/app-root/runtime/repo/
+ export GRADLE_USER_HOME=/var/lib/openshift/56ce7d537628e1937000006c/app-root/data//gradle
+ GRADLE_USER_HOME=/var/lib/openshift/56ce7d537628e1937000006c/app-root/data//gradle
+ export GRADLE_HOME=/var/lib/openshift/56ce7d537628e1937000006c/app-root/data//gradle-2.11
+ GRADLE_HOME=/var/lib/openshift/56ce7d537628e1937000006c/app-root/data//gradle-2.11
+ export JAVA_HOME=/etc/alternatives/java_sdk_1.8.0
+ JAVA_HOME=/etc/alternatives/java_sdk_1.8.0
+ export PATH=/var/lib/openshift/56ce7d537628e1937000006c/app-root/data//gradle-2.11/bin:/etc/alternatives/java_sdk_1.7.0/bin:/etc/alternatives/maven-3.0/bin:/bin:/usr/bin:/usr/sbin
+ PATH=/var/lib/openshift/56ce7d537628e1937000006c/app-root/data//gradle-2.11/bin:/etc/alternatives/java_sdk_1.7.0/bin:/etc/alternatives/maven-3.0/bin:/bin:/usr/bin:/usr/sbin
+ gradle clean build
:clean UP-TO-DATE
:compileJava
Download dependencies
Some error of encode like below
/var/lib/openshift/56ce7d537628e1937000006c/app-root/runtime/repo/src/br/com/bukaholic/library/annotation/Public.java:12: error: unmappable character for encoding ASCII
* Anota????o para informar ao {@link AuthenticationInterceptor} que o m??todo
^
:processResources
:classes
:war
:assemble
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:build
BUILD SUCCESSFUL
Total time: 47.952 secs
This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.11/userguide/gradle_daemon.html
+ /usr/libexec/openshift/cartridges/jenkins/bin/git_ssh_wrapper.sh 56cc6da77628e117cd0001a8@library-bukaholic.rhcloud.com 'gear stop --conditional --exclude-web-proxy --git-ref e38eb58e23605eebd6d10218a38d40b2a71189cf'
Warning: Permanently added 'app-domain.rhcloud.com,172.16.11.161' (RSA) to the list of known hosts.
Stopping gear...
Stopping jbossews cartridge
Sending SIGTERM to jboss:158286 ...
Stopping Postgres cartridge
++ /usr/libexec/openshift/cartridges/jenkins/bin/git_ssh_wrapper.sh 56cc6da77628e117cd0001a8@app-domain.rhcloud.com 'gear create-deployment-dir'
Warning: Permanently added 'app-domain.rhcloud.com,172.16.11.161' (RSA) to the list of known hosts.
+ deployment_dir=2016-02-24_23-06-33.187
+ rsync --delete-after -azS -e /usr/libexec/openshift/cartridges/jenkins/bin/git_ssh_wrapper.sh /var/lib/openshift/56ce7d537628e1937000006c//app-deployments/current/metadata.json 56cc6da77628e117cd0001a8@app-domain.rhcloud.com:app-deployments/2016-02-24_23-06-33.187/metadata.json
Warning: Permanently added 'app-domain.rhcloud.com,172.16.11.161' (RSA) to the list of known hosts.
+ rsync --delete-after -azS -e /usr/libexec/openshift/cartridges/jenkins/bin/git_ssh_wrapper.sh --exclude .git /var/lib/openshift/56ce7d537628e1937000006c/app-root/runtime/repo/ 56cc6da77628e117cd0001a8@app-domain.rhcloud.com:app-root/runtime/repo/
Warning: Permanently added 'app-domain.rhcloud.com,172.16.11.161' (RSA) to the list of known hosts.
+ rsync --delete-after -azS -e /usr/libexec/openshift/cartridges/jenkins/bin/git_ssh_wrapper.sh /var/lib/openshift/56ce7d537628e1937000006c/app-root/runtime/build-dependencies/ 56cc6da77628e117cd0001a8@app-domain.rhcloud.com:app-root/runtime/build-dependencies/
Warning: Permanently added 'app-domain.rhcloud.com,172.16.11.161' (RSA) to the list of known hosts.
+ rsync --delete-after -azS -e /usr/libexec/openshift/cartridges/jenkins/bin/git_ssh_wrapper.sh /var/lib/openshift/56ce7d537628e1937000006c/app-root/runtime/dependencies/ 56cc6da77628e117cd0001a8@app-domain.rhcloud.com:app-root/runtime/dependencies/
Warning: Permanently added 'app-domain.rhcloud.com,172.16.11.161' (RSA) to the list of known hosts.
+ /usr/libexec/openshift/cartridges/jenkins/bin/git_ssh_wrapper.sh 56cc6da77628e117cd0001a8@app-domain.rhcloud.com 'gear remotedeploy --deployment-datetime 2016-02-24_23-06-33.187'
Warning: Permanently added 'app-domain.rhcloud.com,172.16.11.161' (RSA) to the list of known hosts.
Preparing build for deployment
Deployment id is 4619e5f7
Activating deployment
Starting Postgres cartridge
Postgres started
Starting jbossews cartridge
Found 127.7.73.129:8080 listening port
Archiving artifacts
Finish by user Jenkins Admin
Builed: SUCCESS
这是jbossews.log
Feb 24, 2016 11:06:29 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-127.7.73.129-8080"]
Feb 24, 2016 11:06:29 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Feb 24, 2016 11:06:29 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-127.7.73.129-8080"]
Feb 24, 2016 11:06:29 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-127.7.73.129-8080"]
Feb 24, 2016 11:06:45 PM org.apache.catalina.startup.Catalina addClusterRuleSet
INFO: Cluster RuleSet not found due to [java.lang.ClassNotFoundException: org.apache.catalina.ha.ClusterRuleSet]. Cluster configuration disabled.
Feb 24, 2016 11:06:46 PM org.apache.catalina.startup.Catalina addClusterRuleSet
INFO: Cluster RuleSet not found due to [java.lang.ClassNotFoundException: org.apache.catalina.ha.ClusterRuleSet]. Cluster configuration disabled.
Feb 24, 2016 11:06:47 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /opt/rh/postgresql92/root/usr/lib64:/usr/java/packages/lib/i386:/lib:/usr/lib
Feb 24, 2016 11:06:47 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-127.7.73.129-8080"]
Feb 24, 2016 11:06:47 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1771 ms
Feb 24, 2016 11:06:48 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Feb 24, 2016 11:06:48 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.54
Feb 24, 2016 11:06:48 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/openshift/56cc6da77628e117cd0001a8/app-root/runtime/dependencies/jbossews/webapps/ROOT.war
Feb 24, 2016 11:06:50 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/var/lib/openshift/56cc6da77628e117cd0001a8/jbossews/work/Catalina/localhost/_/WEB-INF/lib/el-api-2.2.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/el/Expression.class
Feb 24, 2016 11:06:50 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/var/lib/openshift/56cc6da77628e117cd0001a8/jbossews/work/Catalina/localhost/_/WEB-INF/lib/javax.servlet-api-3.1.0.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
Feb 24, 2016 11:06:50 PM org.apache.catalina.deploy.WebXml setVersion
WARNING: Unknown version string [3.1]. Default version will be used.
[24/02/2016 23:07:20] Registering bundled converters
[24/02/2016 23:07:20] Registering bundled converters
[24/02/2016 23:07:20] Unable to find a converter for class java.util.Calendar. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.CalendarConverter to class java.util.Calendar
[24/02/2016 23:07:20] Unable to find a converter for double. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.PrimitiveDoubleConverter to double
[24/02/2016 23:07:20] Unable to find a converter for class java.lang.Integer. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.IntegerConverter to class java.lang.Integer
[24/02/2016 23:07:20] Found interceptor for class br.com.caelum.vraptor.interceptor.FlashInterceptor
[24/02/2016 23:07:20] Unable to find a converter for class java.lang.Byte. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.ByteConverter to class java.lang.Byte
[24/02/2016 23:07:20] Unable to find a converter for short. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.PrimitiveShortConverter to short
[24/02/2016 23:07:20] Unable to find a converter for class java.lang.Short. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.ShortConverter to class java.lang.Short
[24/02/2016 23:07:20] Unable to find a converter for float. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.PrimitiveFloatConverter to float
[24/02/2016 23:07:20] Unable to find a converter for class java.lang.Float. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.FloatConverter to class java.lang.Float
[24/02/2016 23:07:20] Unable to find a converter for class java.lang.Character. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.CharacterConverter to class java.lang.Character
[24/02/2016 23:07:20] Unable to find a converter for class java.lang.Enum. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.EnumConverter to class java.lang.Enum
[24/02/2016 23:07:20] Unable to find a converter for class java.math.BigInteger. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.BigIntegerConverter to class java.math.BigInteger
[24/02/2016 23:07:20] Unable to find a converter for interface br.com.caelum.vraptor.observer.upload.UploadedFile. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.observer.upload.UploadedFileConverter to interface br.com.caelum.vraptor.observer.upload.UploadedFile
[24/02/2016 23:07:20] Unable to find a converter for boolean. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.PrimitiveBooleanConverter to boolean
[24/02/2016 23:07:20] Unable to find a converter for class java.math.BigDecimal. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.BigDecimalConverter to class java.math.BigDecimal
[24/02/2016 23:07:20] Unable to find a converter for class java.util.Date. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.DateConverter to class java.util.Date
[24/02/2016 23:07:20] Unable to find a converter for class java.lang.Long. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.LongConverter to class java.lang.Long
[24/02/2016 23:07:20] Unable to find a converter for byte. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.PrimitiveByteConverter to byte
[24/02/2016 23:07:20] Unable to find a converter for char. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.PrimitiveCharConverter to char
[24/02/2016 23:07:20] Found interceptor for class br.com.caelum.vraptor.jpa.JPATransactionInterceptor
[24/02/2016 23:07:20] Unable to find a converter for int. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.PrimitiveIntConverter to int
[24/02/2016 23:07:20] Unable to find a converter for class java.lang.Boolean. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.BooleanConverter to class java.lang.Boolean
[24/02/2016 23:07:20] Unable to find a converter for class java.lang.Double. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.DoubleConverter to class java.lang.Double
[24/02/2016 23:07:20] Unable to find a converter for long. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.PrimitiveLongConverter to long
[24/02/2016 23:07:20] Found interceptor for class br.com.caelum.vraptor.interceptor.ExceptionHandlerInterceptor
[24/02/2016 23:07:20] Unable to find a converter for class java.lang.String. Returning NullConverter.
[24/02/2016 23:07:20] adding converter class br.com.caelum.vraptor.converter.StringConverter to class java.lang.String
[24/02/2016 23:07:21] Caching br.com.caelum.vraptor.interceptor.FlashInterceptor
[24/02/2016 23:07:21] Caching br.com.caelum.vraptor.jpa.JPATransactionInterceptor
[24/02/2016 23:07:21] Caching br.com.caelum.vraptor.interceptor.ExceptionHandlerInterceptor
[24/02/2016 23:07:21] VRaptor 4.1.4 successfuly initialized
Feb 24, 2016 11:07:21 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /var/lib/openshift/56cc6da77628e117cd0001a8/app-root/runtime/dependencies/jbossews/webapps/ROOT.war has finished in 32,717 ms
Feb 24, 2016 11:07:21 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-127.7.73.129-8080"]
Feb 24, 2016 11:07:21 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 33608 ms
[24/02/2016 23:10:21] VRaptor received a new request org.apache.catalina.connector.RequestFacade@5b8ed5
[24/02/2016 23:10:21] trying to access /
[24/02/2016 23:10:21] VRaptor ended the request
[24/02/2016 23:10:21] VRaptor received a new request org.apache.catalina.connector.RequestFacade@d667eb
[24/02/2016 23:10:21] trying to access /
[24/02/2016 23:10:21] VRaptor ended the request
由于
答案 0 :(得分:0)
您可以通过使用rhc tail查看日志文件(https://developers.openshift.com/en/managing-log-files.html)或通过sshing到您的应用程序并检入〜/ app-root / logs目录来进行故障排除。
您可能想要阅读Developer Portal的这个页面(https://developers.openshift.com/en/tomcat-deployment-options.html),该页面描述了如何在OpenShift Online上将预编译的WAR文件部署到Tomcat 7服务器。
如果您可以获取一些日志文件并在此处发布,那么更有可能有人可以帮助您使应用程序正常运行。您可能缺少一些本地安装的依赖项。