Spring don't displaying webpage and can't found resource - java

I wrote simple Java application using Spring framework and Thymeleaf. On my IDE it's working complettly fine but when I'm making JAR artifact and exporting it to my linux server it's booting but I'm getting this errors:
02:56:06.447 [main] INFO com.ibcs.rfid.RfidApplication - Started RfidApplication in 142.158 seconds (JVM running for 151.664)
Jul 15, 2021 2:56:10 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'dispatcherServlet'
02:56:10.948 [http-nio-8080-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
02:56:10.954 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet - Detected StandardServletMultipartResolver
02:56:10.959 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet - Detected AcceptHeaderLocaleResolver
02:56:10.964 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet - Detected FixedThemeResolver
02:56:11.171 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet - Detected org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator#1db0c88
02:56:11.251 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet - Detected org.springframework.web.servlet.support.SessionFlashMapManager#1384aac
02:56:11.257 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet - enableLoggingRequestDetails='false': request parameters and headers will be masked to prevent unsafe logging of potentially sensitive data
02:56:11.261 [http-nio-8080-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Completed initialization in 308 ms
02:56:11.638 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet - GET "/", parameters={}
02:56:11.745 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped to com.ibcs.rfid.controllers.ServiceControllers#loginForm(Model)
02:56:12.994 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.view.ContentNegotiatingViewResolver - Selected 'text/html' given [text/html, application/xhtml+xml, image/webp, application/xml;q=0.9, */*;q=0.8]
02:56:13.003 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.view.InternalResourceView - View name 'login', model {authentication=com.ibcs.rfid.models.Authentication#14147d2, org.springframework.validation.BindingResult.authentication=org.springframework.validation.BeanPropertyBindingResult: 0 errors}
02:56:13.065 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.view.InternalResourceView - Forwarding to [login]
02:56:13.265 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet - "FORWARD" dispatch for GET "/login", parameters={}
02:56:13.383 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped to ResourceHttpRequestHandler [Classpath [META-INF/resources/], Classpath [resources/], Classpath [static/], Classpath [public/], ServletContext [/]]
02:56:13.434 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.resource.ResourceHttpRequestHandler - Resource not found
02:56:13.441 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet - Exiting from "FORWARD" dispatch, status 404
02:56:13.461 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet - Completed 404 NOT_FOUND
02:56:13.480 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.DispatcherServlet - "ERROR" dispatch for GET "/error", parameters={}
02:56:13.549 [http-nio-8080-exec-1] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#errorHtml(HttpServletRequest, HttpServletResponse)
My files tree:
├───.idea
│ ├───artifacts
│ └───libraries
├───.mvn
│ └───wrapper
├───out
│ └───artifacts
│ └───rfid_jar
├───src
│ ├───main
│ │ ├───java
│ │ │ ├───com
│ │ │ │ └───ibcs
│ │ │ │ └───rfid
│ │ │ │ ├───controllers
│ │ │ │ ├───models
│ │ │ │ └───storers
│ │ │ └───META-INF
│ │ └───resources
│ │ ├───jsons
│ │ ├───static
│ │ │ ├───css
│ │ │ ├───img
│ │ │ └───js
│ │ └───templates
│ └───test
│ └───java
│ └───com
│ └───ibcs
│ └───rfid
└───target
├───classes
│ ├───com
│ │ └───ibcs
│ │ └───rfid
│ │ ├───controllers
│ │ ├───models
│ │ └───storers
│ ├───jsons
│ ├───static
│ │ ├───css
│ │ ├───img
│ │ └───js
│ └───templates
├───generated-sources
│ └───annotations
├───generated-test-sources
│ └───test-annotations
└───test-classes
└───com
└───ibcs
└───rfid
And my application.properties content:
spring.thymeleaf.check-template-location=true
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.mode=LEGACYHTML5
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.content-type=text/html
spring.thymeleaf.cache=false
Also here is part of my Controller:
#GetMapping("/")
public String loginForm(Model model)
{
model.addAttribute("authentication", new Authentication());
return "login";
}
Any ideas how can I fix it?
Also I'm limited to only .jar file cause It have to run on Zebra FX9600

Solution (from comments):
Build it with maven
Thanks M. Deinum

Related

Exclude Test folder and Resources from Gradle Jar build

I am trying to create a Jar to be used as a Maven Repository
I have everything built out and all the classes are ready to go. Only problem is that the gradlew ./build is including the classes and resources from the test folder. I don't want these as part of the jar, especially the resource files under test.
So my question is, How do I exclude these files from my jar build task. I tried
tasks.named('jar'){
exclude('PATH/src/test/')
in my build.gradle but that didn't work
I am a newbiew at gradle and maven so any insight would help. Thanks!
Reference Material
build.gradle
plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
id 'maven-publish'
}
group = 'com.project.tools'
version = '1.0.0'
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
api 'org.apache.commons:commons-math3:3.6.1'
implementation 'com.google.guava:guava:31.0.1-jre'
implementation platform('io.cucumber:cucumber-bom:7.1.0')
implementation 'io.cucumber:cucumber-java'
implementation 'io.cucumber:cucumber-junit-platform-engine'
implementation 'io.cucumber:cucumber-junit'
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
}
tasks.named('jar'){
manifest {
attributes('Implementation-Title': project.name,
'Implementation-Version': project.version)
}
}
File Structure
project/
├─ tools/
│ ├─ build/
│ │ ├─ classes/
│ │ │ ├─ new_folder/
│ │ │ │ ├─ main/
│ │ │ │ ├─ test/ #I Don't Want This Here, This Classes Do Not Need To Be Accessible
│ │ ├─ generated/
│ │ ├─ libs/
│ │ ├─ reports/
│ │ ├─ resources/
│ │ │ ├─ test/ #Would rather not have this entire folder
│ │ │ │ ├─ com.project.tools/
│ │ │ │ ├─ test.properties # Definitely Do Not Want This Included
│ │ ├─ test-results/
│ │ ├─ tmp/
│ ├─ src/
│ │ ├─ main/
│ │ │ ├─ java/
│ │ │ │ ├─ com.project.tools/
│ │ │ │ │ ├─ MyClasses.java
│ │ │ ├─ resources/
│ │ ├─ test/
│ │ │ ├─ java/
│ │ │ │ ├─ com.project.tools/
│ │ │ │ │ ├─ MyTestClasses.java
│ │ │ ├─ resources/
│ ├─ build.gradle
Gradle does the right thing by default, there is no need to manually exclude test classes/resources from the jar.

how to fill a circle inside a small square?

I need to draw/fill circles inside small squares of 5 pixels. but when I do so, it looks just like if I filled a square inside it and not a circle. When trying to fill a circle inside a square of 10 pixels it looks just alright. the test code is really simple:
g.drawRect(10,10,5,5);
g.fillOval(10,10, 5, 5);
g.drawRect(30,30,10,10);
g.fillOval(30,30,10,10);
I get the result shown in the picture
is it just normal or am I doing it the wrong way?
A 5x5 square is actually 6x6 pixels in size, so draw a 6x6 set of boxes representing pixels.
Now draw how you would fill a circle inside that square.
Here, let me show you what the system does:
5x5 Square 5x5 Circle
┌──┬──┬──┬──┬──┬──┐ ┌──┬──┬──┬──┬──┬──┐
│██│██│██│██│██│██│ │ │ │ │ │ │ │
├──┼──┼──┼──┼──┼──┤ ├──┼──┼──┼──┼──┼──┤
│██│ │ │ │ │██│ │ │██│██│██│██│ │
├──┼──┼──┼──┼──┼──┤ ├──┼──┼──┼──┼──┼──┤
│██│ │ │ │ │██│ │ │██│██│██│██│ │
├──┼──┼──┼──┼──┼──┤ ├──┼──┼──┼──┼──┼──┤
│██│ │ │ │ │██│ │ │██│██│██│██│ │
├──┼──┼──┼──┼──┼──┤ ├──┼──┼──┼──┼──┼──┤
│██│ │ │ │ │██│ │ │██│██│██│██│ │
├──┼──┼──┼──┼──┼──┤ ├──┼──┼──┼──┼──┼──┤
│██│██│██│██│██│██│ │ │ │ │ │ │ │
└──┴──┴──┴──┴──┴──┘ └──┴──┴──┴──┴──┴──┘
Now overlay the circle onto your square. You get that filled square you saw.
Combined
┌──┬──┬──┬──┬──┬──┐
│██│██│██│██│██│██│
├──┼──┼──┼──┼──┼──┤
│██│██│██│██│██│██│
├──┼──┼──┼──┼──┼──┤
│██│██│██│██│██│██│
├──┼──┼──┼──┼──┼──┤
│██│██│██│██│██│██│
├──┼──┼──┼──┼──┼──┤
│██│██│██│██│██│██│
├──┼──┼──┼──┼──┼──┤
│██│██│██│██│██│██│
└──┴──┴──┴──┴──┴──┘
10x10 Square 10x10 Circle
┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐ ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐
│██│██│██│██│██│██│██│██│██│██│██│ │ │ │ │ │ │ │ │ │ │ │ │
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│ │ │ │ │ │ │ │ │ │██│ │ │ │ │██│██│██│██│██│ │ │ │
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│ │ │ │ │ │ │ │ │ │██│ │ │ │██│██│██│██│██│██│██│ │ │
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│ │ │ │ │ │ │ │ │ │██│ │ │██│██│██│██│██│██│██│██│██│ │
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│ │ │ │ │ │ │ │ │ │██│ │ │██│██│██│██│██│██│██│██│██│ │
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│ │ │ │ │ │ │ │ │ │██│ │██│██│██│██│██│██│██│██│██│██│ │
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│ │ │ │ │ │ │ │ │ │██│ │ │██│██│██│██│██│██│██│██│██│ │
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│ │ │ │ │ │ │ │ │ │██│ │ │██│██│██│██│██│██│██│██│██│ │
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│ │ │ │ │ │ │ │ │ │██│ │ │ │██│██│██│██│██│██│██│ │ │
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│ │ │ │ │ │ │ │ │ │██│ │ │ │ │██│██│██│██│██│ │ │ │
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│██│██│██│██│██│██│██│██│██│██│ │ │ │ │ │ │ │ │ │ │ │ │
└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘ └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘
Combined
┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐
│██│██│██│██│██│██│██│██│██│██│██│
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│ │ │██│██│██│██│██│ │ │██│
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│ │██│██│██│██│██│██│██│ │██│
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│██│██│██│██│██│██│██│██│██│██│
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│██│██│██│██│██│██│██│██│██│██│
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│██│██│██│██│██│██│██│██│██│██│
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│██│██│██│██│██│██│██│██│██│██│
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│██│██│██│██│██│██│██│██│██│██│
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│ │██│██│██│██│██│██│██│ │██│
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│ │ │██│██│██│██│██│ │ │██│
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤
│██│██│██│██│██│██│██│██│██│██│██│
└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘

Apache Karaf Keycloak integration

I've created my minimal custom Karaf distribution:
mvn archetype:generate \
-DarchetypeGroupId=org.apache.karaf.archetypes \
-DarchetypeArtifactId=karaf-assembly-archetype \
-DarchetypeVersion=4.1.4 \
-DgroupId=my.karaf \
-DartifactId=karaf-custom-distribution \
-Dversion=1.0-SNAPSHOT \
-Dpackage=my.karaf.distribution
cd karaf-custom-distribution
mvn install
cd target/assembly/bin/
./karaf
Then tried to install Keycloak feature into it manually:
feature:repo-add mvn:org.keycloak/keycloak-osgi-features/3.4.3.Final/xml/features
feature:install keycloak-jetty9-adapter
feature:install keycloak
The last command gives me an error back. Any suggestions how to solve this dependency error?
Error executing command: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=keycloak; type=karaf.feature; version="[3.4.3.Final,3.4.3.Final]"; filter:="(&(osgi.identity=keycloak)(type=karaf.feature)(version>=3.4.3.Final)(version<=3.4.3.Final))" [caused by: Unable to resolve keycloak/3.4.3.Final: missing requirement [keycloak/3.4.3.Final] osgi.identity; osgi.identity=keycloak-osgi-adapter; type=karaf.feature [caused by: Unable to resolve keycloak-osgi-adapter/3.4.3.Final: missing requirement [keycloak-osgi-adapter/3.4.3.Final] osgi.identity; osgi.identity=http-whiteboard; type=karaf.feature; version="[2.3.0,4.0.0)"]]
karaf#root()> list
START LEVEL 100 , List Threshold: 50
ID │ State │ Lvl │ Version │ Name
────┼────────┼─────┼─────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────
125 │ Active │ 50 │ 2.6.0 │ Apache Commons IO
126 │ Active │ 50 │ 1.0.1 │ Apache Aries Blueprint Web OSGI
127 │ Active │ 50 │ 4.1.4 │ Apache Karaf :: Diagnostic :: Boot
128 │ Active │ 50 │ 4.1.4 │ Apache Karaf :: Profile :: Core
129 │ Active │ 50 │ 4.1.4 │ Apache Karaf :: Tooling :: Utils
130 │ Active │ 50 │ 4.1.4 │ Apache Karaf :: OSGi Services :: Event
131 │ Active │ 50 │ 1.3.5 │ Jolokia Agent
132 │ Active │ 50 │ 2.20.2 │ camel-blueprint
133 │ Active │ 80 │ 2.20.2 │ camel-commands-core
134 │ Active │ 50 │ 2.20.2 │ camel-core
135 │ Active │ 80 │ 2.20.2 │ camel-karaf-commands
139 │ Active │ 80 │ 1.56 │ bcpkix
140 │ Active │ 80 │ 1.56 │ bcprov
141 │ Active │ 80 │ 2.8.9 │ Jackson-annotations
142 │ Active │ 80 │ 2.8.9 │ Jackson-core
143 │ Active │ 80 │ 2.8.9 │ jackson-databind
144 │ Active │ 80 │ 3.4.3.Final │ Keycloak Adapter Core
145 │ Active │ 80 │ 3.4.3.Final │ Keycloak Adapter SPI
146 │ Active │ 80 │ 3.4.3.Final │ KeyCloak Authz: Client API
147 │ Active │ 80 │ 3.4.3.Final │ Keycloak Common
148 │ Active │ 80 │ 3.4.3.Final │ Keycloak Core
149 │ Active │ 80 │ 3.4.3.Final │ Keycloak Jetty Adapter SPI
150 │ Active │ 80 │ 3.4.3.Final │ Keycloak Jetty Core Integration
151 │ Active │ 80 │ 3.4.3.Final │ Keycloak Jetty 9.2.x Integration
152 │ Active │ 80 │ 3.4.3.Final │ Keycloak OSGI Thirdparty

How to configure Gradle findbugs plugin to provide more description for bugs?

Is there a way to add or link to more bug descriptions in the report?
I mean good explanations of errors like RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE like in the GUI mode.
Some bug titles are not immediately clear.
Example for a description:
RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE : A value is checked
here to see whether it is null, but this value can't be null because
it was previously dereferenced and if it were null a null pointer
exception would have occurred at the earlier dereference. Essentially,
this code and the previous dereference disagree as to whether this
value is allowed to be null. Either the check is redundant or the
previous dereference is erroneous.
You can use Violations Gradle Plugin to do that.
It can accumulate a bunch of report tools and present it nicely in the build log.
...
se/bjurr/violations/lib/example/OtherClass.java
╔══════════╤════════════╤══════════╤══════╤════════════════════════════════════════════════════╗
║ Reporter │ Rule │ Severity │ Line │ Message ║
╠══════════╪════════════╪══════════╪══════╪════════════════════════════════════════════════════╣
║ Findbugs │ MS_SHOULD_ │ INFO │ 7 │ Field isn't final but should be ║
║ │ BE_FINAL │ │ │ ║
║ │ │ │ │ ║
║ │ │ │ │ <p> ║
║ │ │ │ │ This static field public but not final, and ║
║ │ │ │ │ could be changed by malicious code or ║
║ │ │ │ │ by accident from another package. ║
║ │ │ │ │ The field could be made final to avoid ║
║ │ │ │ │ this vulnerability.</p> ║
╟──────────┼────────────┼──────────┼──────┼────────────────────────────────────────────────────╢
║ Findbugs │ NM_FIELD_N │ INFO │ 6 │ Field names should start with a lower case letter ║
║ │ AMING_CONV │ │ │ ║
║ │ ENTION │ │ │ ║
║ │ │ │ │ <p> ║
║ │ │ │ │ Names of fields that are not final should be in mi ║
║ │ │ │ │ xed case with a lowercase first letter and the fir ║
║ │ │ │ │ st letters of subsequent words capitalized. ║
║ │ │ │ │ </p> ║
╚══════════╧════════════╧══════════╧══════╧════════════════════════════════════════════════════╝
Summary of se/bjurr/violations/lib/example/OtherClass.java
╔══════════╤══════╤══════╤═══════╤═══════╗
║ Reporter │ INFO │ WARN │ ERROR │ Total ║
╠══════════╪══════╪══════╪═══════╪═══════╣
║ Findbugs │ 2 │ 0 │ 0 │ 2 ║
╟──────────┼──────┼──────┼───────┼───────╢
║ │ 2 │ 0 │ 0 │ 2 ║
╚══════════╧══════╧══════╧═══════╧═══════╝
Summary
╔════════════╤══════╤══════╤═══════╤═══════╗
║ Reporter │ INFO │ WARN │ ERROR │ Total ║
╠════════════╪══════╪══════╪═══════╪═══════╣
║ Checkstyle │ 4 │ 1 │ 1 │ 6 ║
╟────────────┼──────┼──────┼───────┼───────╢
║ Findbugs │ 2 │ 2 │ 5 │ 9 ║
╟────────────┼──────┼──────┼───────┼───────╢
║ │ 6 │ 3 │ 6 │ 15 ║
╚════════════╧══════╧══════╧═══════╧═══════╝

IntelliJ IDEA building incomplete Grails war

I'm beginning grails development with IntelliJ but just cannot make and deploy a newly created grails app to a local or external Tomcat following the procedure described in this answer
The manager app in Tomcat shows that the application is up and running but I always get http 404 when opening the index page. I noticed that it's possible to download the index.gsp file - it just seems that grails isn't initialized correctly:
These are the versions I tried:
IntelliJ IDEA 12.1.6 Ultimate
Grails 2.1.1, 2.2.4 and 2.3.2
Tomcat 7.0.47 and 6.
These are the detailed steps I took several times, even on different computers, always with same result:
create a new grails app in IntelliJ and launch default run configuration (grails) - so far that's working fine.
set up deployment to a local Tomcat server. I've configured the application server in IntelliJ, creating an artifact (Web Application: Archive or Web Application: Exploded) using the GrailsWeb facet and assigned it to be deployed.
start the local application server and IntelliJ would report that the artifact is deployed successfully
opening the browser will give 404
WHY? What am I doing wrong?
It must be something about the grails plugin in IntelliJ, because I was able to pull an example Java application (spring-petclinic) from github and simply run it in Tomcat without trouble...
Update:
I've noticed that I can manually deploy the war which is generated under target using "Make Grails Web archive". But when I do the same with the war of the artifact under out/... it won't work.
Obviously the latter one wasn't generated correctly: its missing MANIFEST.MF under META-INF and there's also no grails.xml and grails-app under WEB-INF!
Could you please have a look at the facets: Is there something wrong?
I tried many artifact configurations, e.g. this one:
Directory structure generated using the settings above:
Comparing this to the war file generated by grails shows many differences, e.g. the index.gsp is located in the root, not under WEB-INF/grails-app. And there's also no grails.xml under WEB-INF
C:\prj\gtest5\out\artifacts\gtest5_war_exploded>tree /f
Auflistung der Ordnerpfade
Volumeseriennummer : 2842-D2F0
C:.
│ error.gsp
│ index.gsp
│
├───css
│ errors.css
│ main.css
│ mobile.css
│
├───dbdoc
│ _globalnav.gsp
│ _index.gsp
│ _overview-summary.gsp
│ _stylesheet.gsp
│
├───images
│ │ apple-touch-icon-retina.png
│ │ apple-touch-icon.png
│ │ favicon.ico
│ │ grails_logo.jpg
│ │ grails_logo.png
│ │ leftnav_btm.png
│ │ leftnav_midstretch.png
│ │ leftnav_top.png
│ │ spinner.gif
│ │ springsource.png
│ │
│ └───skin
│ database_add.png
│ database_delete.png
│ database_edit.png
│ database_save.png
│ database_table.png
│ exclamation.png
│ house.png
│ information.png
│ shadow.jpg
│ sorted_asc.gif
│ sorted_desc.gif
│
├───js
│ │ application.js
│ │
│ └───jquery
│ jquery-1.8.0.js
│ jquery-1.8.0.min.js
│
├───layouts
│ main.gsp
│
└───WEB-INF
│ applicationContext.xml
│ sitemesh.xml
│
├───classes
│ │ JQueryResourceTagLib$_closure1.class
│ │ JQueryResourceTagLib$_closure2.class
│ │ JQueryResourceTagLib$_closure2_closure4.class
│ │ JQueryResourceTagLib$_closure2_closure5.class
│ │ JQueryResourceTagLib$_closure2_closure6.class
│ │ JQueryResourceTagLib$_closure2_closure7.class
│ │ JQueryResourceTagLib$_closure3.class
│ │ JQueryResourceTagLib.class
│ │ JQueryService$_closure1.class
│ │ JQueryService$_closure2.class
│ │ JQueryService$_closure3.class
│ │ JQueryService$_closure4.class
│ │ JQueryService.class
│ │ JQueryTagLib$_closure1.class
│ │ JQueryTagLib$_closure1_closure6.class
│ │ JQueryTagLib$_closure2.class
│ │ JQueryTagLib$_closure3.class
│ │ JQueryTagLib$_closure4.class
│ │ JQueryTagLib$_closure5.class
│ │ JQueryTagLib.class
│ │ messages.properties
│ │ messages_cs_CZ.properties
│ │ messages_da.properties
│ │ messages_de.properties
│ │ messages_es.properties
│ │ messages_fr.properties
│ │ messages_it.properties
│ │ messages_ja.properties
│ │ messages_nl.properties
│ │ messages_pl.properties
│ │ messages_pt_BR.properties
│ │ messages_pt_PT.properties
│ │ messages_ru.properties
│ │ messages_sv.properties
│ │ messages_th.properties
│ │ messages_zh_CN.properties
│ │
│ ├───grails
│ │ └───plugin
│ │ ├───cache
│ │ │ │ BlockingCache.class
│ │ │ │ Cacheable.class
│ │ │ │ CacheBeanPostProcessor.class
│ │ │ │ CacheConfigArtefactHandler$CacheConfigGrailsClass.class
│ │ │ │ CacheConfigArtefactHandler$DefaultCacheConfigGrailsClass.class
│ │ │ │ CacheConfigArtefactHandler.class
│ │ │ │ CacheConfiguration.class
│ │ │ │ CacheEvict.class
│ │ │ │ CachePut.class
│ │ │ │ CacheTagLib$_closure1.class
│ │ │ │ CacheTagLib$_closure2.class
│ │ │ │ CacheTagLib.class
│ │ │ │ ConfigBuilder.class
│ │ │ │ ConfigLoader$_sortConfigs_closure1.class
│ │ │ │ ConfigLoader.class
│ │ │ │ GrailsAnnotationCacheOperationSource$DefaultCacheKey.class
│ │ │ │ GrailsAnnotationCacheOperationSource.class
│ │ │ │ GrailsCache.class
│ │ │ │ GrailsCacheAdminService.class
│ │ │ │ GrailsCacheManager.class
│ │ │ │ GrailsConcurrentMapCache.class
│ │ │ │ GrailsConcurrentMapCacheManager.class
│ │ │ │ GrailsValueWrapper.class
│ │ │ │ SerializableByteArrayOutputStream.class
│ │ │ │ SerializableOutputStream.class
│ │ │ │ Timer.class
│ │ │ │
│ │ │ ├───compiler
│ │ │ │ CacheTransformation.class
│ │ │ │
│ │ │ ├───util
│ │ │ │ ClassUtils.class
│ │ │ │
│ │ │ └───web
│ │ │ │ AlreadyGzippedException.class
│ │ │ │ ContentCacheParameters.class
│ │ │ │ GenericResponseWrapper$1.class
│ │ │ │ GenericResponseWrapper.class
│ │ │ │ Header$Type.class
│ │ │ │ Header.class
│ │ │ │ HttpDateFormatter.class
│ │ │ │ PageInfo.class
│ │ │ │ ProxyAwareMixedGrailsControllerHelper.class
│ │ │ │ SerializableCookie.class
│ │ │ │
│ │ │ └───filter
│ │ │ │ AbstractFilter.class
│ │ │ │ CacheExpressionRootObject.class
│ │ │ │ CacheOperationContext.class
│ │ │ │ DefaultWebKeyGenerator.class
│ │ │ │ ExpressionEvaluator.class
│ │ │ │ FilterServletOutputStream.class
│ │ │ │ LazyParamAwareEvaluationContext.class
│ │ │ │ NoOpFilter.class
│ │ │ │ PageFragmentCachingFilter$1.class
│ │ │ │ PageFragmentCachingFilter$2.class
│ │ │ │ PageFragmentCachingFilter$CacheStatus.class
│ │ │ │ PageFragmentCachingFilter.class
│ │ │ │ WebKeyGenerator.class
│ │ │ │
│ │ │ └───simple
│ │ │ MemoryBlockingCache.class
│ │ │ MemoryCacheConfiguration.class
│ │ │ MemoryPageFragmentCachingFilter.class
│ │ │
│ │ ├───databasemigration
│ │ │ │ ChangelogXml2Groovy$_appendAttrs_closure1.class
│ │ │ │ ChangelogXml2Groovy$_appendWithIndent_closure2.class
│ │ │ │ ChangelogXml2Groovy.class
│ │ │ │ DbdocController$_closure1.class
│ │ │ │ DbdocController.class
│ │ │ │ DslBuilder$1.class
│ │ │ │ DslBuilder$_expandExpressions_closure1.class
│ │ │ │ DslBuilder$_extractZipFile_closure3.class
│ │ │ │ DslBuilder$_handleIncludedChangeLog_closure7.class
│ │ │ │ DslBuilder$_processIncludeAll_closure2.class
│ │ │ │ DslBuilder$_processProperty_closure5.class
│ │ │ │ DslBuilder$_processRollback_closure4.class
│ │ │ │ DslBuilder$_setPropertiesFromAttributes_closure6.class
│ │ │ │ DslBuilder.class
│ │ │ │ GormDatabase.class
│ │ │ │ GormDatabaseSnapshotGenerator$_createIdentifierGenerator_closure4.class
│ │ │ │ GormDatabaseSnapshotGenerator$_createSnapshot_closure1.class
│ │ │ │ GormDatabaseSnapshotGenerator$_createSnapshot_closure2.class
│ │ │ │ GormDatabaseSnapshotGenerator$_isIdentityColumn_closure3.class
│ │ │ │ GormDatabaseSnapshotGenerator.class
│ │ │ │ GormDatabaseTypeConverter.class
│ │ │ │ GrailsChange$1.class
│ │ │ │ GrailsChange.class
│ │ │ │ GrailsChangeLogParser$_setChangelogProperties_closure1.class
│ │ │ │ GrailsChangeLogParser.class
│ │ │ │ GrailsClassLoaderResourceAccessor.class
│ │ │ │ GrailsDiffStatusListener.class
│ │ │ │ GrailsPrecondition$1.class
│ │ │ │ GrailsPrecondition.class
│ │ │ │ GroovyAwareStringChangeLogSerializer.class
│ │ │ │ Log4jLogger.class
│ │ │ │ MigrationRunner$_autoRun_closure1.class
│ │ │ │ MigrationRunner.class
│ │ │ │ MigrationUtils$_getDatabase_closure1.class
│ │ │ │ MigrationUtils.class
│ │ │ │ MysqlAwareCreateTableGenerator.class
│ │ │ │ ScriptUtils$_appendToChangelog_closure2.class
│ │ │ │ ScriptUtils$_appendToChangelog_closure2_closure3.class
│ │ │ │ ScriptUtils$_appendToChangelog_closure2_closure4.class
│ │ │ │ ScriptUtils$_executeAndWrite_closure1.class
│ │ │ │ ScriptUtils.class
│ │ │ │
│ │ │ └───dbdoc
│ │ │ AuthorListWriter.class
│ │ │ AuthorWriter.class
│ │ │ ChangeLogListWriter.class
│ │ │ ChangeLogWriter.class
│ │ │ ColumnWriter.class
│ │ │ HTMLListWriter.class
│ │ │ HTMLWriter.class
│ │ │ MemoryDocVisitor.class
│ │ │ PendingChangesWriter.class
│ │ │ PendingSQLWriter.class
│ │ │ RecentChangesWriter.class
│ │ │ TableListWriter.class
│ │ │ TableWriter$_writeCustomHTML_closure1.class
│ │ │ TableWriter.class
│ │ │
│ │ └───webxml
│ │ FilterManager.class
│ │
│ └───org
│ ├───codehaus
│ │ └───groovy
│ │ └───grails
│ │ └───plugins
│ │ └───jquery
│ │ JQueryConfig$_init_closure1.class
│ │ JQueryConfig$_init_closure2.class
│ │ JQueryConfig.class
│ │ JQueryProvider$_doRemoteFunction_closure1.class
│ │ JQueryProvider$_doRemoteFunction_closure2.class
│ │ JQueryProvider$_doRemoteFunction_closure3.class
│ │ JQueryProvider$_doRemoteFunction_closure4.class
│ │ JQueryProvider.class
│ │
│ └───grails
│ └───plugin
│ ├───resource
│ │ │ AggregatedResourceMeta$_buildAggregateResource_closure3.class
│ │ │ AggregatedResourceMeta$_buildAggregateResource_closure3_closure4.class
│ │ │ AggregatedResourceMeta$_containsResource_closure1.class
│ │ │ AggregatedResourceMeta$_isDirty_closure2.class
│ │ │ AggregatedResourceMeta.class
│ │ │ CSSBundleResourceMeta.class
│ │ │ CSSLinkProcessor$_process_closure1.class
│ │ │ CSSLinkProcessor.class
│ │ │ DevModeSanityFilter.class
│ │ │ JavaScriptBundleResourceMeta.class
│ │ │ ProcessingFilter.class
│ │ │ ResourceMeta$_reset_closure1.class
│ │ │ ResourceMeta.class
│ │ │ ResourceModule$_closure1.class
│ │ │ ResourceModule$_getRequiredDispositions_closure3.class
│ │ │ ResourceModule$_newResourceFromArgs_closure2.class
│ │ │ ResourceModule.class
│ │ │ ResourceProcessor$_afterPropertiesSet_closure5.class
│ │ │ ResourceProcessor$_afterPropertiesSet_closure6.class
│ │ │ ResourceProcessor$_canProcessLegacyResource_closure7.class
│ │ │ ResourceProcessor$_canProcessLegacyResource_closure8.class
│ │ │ ResourceProcessor$_defineModuleFromBuilder_closure16.class
│ │ │ ResourceProcessor$_dumpResources_closure21.class
│ │ │ ResourceProcessor$_dumpResources_closure21_closure35.class
│ │ │ ResourceProcessor$_dumpResources_closure21_closure36.class
│ │ │ ResourceProcessor$_dumpResources_closure22.class
│ │ │ ResourceProcessor$_dumpStats_closure20.class
│ │ │ ResourceProcessor$_dumpStats_closure20_closure34.class
│ │ │ ResourceProcessor$_findSyntheticResourceById_closure9.class
│ │ │ ResourceProcessor$_getConfigParamOrDefault_closure23.class
│ │ │ ResourceProcessor$_getResourceMetaForURI_closure10.class
│ │ │ ResourceProcessor$_getResourceMetaForURI_closure10_closure27.class
│ │ │ ResourceProcessor$_getServletContext_closure24.class
│ │ │ ResourceProcessor$_loadModules_closure17.class
│ │ │ ResourceProcessor$_loadModules_closure18.class
│ │ │ ResourceProcessor$_loadModules_closure18_closure30.class
│ │ │ ResourceProcessor$_loadModules_closure18_closure31.class
│ │ │ ResourceProcessor$_loadModules_closure18_closure31_closure32.class
│ │ │ ResourceProcessor$_loadModules_closure18_closure31_closure33.class
│ │ │ ResourceProcessor$_loadModules_closure19.class
│ │ │ ResourceProcessor$_makeFileSystemPathFromURI_closure11.class
│ │ │ ResourceProcessor$_prepareResourceBatch_closure13.class
│ │ │ ResourceProcessor$_prepareResourceBatch_closure14.class
│ │ │ ResourceProcessor$_prepareResourceBatch_closure14_closure28.class
│ │ │ ResourceProcessor$_prepareResourceBatch_closure14_closure29.class
│ │ │ ResourceProcessor$_prepareResourceBatch_closure15.class
│ │ │ ResourceProcessor$_prepareSingleDeclaredResource_closure12.class
│ │ │ ResourceProcessor$_updateDependencyOrder_closure1.class
│ │ │ ResourceProcessor$_updateDependencyOrder_closure2.class
│ │ │ ResourceProcessor$_updateDependencyOrder_closure3.class
│ │ │ ResourceProcessor$_updateDependencyOrder_closure3_closure25.class
│ │ │ ResourceProcessor$_updateDependencyOrder_closure4.class
│ │ │ ResourceProcessor$_updateDependencyOrder_closure4_closure26.class
│ │ │ ResourceProcessor.class
│ │ │ ResourceProcessorBatch.class
│ │ │ ResourceTagLib$_closure1.class
│ │ │ ResourceTagLib$_closure10.class
│ │ │ ResourceTagLib$_closure10_closure17.class
│ │ │ ResourceTagLib$_closure1_closure15.class
│ │ │ ResourceTagLib$_closure2.class
│ │ │ ResourceTagLib$_closure3.class
│ │ │ ResourceTagLib$_closure4.class
│ │ │ ResourceTagLib$_closure5.class
│ │ │ ResourceTagLib$_closure5_closure16.class
│ │ │ ResourceTagLib$_closure6.class
│ │ │ ResourceTagLib$_closure7.class
│ │ │ ResourceTagLib$_closure8.class
│ │ │ ResourceTagLib$_closure9.class
│ │ │ ResourceTagLib$_resolveResourceAndURI_closure12.class
│ │ │ ResourceTagLib$_writeAttrs_closure11.class
│ │ │ ResourceTagLib$__clinit__closure13.class
│ │ │ ResourceTagLib$__clinit__closure14.class
│ │ │ ResourceTagLib.class
│ │ │ URLUtils.class
│ │ │
│ │ ├───mapper
│ │ │ MapperPhase.class
│ │ │ ResourceMapper$_closure1.class
│ │ │ ResourceMapper$_getDefaultExcludes_closure8.class
│ │ │ ResourceMapper$_getDefaultIncludes_closure9.class
│ │ │ ResourceMapper$_getExcludes_closure10.class
│ │ │ ResourceMapper$_getExcludingPattern_closure2.class
│ │ │ ResourceMapper$_getIncludes_closure11.class
│ │ │ ResourceMapper$_getIncludingPattern_closure3.class
│ │ │ ResourceMapper$_getName_closure7.class
│ │ │ ResourceMapper$_getOperation_closure5.class
│ │ │ ResourceMapper$_getPhase_closure4.class
│ │ │ ResourceMapper$_getPriority_closure6.class
│ │ │ ResourceMapper.class
│ │ │ ResourceMappersFactory$_createResourceMappers_closure1.class
│ │ │ ResourceMappersFactory$_createResourceMappers_closure2.class
│ │ │ ResourceMappersFactory$_createResourceMappers_closure2_closure7.class
│ │ │ ResourceMappersFactory$_createResourceMappers_closure3.class
│ │ │ ResourceMappersFactory$_createResourceMappers_closure4.class
│ │ │ ResourceMappersFactory$_createResourceMappers_closure5.class
│ │ │ ResourceMappersFactory$_createResourceMappers_closure6.class
│ │ │ ResourceMappersFactory.class
│ │ │
│ │ ├───module
│ │ │ ModuleBuilder.class
│ │ │ ModuleDeclarationsFactory$_getModuleDeclarations_closure1.class
│ │ │ ModuleDeclarationsFactory$_getModuleDeclarations_closure2.class
│ │ │ ModuleDeclarationsFactory$_getModuleDeclarations_closure3.class
│ │ │ ModuleDeclarationsFactory.class
│ │ │ ModulesBuilder$_invokeMethod_closure1.class
│ │ │ ModulesBuilder.class
│ │ │
│ │ └───util
│ │ HalfBakedLegacyLinkGenerator.class
│ │ ResourceMetaStore$_addResource_closure1.class
│ │ ResourceMetaStore.class
│ │
│ └───resources
│ └───artefacts
│ AbstractResourcesArtefactHandler.class
│ DefaultResourceMapperClass.class
│ DefaultResourcesClass.class
│ ResourceMapperArtefactHandler.class
│ ResourceMapperClass.class
│ ResourcesArtefactHandler.class
│ ResourcesClass.class
│
├───lib
│ ant-1.8.2.jar
│ ant-junit-1.8.2.jar
│ ant-launcher-1.8.2.jar
│ ant-trax-1.7.1.jar
│ antlr-2.7.7.jar
│ aopalliance-1.0.jar
│ asm-3.1.jar
│ aspectjrt-1.6.10.jar
│ aspectjweaver-1.6.10.jar
│ bcmail-jdk14-138.jar
│ bcpg-jdk15-1.45.jar
│ bcprov-jdk15-1.45.jar
│ cglib-2.2.jar
│ commons-beanutils-1.8.3.jar
│ commons-cli-1.2.jar
│ commons-codec-1.5.jar
│ commons-collections-3.2.1.jar
│ commons-dbcp-1.4.jar
│ commons-el-1.0.jar
│ commons-fileupload-1.2.2.jar
│ commons-io-2.1.jar
│ commons-lang-2.6.jar
│ commons-pool-1.5.6.jar
│ commons-validator-1.3.1.jar
│ concurrentlinkedhashmap-lru-1.2_jdk5.jar
│ core-renderer-R8.jar
│ dom4j-1.6.1.jar
│ ecj-3.7.2.jar
│ ehcache-core-2.4.6.jar
│ gant_groovy1.8-1.9.6.jar
│ grails-2.1.1.jar
│ grails-bootstrap-2.1.1.jar
│ grails-core-2.1.1.jar
│ grails-crud-2.1.1.jar
│ grails-datastore-core-1.1.0.RELEASE.jar
│ grails-datastore-gorm-1.1.0.RELEASE.jar
│ grails-datastore-simple-1.1.0.RELEASE.jar
│ grails-docs-2.1.1.jar
│ grails-gdoc-engine-1.0.1.jar
│ grails-hibernate-2.1.1.jar
│ grails-logging-2.1.1.jar
│ grails-plugin-async-2.1.1.jar
│ grails-plugin-codecs-2.1.1.jar
│ grails-plugin-controllers-2.1.1.jar
│ grails-plugin-converters-2.1.1.jar
│ grails-plugin-datasource-2.1.1.jar
│ grails-plugin-domain-class-2.1.1.jar
│ grails-plugin-filters-2.1.1.jar
│ grails-plugin-gsp-2.1.1.jar
│ grails-plugin-i18n-2.1.1.jar
│ grails-plugin-log4j-2.1.1.jar
│ grails-plugin-mimetypes-2.1.1.jar
│ grails-plugin-scaffolding-2.1.1.jar
│ grails-plugin-services-2.1.1.jar
│ grails-plugin-servlets-2.1.1.jar
│ grails-plugin-testing-2.1.1.jar
│ grails-plugin-tomcat-2.1.1.jar
│ grails-plugin-url-mappings-2.1.1.jar
│ grails-plugin-validation-2.1.1.jar
│ grails-resources-2.1.1.jar
│ grails-scripts-2.1.1.jar
│ grails-spring-2.1.1.jar
│ grails-test-2.1.1.jar
│ grails-test-suite-base-2.1.1.jar
│ grails-web-2.1.1.jar
│ grails-webflow-2.1.1.jar
│ grails-wrapper-support-2.1.1.jar
│ groovy-all-1.8.8.jar
│ h2-1.3.164.jar
│ hamcrest-core-1.1.jar
│ hibernate-commons-annotations-3.2.0.Final.jar
│ hibernate-core-3.6.10.Final.jar
│ hibernate-ehcache-3.6.10.Final.jar
│ hibernate-jpa-2.0-api-1.0.1.Final.jar
│ hibernate-validator-4.1.0.Final.jar
│ hsqldb-1.8.0.10.jar
│ itext-2.0.8.jar
│ ivy-2.2.0.jar
│ jansi-1.2.1.jar
│ javassist-3.16.1-GA.jar
│ javax.servlet-api-3.0.1.jar
│ jcl-over-slf4j-1.6.2.jar
│ jline-1.0.jar
│ jna-3.2.3.jar
│ json-simple-1.1.jar
│ jsp-api-2.0.jar
│ jsp-api-2.1.jar
│ jstl-1.1.2.jar
│ jta-1.1.jar
│ jul-to-slf4j-1.6.2.jar
│ junit-4.10.jar
│ liquibase-core-2.0.5.jar
│ log4j-1.2.16.jar
│ ognl-2.7.3.jar
│ org.springframework.uaa.client-1.0.1.RELEASE.jar
│ oro-2.0.8.jar
│ persistence-api-1.0.jar
│ protobuf-java-2.4.1.jar
│ serializer-2.7.1.jar
│ servlet-api-2.4.jar
│ sitemesh-2.4.jar
│ slf4j-api-1.6.2.jar
│ snakeyaml-1.8.jar
│ spring-aop-3.1.2.RELEASE.jar
│ spring-asm-3.1.2.RELEASE.jar
│ spring-aspects-3.1.2.RELEASE.jar
│ spring-beans-3.1.2.RELEASE.jar
│ spring-binding-2.0.8.RELEASE.jar
│ spring-context-3.1.2.RELEASE.jar
│ spring-context-support-3.1.2.RELEASE.jar
│ spring-core-3.1.2.RELEASE.jar
│ spring-expression-3.1.2.RELEASE.jar
│ spring-jdbc-3.1.2.RELEASE.jar
│ spring-jms-3.1.2.RELEASE.jar
│ spring-js-2.0.8.RELEASE.jar
│ spring-orm-3.1.2.RELEASE.jar
│ spring-test-3.1.2.RELEASE.jar
│ spring-tx-3.1.2.RELEASE.jar
│ spring-web-3.1.2.RELEASE.jar
│ spring-webflow-2.0.8.RELEASE.jar
│ spring-webmvc-3.1.2.RELEASE.jar
│ springloaded-core-1.0.6.jar
│ standard-1.1.2.jar
│ tomcat-annotations-api-7.0.30.jar
│ tomcat-api-7.0.30.jar
│ tomcat-catalina-7.0.30.jar
│ tomcat-catalina-ant-7.0.30.jar
│ tomcat-coyote-7.0.30.jar
│ tomcat-embed-core-7.0.30.jar
│ tomcat-embed-jasper-7.0.30.jar
│ tomcat-embed-logging-juli-7.0.30.jar
│ tomcat-embed-logging-log4j-7.0.30.jar
│ tomcat-juli-7.0.30.jar
│ tomcat-servlet-api-7.0.30.jar
│ tomcat-util-7.0.30.jar
│ validation-api-1.0.0.GA.jar
│ xpp3_min-1.1.4c.jar
│
└───tld
c.tld
fmt.tld
grails.tld
spring.tld
It's actually a known issue:
IDEA-72093 Allow to deploy in run configuration war created by "grails war"
You should use workaround from the first comment:
When you run server, you need to do two things: run Build | Make
Grails Web Archive, and then run server's run configuration with
created war added as external source.
In case you are not aware of the external source option, check this screenshot.

Categories