Error deploying application to glassFIsh

I just deployed a glass fish attachment. What I did, I created a directory structure. HelloWorld-> index.jsp, WEB-INF-> sun-web.xml, web.xml. MY index.jsp is just a page that prints HelloWorld

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

Then I went to the HelloWorld directory and issued the following command

 jar cvf helloworld.war . 

War file created. Then I deployed the application to GlassFish using the admin console. In context, I wrote / HelloWorld. But then I tried to open the application using http: // localhost: 8080 / HelloWorld /

Then I got an error that

 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 

In my environment the path is set to

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

I have java on my classpath, why am I getting this error? I am using windows 7.

thanks

+6
source share
3 answers

Somehow glass fish rises to another JRE installation on your machine. Try setting the AS_JAVA environment variable: http://www.java.net/node/702274

+3
source

You just need to specify the path without spaces.

create a symlink first

 mklink /D c:\as_java C:\Program Files\Java\jdk1.6.0_06\ 

and create and set the AS_JAVA environment variable in c: \ as_java

+2
source

go to the GFdirectory / bin / asadmin.bat file and manually replace ALL occurrences

 set JAVA=<...> 

from

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

hardcoding always works 100% =)

0
source

Source: https://habr.com/ru/post/914033/


All Articles