无法在AWS上部署jboss

时间:2018-07-25 10:53:32

标签: amazon-web-services jboss

人们。

我正在按照本教程在AWS上部署c3-pro堆栈:

https://github.com/C3-PRO/c3-pro-server

我已经完成了所有步骤,这些是我的配置文件:

standalone.xml

<datasource jndi-name="java:jboss/datasources/c3proDS" pool-name="c3proDS" enabled="true" use-java-context="true">
                <connection-url>jdbc:oracle:thin:@localhost:1521:XE</connection-url>
                <driver>ojdbc14.jar</driver>
                <security>
                    <security-domain>secure-c3pro-credentials</security-domain>
                </security>
            </datasource>
            <drivers>

这是安全域部分(请注意,我在本教程中删除了c3proAuthDS中的“ auth”部分)

<security-domain name="StaticUserPwd" cache-type="default">
<authentication>
    <login-module code="org.bch.security.oauth.OAuth2LoginModule" flag="required">
        <module-option name="dsJndiName" value="java:jboss/datasources/c3proDS"/>
        <module-option name="principalsQuery" value="select passwd from Users where username=?"/>
        <module-option name="rolesQuery" value="select userRoles, 'Roles' from UserRoles where username=?"/>
        <module-option name="hashAlgorithm" value="SHA1"/>
        <module-option name="hashEncoding" value="BASE64"/>
        <module-option name="hashCharset" value="UTF-8"/>
        <module-option name="hashUserPassword" value="true"/>
        <module-option name="hashStorePassword" value="false"/>
    </login-module>
</authentication>

我还将ojdbc14.jar复制到jboss的部署文件夹中:

 cd /usr/share/jboss-as-7.1.1.Final/standalone/deployments/
ojdbc14.jar           ojdbc14.jar.deployed  README.txt 

当我尝试启动jboss时,出现以下错误:

  

sh /usr/share/jboss-as-7.1.1.Final/bin/standalone.sh

================================================ ========================

  JBoss Bootstrap Environment

  JBOSS_HOME: /usr/share/jboss-as-7.1.1.Final

  JAVA: /usr/lib/jvm/java/bin/java

  JAVA_OPTS:  -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml

=========================================================================

10:40:12,511 INFORMACIÓN [org.jboss.modules] JBoss Modules version 1.1.5.GA
10:40:12,797 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
10:40:12,852 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
10:40:13,971 INFO  [org.xnio] XNIO Version 3.0.3.GA
10:40:13,995 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
10:40:14,006 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
10:40:14,018 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.3.GA
10:40:14,069 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
10:40:14,082 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
10:40:14,117 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
10:40:14,165 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
10:40:14,169 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
10:40:14,209 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
10:40:14,238 INFO  [org.jboss.as.connector] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
10:40:14,277 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
10:40:14,311 INFO  [org.jboss.as.security] (MSC service thread 1-2) JBAS013100: Current PicketBox version=4.0.7.Final
10:40:14,361 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
10:40:14,423 INFO  [org.jboss.as.naming] (MSC service thread 1-1) JBAS011802: Starting Naming Service
10:40:14,699 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) JBAS015400: Bound mail session [java:jboss/mail/Default]
10:40:14,760 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-2) JBoss Web Services - Stack CXF Server 4.0.2.GA
10:40:15,218 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) Arrancando Coyote HTTP/1.1 en puerto http--127.0.0.1-8080
10:40:15,573 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on /127.0.0.1:9999
10:40:15,580 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) JBAS015012: Started FileSystemDeploymentService for directory /usr/share/jboss-as-7.1.1.Final/standalone/deployments
10:40:15,667 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on /127.0.0.1:4447
10:40:15,672 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
10:40:15,892 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014775:    New missing/unsatisfied dependencies:
      service jboss.jdbc-driver.ojdbc14_jar (missing) dependents: [service jboss.data-source.java:jboss/datasources/c3proDS] 

10:40:15,928 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "ojdbc14.jar"
10:40:16,305 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 10.2)
10:40:16,415 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/datasources/c3proDS]
10:40:16,417 INFO  [org.jboss.as] (MSC service thread 1-1) JBAS015951: Admin console listening on http://127.0.0.1:9990
10:40:16,417 INFO  [org.jboss.as] (MSC service thread 1-1) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 4233ms - Started 159 of 237 services (76 services are passive or on-demand)
10:40:16,476 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "ojdbc14.jar"
10:40:16,476 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014776:    Newly corrected services:
      service jboss.jdbc-driver.ojdbc14_jar (no longer required)

然后我必须用CTRL + C取消它,因为我不能再写了。

我尝试使用&在后台运行它,然后尝试运行

MVN清洁包装 和 mvn jboss-as:deploy

这就是我得到的:

  

MVN清洁包

[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building c3pro server 1.1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ c3pro-server ---
[INFO] Deleting /home/ec2-user/c3-pro/c3-pro-server/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ c3pro-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ c3pro-server ---
[INFO] Compiling 26 source files to /home/ec2-user/c3-pro/c3-pro-server/target/classes
[INFO] 
[INFO] --- maven-jar-plugin:2.6:jar (make-a-jar) @ c3pro-server ---
[INFO] Building jar: /home/ec2-user/c3-pro/c3-pro-server/target/c3pro-server.jar
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ c3pro-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ c3pro-server ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.4.3:test (default-test) @ c3pro-server ---
[INFO] Surefire report directory: /home/ec2-user/c3-pro/c3-pro-server/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-war-plugin:2.2:war (default-war) @ c3pro-server ---
[INFO] Packaging webapp
[INFO] Assembling webapp [c3pro-server] in [/home/ec2-user/c3-pro/c3-pro-server/target/c3pro-server]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/ec2-user/c3-pro/c3-pro-server/src/main/webapp]
[INFO] Webapp assembled in [603 msecs]
[INFO] Building war: /home/ec2-user/c3-pro/c3-pro-server/target/c3pro-server.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.520 s
[INFO] Finished at: 2018-07-25T10:43:12Z
[INFO] Final Memory: 22M/54M
[INFO] ------------------------------------------------------------------------
  

mvn jboss-as:deploy

    [INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building c3pro server 1.1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> jboss-as-maven-plugin:7.3.Final:deploy (default-cli) > package @ c3pro-server >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ c3pro-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ c3pro-server ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-jar-plugin:2.6:jar (make-a-jar) @ c3pro-server ---
[INFO] Building jar: /home/ec2-user/c3-pro/c3-pro-server/target/c3pro-server.jar
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ c3pro-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ c3pro-server ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.4.3:test (default-test) @ c3pro-server ---
[INFO] Surefire report directory: /home/ec2-user/c3-pro/c3-pro-server/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-war-plugin:2.2:war (default-war) @ c3pro-server ---
[INFO] Packaging webapp
[INFO] Assembling webapp [c3pro-server] in [/home/ec2-user/c3-pro/c3-pro-server/target/c3pro-server]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/ec2-user/c3-pro/c3-pro-server/src/main/webapp]
[INFO] Webapp assembled in [327 msecs]
[INFO] Building war: /home/ec2-user/c3-pro/c3-pro-server/target/c3pro-server.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] 
[INFO] <<< jboss-as-maven-plugin:7.3.Final:deploy (default-cli) < package @ c3pro-server <<<
[INFO] 
[INFO] 
[INFO] --- jboss-as-maven-plugin:7.3.Final:deploy (default-cli) @ c3pro-server ---
jul 25, 2018 10:45:00 AM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.7.GA
jul 25, 2018 10:45:00 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.7.GA
jul 25, 2018 10:45:00 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.12.GA
10:45:04,178 INFO  [org.jboss.as.repository] (management-handler-thread - 1) JBAS014900: Content added at location /usr/share/jboss-as-7.1.1.Final/standalone/data/content/ae/321f027724d11967669f345f2941400cb2e85a/content
10:45:04,195 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "c3pro-server.war"
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000df322000, 33685504, 0) failed; error='No se pudo asignar memoria' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 33685504 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /tmp/jvm-3373/hs_error.log
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.796 s
[INFO] Finished at: 2018-07-25T10:45:06Z
[INFO] Final Memory: 18M/128M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.3.Final:deploy (default-cli) on project c3pro-server: Error executing FORCE_DEPLOY: Operation failed: Channel closed -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

这是内存问题吗?在这种情况下,我该如何解决?

谢谢。

1 个答案:

答案 0 :(得分:-1)

通过将实例更改为具有4GB RAM的实例来解决。