6

アプリケーションを Glass Fish にデプロイしました。私がしたことは、ディレクトリ構造を作りました。HelloWorld->index.jsp、WEB-INF->sun-web.xml、web.xml。私のindex.jspは、HelloWorldを印刷する単なるページです

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<html>
    <head>
        <title>Hello World! Page</title>
    </head>
    <body>
        <h1>Hello World!</h1>
    </body>
</html>

次に、HelloWorld ディレクトリに移動し、次のコマンドを発行します。

jar cvf helloworld.war .

war ファイルが作成されました。次に、管理コンソールを使用してアプリケーションを GlassFish にデプロイしました。コンテキストでは、/HelloWorld と書きました。しかし、その後、 http://localhost:8080/HelloWorld/を使用してアプリケーションを開こうとしました

次に、エラーが発生しました

type Exception report
message
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
exception

org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac.  A full JDK (not just JRE) is required

私のパス環境はに設定されています

;C:\Program Files\Java\jdk1.6.0_06\bin;C:\Program Files\glassfish-3.0.1\bin;

クラスパスに Java がありますが、なぜこのエラーが発生するのですか? Windows 7を使用しています。

ありがとう

4

3 に答える 3

3

どういうわけか、マシンにインストールされている別の JRE で GlassFish が検出されます。AS_JAVA 環境変数を設定してみてください: http://www.java.net/node/702274

于 2012-04-24T19:05:07.297 に答える
0

GFdirectory/bin/asadmin.bat ファイルに移動し、すべての出現を手動で置き換えます

set JAVA=<...>

set JAVA="<absolute_java_path>\bin\java"

ハードコーディングは常に 100% 機能します =)

于 2014-09-06T08:39:19.263 に答える