I'm new to grails and am trying to compile and run an app from the source code that a vendor provided to us. I'm doing this in IntelliJ, but am just trying to run it within the terminal. I was able to compile the app successfully at the command line. Now when I try grails run-app, it runs through a series of outputs, and then stops at:
Configuring Spring Security Core ...
... finished configuring Spring Security Core
And then it stops and the prompt returns. Here's the entire output:
C:\Users\xxx.xxx\Documents\Repositories\xe_repo\banner_student_ssb_app>grails
run-app --verbose --stacktrace Java HotSpot(TM) 64-Bit Server VM
warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option
PermSize=256m; support was removed in 8.0 Picked up _JAVA_OPTIONS:
-Xmx768M -Xms768M -XX:MaxPermSize=256m -XX:PermSize=256m Java HotSpot(TM) 64-Bit Server VM warning: ignoring option
MaxPermSize=256m; support was removed in 8.0 Java HotSpot(TM) 64-Bit
Server VM warning: ignoring option PermSize=256m; support was removed
in 8.0 Base Directory:
C:\Users\xxx.xxx\Documents\Repositories\xe_repo\banner_student_ssb_app
| Packaging Grails application extraSrcDirs =
C:\Users\xxx.xxx\Documents\Repositories\xe_repo\banner_student_ssb_app/src/installer/groovy
extraSrcDirs =
C:\Users\xxx.xxx\Documents\Repositories\xe_repo\banner_student_ssb_app/src/installer/i18n
extraSrcDirs =
C:\Users\xxx.xxx\Documents\Repositories\xe_repo\banner_student_ssb_app/src/installer/spring
[copy] Warning: C:\Users\xxx.xxx\Documents\Repositories\xe_repo\banner_student_ssb_app\src\installer\groovy
does not exist.
[copy] Warning: C:\Users\xxx.xxx\Documents\Repositories\xe_repo\banner_student_ssb_app\src\installer\i18n
does not exist.
[copy] Warning: C:\Users\xxx.xxx\Documents\Repositories\xe_repo\banner_student_ssb_app\src\installer\spring
does not exist. | Compiling 2 source files | Compiling 2
source files | Compiling 2 source files..... configuration:
file:C:\Users\xxx.xxx/.grails/banner_configuration.groovy
configuration:
file:C:\Users\xxx.xxx/.grails/StudentSSB_configuration.groovy
configuration: classpath:WebAppExtensibilityConfig.class 2016-11-10
16:37:38,714 [main] INFO configuration.ApplicationConfigurationUtils
- Using configuration file '$HOME/.grails/banner_configuration.groovy' 2016-11-10 16:37:38,716 [main] INFO
configuration.ApplicationConfigurationUtils - Using configuration
file '$HOME/.grails/StudentSSB_configuration.groovy' 2016-11-10
16:37:38,719 [main] INFO configuration.ApplicationConfigurationUtils
- Using configuration file WebAppExtensibilityConfig.class from the classpath (e.g., from within the war file) configuration:
file:C:\Users\xxx.xxx/.grails/banner_configuration.groovy
configuration:
file:C:\Users\xxx.xxx/.grails/StudentSSB_configuration.groovy
configuration: classpath:WebAppExtensibilityConfig.class | Running
Grails application 2016-11-10 16:37:47,779 [localhost-startStop-1]
INFO configuration.ApplicationConfigurationUtils - Using
configuration file '$HOME/.grails/banner_configuration.groovy'
2016-11-10 16:37:47,782 [localhost-startStop-1] INFO
configuration.ApplicationConfigurationUtils - Using configuration
file '$HOME/.grails/StudentSSB_configuration.groovy' 2016-11-10
16:37:47,790 [localhost-startStop-1] INFO
configuration.ApplicationConfigurationUtils - Using configuration
file WebAppExtensibilityConfig.class from the classpath (e.g., from
within the war file) configuration:
file:C:\Users\xxx.xxx/.grails/banner_configuration.groovy
configuration:
file:C:\Users\xxx.xxx/.grails/StudentSSB_configuration.groovy
configuration: classpath:WebAppExtensibilityConfig.class 2016-11-10
16:37:54,007 [localhost-startStop-1] INFO
configuration.ApplicationConfigurationUtils - Using configuration
file '$HOME/.grails/banner_configuration.groovy' 2016-11-10
16:37:54,008 [localhost-startStop-1] INFO
configuration.ApplicationConfigurationUtils - Using configuration
file '$HOME/.grails/StudentSSB_configuration.groovy' 2016-11-10
16:37:54,010 [localhost-startStop-1] INFO
configuration.ApplicationConfigurationUtils - Using configuration
file WebAppExtensibilityConfig.class from the classpath (e.g., from
within the war file) configuration:
file:C:\Users\xxx.xxx/.grails/banner_configuration.groovy
configuration:
file:C:\Users\xxx.xxx/.grails/StudentSSB_configuration.groovy
configuration: classpath:WebAppExtensibilityConfig.class
Configuring Spring Security Core ... ... finished configuring Spring
Security Core
I've tried running it as "grails run-app --verbose --stacktrace" and I get the same exact thing.
How am I supposed to troubleshoot if there are no errors? (I'm also new to IntelliJ, and Spring, btw). Thanks in advance.
Figured it out - It was in target/stracktrace.log and target/logs/xxxxxxxxxx.log. This was define in an app configuration .groovy file.
Related
I am trying to instrument our java webapp based on tomcat using Elastic APM. Tomcat starts fine without the javaagent but refuses to start with it. I do not see any logs in /var/log/tomcat. The following is the log:
Redirecting to /bin/systemctl status -l tomcat.service
● tomcat.service - Apache Tomcat Web Application Container
Loaded: loaded (/usr/lib/systemd/system/tomcat.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2020-04-17 01:45:36 UTC; 1s ago
Process: 25660 ExecStart=/usr/libexec/tomcat/server start (code=exited, status=1/FAILURE)
Main PID: 25660 (code=exited, status=1/FAILURE)
arguments used: start
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
OpenJDK 64-Bit Server VM warning: Ignoring option PermSize; support was removed in 8.0
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
Error opening zip file or JAR manifest missing : /opt/elastic/elastic-apm-agent-1.15.0.jar
Error occurred during initialization of VM
agent library failed to init: instrument
tomcat.service: main process exited, code=exited, status=1/FAILURE
Unit tomcat.service entered failed state.
tomcat.service failed.
Has anyone faced this before? Any ideas what I could do to fix it?
did you try to give permissions to folder /opt/elastic ?
chmod -R uog+x
I am working on a project using Intellij IDEA Community, so I am using Jetty Runner to deploy my web application in localhost, everything is working ok, but I want to configure logs regarding Jetty, at server startup I see this kind of log :
14:50:20.516 [main] DEBUG o.eclipse.jetty.webapp.WebAppContext - isSystemResource==false org.springframework.expression.spel.ast.OpDec jar:file:/C:/Mario/development/spring/spring5/workspace/springsecurity/chapter02/chapter02.00-calendar/build/exploded/WEB-INF/lib/spring-expression-4.3.11.RELEASE.jar!/org/springframework/expression/spel/ast/OpDec.class
14:50:20.516 [main] DEBUG o.e.jetty.webapp.WebAppClassLoader - WAP webapp loaded class org.springframework.expression.spel.ast.OpDec
14:50:20.516 [main] DEBUG o.eclipse.jetty.webapp.WebAppContext - isSystemResource==false org.springframework.expression.spel.ast.OperatorNot jar:file:/C:/Mario/development/spring/spring5/workspace/springsecurity/chapter02/chapter02.00-calendar/build/exploded/WEB-INF/lib/spring-expression-4.3.11.RELEASE.jar!/org/springframework/expression/spel/ast/OperatorNot.class
14:50:20.517 [main] DEBUG o.e.jetty.webapp.WebAppClassLoader - WAP webapp loaded class org.springframework.expression.spel.ast.OperatorNot
1
I want to change the granularity from DEBUG to info regarding jetty server.
Put a jetty-logging.properties file in your resources folder and configure the logging there:
# Configure for System.err output
org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
# Configure StdErrLog to log all jetty namespace at default of WARN or above
org.eclipse.jetty.LEVEL=INFO
More info here: https://www.eclipse.org/jetty/documentation/9.4.x/configuring-logging.html
For multiple projects, I use wildfly-swarm to avoid installing a webserver. The swarm jar file is generated and I can successfully launch it through "java -jar mypackage-swarm.jar".
However, to debug it easily, I would like to launch it via my IDE (eclipse). Either by directly launching my main class or using fakerplace, I have the following exception :
Fakereplace is running.
Dependencies not bundled, will resolve from local M2REPO
2017-01-17 08:31:41,806 org.wildfly.swarm.internal.SwarmMessages [main] DEBUG Logging Provider: org.jboss.logging.Log4jLoggerProvider
2017-01-17 08:31:41,811 org.wildfly.swarm.Swarm [main] DEBUG WFSWARM0020: Stage Config found in swarm.project.stage.file system property at location: null
2017-01-17 08:31:41,862 INFO [org.wildfly.swarm] (main) WFSWARM0018: Installed fraction: Logging - STABLE org.wildfly.swarm:logging:2016.12.1
2017-01-17 08:31:41,865 INFO [org.wildfly.swarm] (main) WFSWARM0018: Installed fraction: Undertow - STABLE org.wildfly.swarm:undertow:2016.12.1
2017-01-17 08:31:41,865 INFO [org.wildfly.swarm] (main) WFSWARM0018: Installed fraction: Spring WebMVC - STABLE org.wildfly.swarm:spring:2016.12.1
org.jboss.modules.ModuleLoadException: Error loading module from modules/org/apache/xerces/main/module.xml
...
Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to resolve artifact 'xerces:xercesImpl:2.11.0.SP5' (position: END_TAG seen ...<resources>\n <artifact name="xerces:xercesImpl:2.11.0.SP5"/>... #5:52)
I've found similar exceptions on internet, but I cannot find a solution.
Has anyone any idea on this ?
Why don't you just run it as jar application ?
I'm not sure how to do that in eclipse below is example in intellj but for eclipse you can find your solution here:
eclipse: how to debug a Java program as a .jar file?
After configure the sonar tools (SonarQube, MySql database and Sonar-runner) I perform an analysis over an Android project without any problem. But after install the Android Plugin for sonar and repeat the analysis, this one fails getting the next error:
INFO - Preview mode
Load batch settings
User cache: /home/user/.sonar/cache
INFO - Install plugins
INFO - Exclude plugins: devcockpit, jira, pdfreport, views, report, buildstability, scmactivity, buildbreaker
INFO - Create JDBC datasource for jdbc:h2:/home/user/workspace/myAndroidProject/.sonar/.sonartmp/preview1394469024394-0
INFO - Initializing Hibernate
INFO - Load project settings
INFO - Apply project exclusions
INFO - ------------- Scan myAndroidProject
INFO - Load module settings
INFO - Language is forced to java
INFO - Loading technical debt model...
INFO - Loading technical debt model done: 424 ms
INFO - Configure Maven plugins
INFO - Base dir: /home/user/workspace/myAndroidProject
INFO - Working dir: /home/user/workspace/myAndroidProject/.sonar
INFO - Source dirs: /home/user/workspace/myAdnroidProject/src
INFO - Source encoding: UTF-8, default locale: en_EN
INFO - Index files
INFO - Included sources:
INFO - src/**
INFO - 116 files indexed
WARN - Accessing the filesystem before the Sensor phase is deprecated and will not be supported in the future. Please update your plugin.
INFO - Index files
INFO - Included sources:
INFO - src/**
INFO - 116 files indexed
WARN - Accessing the filesystem before the Sensor phase is deprecated and will not be supported in the future. Please update your plugin.
INFO - Index files
INFO - Included sources:
INFO - src/**
INFO - 116 files indexed
INFO - Quality profile for java: Sonar way
INFO - Sensor JavaSourceImporter...
INFO - Sensor JavaSourceImporter done: 49 ms
INFO - Sensor JavaSquidSensor...
INFO - Java AST scan...
INFO - 116 source files to be analyzed
INFO - 116/116 source files analyzed
INFO - Java AST scan done: 6693 ms
WARN - Java bytecode has not been made available to the analyzer. The Depth of Inheritance Tree (DIT) metric, Response for Class (RFC) metric, Number of Children (NOC) metric, Lack of Cohesion (LCOM4) metric, deperecated dependencies metrics, UnusedPrivateMethod rule, RedundantThrowsDeclarationCheck rule, S1160 rule, S1217 rule are disabled.
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 18.440s
Final Memory: 12M/357M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: org.sonar.api.resources.Directory cannot be cast to org.sonar.api.resources.JavaPackage
My sonar-project.properties file is the enxt:
#Required metadata
sonar.projectKey=mKey
sonar.projectName=myAndroidProject
sonar.projectVersion=1.0
# Paths to source directories.
# Paths are relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# Do not put the "sonar-project.properties" file in the same directory with the source code.
# (i.e. never set the "sonar.sources" property to ".")
sonar.sources=src
# The value of the property must be the key of the language.
sonar.language=java
# Encoding of the source code
sonar.sourceEncoding=UTF-8
# Analysis mode
sonar.analysis.mode=preview
#Enables the Lint profile to analyze the code using the Lint rules.
#sonar.profile=Android Lint
I'm using the next environment:
SonarQube 4.2 RC1
Sonar-runner 2.3
Database: MySQL
Ubuntu 12.04 LTS
Java 1.7
I tryed uninstalling the Android plugin but the problem persists. The unique way that I've found to solve it is deleting the database and the user and create them again.
As stated on http://docs.codehaus.org/pages/viewpage.action?pageId=236224987, the Android plugin is not yet compatible with SonarQube 4.2-RC1. See also http://jira.codehaus.org/browse/SONARPLUGINS-3483.
You need to provide the binaries (bytecode .class files) to the sonar executor.
Add the following line to your sonar-project.properties
# Path to the class files
sonar.binaries=build\\classes\\main
If the above line doesn't work , then check your binaries actual path and place it in sonar.binaries property
Is there a way to solve this? I am also new to both tapestry, jetty, and openejb. I am having out of ideas =(
Configuration: Jetty 6.1.26 + OpenEJB 4.5.1 running Jumpstart for Tapestry 6.8
All compiles well, runs Ant collapser successfully, and deployed well. Jetty and OpenEJB are prestine from the binary zip. Just that OpenEjb have hsqldb-2.8 rather than hsqldb-2.9 which is instructed from the tapestry-jumpstart install manual.
But at some point when running in Eclipse Juno or IntelliJ IDEA (doesnt matter) I get this following log:
INFO - Deployed Application(path=E:\Workspace\IdeaProjects\tapestry\jumpstart-6.8.0\classpath.ear)
WARN [main] (Slf4jLog.java:76) - Config error at <New id="wiggle" class="org.mortbay.jetty.plus.naming.EnvEntry"><Arg><Ref id="wac"/></Arg><Arg>wiggle</Arg><Arg type="java.lang.Double">100</Arg><Arg type="boolean">true</Arg></New>
WARN [main] (Slf4jLog.java:89) - EXCEPTION
java.lang.reflect.InvocationTargetException
...
caused by: javax.naming.NamingException: Unknown JNDI name prefix 'org.mortbay.jetty.webapp.WebAppContext#40ad55ac{_test-jndi,c:'
at org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:130)
...
WARN [main] (Slf4jLog.java:76) - ContextDeployer$Scanner failed on 'C:\Server\jetty-6.1.26\contexts\test-jndi.xml
INFO [main] (Slf4jLog.java:67) - NO JSP Support for /jumpstart, did not find org.apache.jasper.servlet.JspServlet
INFO [main] (RegistryBuilder.java:129) - Adding module definition for class org.apache.tapestry5.ioc.services.TapestryIOCModule
Can someone tell me what went wrong with this? and what should I do?
Thanks much.