Issue while debugging dspace 6.0 jspui application on intellij - debugging

I have tried to configure dspace 6.0 on Intellij .But while debugging application I am getting below error.I think while configuring tomcat 7 on Intellij dspace-dir value is overridden.
Please suggest what change i need to make in configuration.
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
log4j:ERROR Could not read configuration file from URL [file:/E:/apache-tomcat-7.0.96/bin/$%7Bdspace.dir%7D/config/log4j-solr.properties].
java.io.FileNotFoundException: E:\apache-tomcat-7.0.96\bin\${dspace.dir}\config\log4j-solr.properties (The system cannot find the path specified
)
Reference link :
IntelliJ IDEA 13 setup for DSpace development on Mac OS XIntelliJ IDEA 13 setup for DSpace development on Mac OS X
https://youtu.be/mrLl1qPsy6I

Assuming that the log snippet you posted comes from the tomcat or DSpace log, when trying to start up DSpace, the causes could be:
dspace.dir value not filled out
maven or ant commando's not executed successfully. They have to be completed before starting up DSpace will work.

Related

Quarkus xml Parser DocumentBuilderFactory cannot be found, but only when using quarkus-run.jar

When packaging our app with mvn package everything works fine. Then when we start our app with java -jar target\quarkus-app\quarkus-run.jar the app silently crashes. While debugging we found that it crashes while parsing an xml InputStream. It happens while initialising some classes.
This is the stacktrace that we had to dig out ourselves:
Exception occurred in target VM: Provider for javax.xml.parsers.DocumentBuilderFactory cannot be found
javax.xml.parsers.FactoryConfigurationError: Provider for javax.xml.parsers.DocumentBuilderFactory cannot be found
at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
at org.optaplanner.core.impl.io.jaxb.GenericJaxbIO.parseXml(GenericJaxbIO.java:209)
at org.optaplanner.core.impl.io.jaxb.SolverConfigIO.read(SolverConfigIO.java:15)
at org.optaplanner.core.config.solver.SolverConfig.createFromXmlReader(SolverConfig.java:199)
at org.optaplanner.core.config.solver.SolverConfig.createFromXmlInputStream(SolverConfig.java:173)
at org.optaplanner.core.config.solver.SolverConfig.createFromXmlInputStream(SolverConfig.java:160)
When packaging the app in an uberjar this problem does not occur. Same when using dev.
We use graalvm-ce-java17-22.2.0, together with the 2.11.2.Final version of quarkus and the 8.29.0.Final version of optaplanner.
We tried to verify that there aren't any xml exclusion in the dependencies. Also we checked if quarkus and the quarkus maven-compiler-plugin are of the same version. Also we looked into the compiled jarfiles, if the xml we want to read is present. If it wouldn't be present, the code would crash even earlier. The class javax.xml.parsers.DocumentBuilderFactory is not listed in the quarkus-app-dependencies.txt
Adding the quarkus-optaplanner extension helped to identify the logger issue. So the problem with the silent crash is resolved. Adding quarkus-jaxp to the dependencies gets rid of the FactoryConfigurationError and everything works as expected.

Accessing a simple get endpoint of a Spring App deployed to a tomcat running in a container in a AWS AC2 instance

I'm trying to deploy a simple spring application (https://github.com/rmmcosta/SampleRestWar.git) to a tomcat server running in a docker container inside an AWS EC2 instance.
I can generate the war file by using maven and following the instructions in this article:
https://www.baeldung.com/spring-boot-war-tomcat-deploy
I copy the war file to the /usr/local/tomcat/webapps folder inside the container and I run the catalina.sh.
I can see the following message:
05-Dec-2022 22:33:32.604 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/local/tomcat/webapps/SampleRest.war]
05-Dec-2022 22:33:32.756 WARNING [localhost-startStop-1] org.apache.tomcat.util.descriptor.web.WebXml.setVersion Unknown version string [5.0]. Default version will be used.
05-Dec-2022 22:33:34.512 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
05-Dec-2022 22:33:34.519 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/SampleRest.war] has finished in [1,915] ms
But when I try to access the rest enpoint or the app url I'm getting a 404.
Can you help in understanding what I'm doing wrong.
Thank you in advance.
I tried different apps with different spring versions but I'm getting the same 404 everytime.
I can see tomcat is running and the example apps already present in there are working fine.

Activating GWT Dev Mode on a GWT application built using Maven

TL;DR: In order to debug the client-side, I ran gwt:run goal, launched the application on Chrome, and after login in, it threw the exception below, and GWT dev mode didn't launch (none of the client-side breakpoints worked)
javax.el.ELException: /pages/common/gwt/commonLayoutGWT.xhtml: setAttribute: Non-serializable attribute with name sessionBean
at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:90)
at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
at com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:183)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456)
...
What should I do, or what should I check to get my GWT Dev mode working properly?
Some background: previously, our team used some ant scripts for compiling, debugging (server and client code), running and deploying our main application. It worked without a problem, although the process was really cumbersome and manual. We decided to make it a Maven application some months ago, and we were able to successfully execute all actions/goals after using
Maven. Compiling, running and deploying the application became fast and convenient, which was our goal.
But up until now we didn't notice that at some point in the process, our client side debugging stopped working. Only after we got some bug reports and started trying to debug them, we did notice the issue. So now I need to set the GWT Dev Mode, and haven't been able to do it no matter what I've tried.
I'm working with:
SmartGWT 4.0
JDK 1.8.0_121
GWT Eclipse Plugin 2.8.0
GlassFish 4.1
Maven 3.3
I tried to follow some instructions from gwtproject, using the default linker xsiframe into gwt.xml file.
But when I executed the gwt:compile goal, this error showed up:
[INFO] Linking into D:\Development\Repos\Git\Java\MyApp\myApp\target\classes\..\..\..\myApp\WebContent\pages\module\gwt\com.myapp.client.gwt.MyAppClient
[INFO] Invoking Linker Cross-Site-Iframe
[INFO] [ERROR] The Cross-Site-Iframe linker does not support <script> tags in the gwt.xml files, but the gwt.xml file (or the gwt.xml files which it includes) contains the following script tags:
To solve this, I used one of the recommended solutions by the error itself:
"...add this property to the gwt.xml file: <set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>"
I ran the gwt:compile again, and it finished successfuly
I suggest running your server-side code in a separate server (could be mvn jetty:run), and run GWT Dev Mode only for the clientside code (use <noserver>true</noserver>).
That solves so many problems (with running webapps inside DevMode's embedded server) that's it's the recommended setup nowadays.

How to debug start of eclipse plugin?

I try to migrate an eclipse plugin from Java8 to Java9. If I start a debug session (Run as Eclipse Application...) all works fine.
However, after installing my plugin I am not able to use it. If I use ss in the OSGI console I get following status for my plugin:
1102 STARTING org.treez.core_1.0.0.201712191435
and if I manually try to start it I get
osgi> start 1102
gogo: BundleException: Error loading bundle activator.
I tried to start a remote debug session, as suggested here:
Debugging Eclipse plug-ins
I set a break point in the constructor of my Activator but that break point is never reached.
=> How can I get additional information about why the loading of the bundle activator fails? Is there some log file? Can I somewhere set a logging level to TRACE?
I assume that the issue might be that a resource can be found while debugging the Eclipse Application but not when using the bundled jar. More info, e.g. the name of the resource that could not be found, would be very helpful.
Related questions:
Debugging Eclipse plug-ins
CQ5 OSGi bundle does not start:- Activator cannot be found
When plugins fail to start there is normally a message in the .log file in the workspace .metadata directory.
On Linux, Unix and macOS this file and directory are hidden so you may need to do something special to see them.

Trying to build Tomcat 6 from source: Ant doesn't download libs

I am trying to build Tomcat 6 or 7 on my machine from provided source codes.
I have checked out the sources from repository and ran the ant build.
In the very beginning of the build Ant needs to download the libs Tomcat needs. In the 6th version it is done by separate command 'ant download', in the 7th version this command is incorporated into build.xml.
The problem is that Ant cannot download the libs Tomcat needs for build while trying to build both the versions.
It stops here:
trydownload:
[get] Getting: http://www.apache.org/dist/tomcat/tomcat-connectors/native/1.1.24/source/tomcat-native-1.1.24-src.tar.gz
[get] To: /Users/dmitrijskorov/libraries/tomcat-native-1.1.24/tomcat-native.tar.gz
After printing this nothing happens. No errors, no end of execution. The file itself is created inside the folder for downloads, but its size is 111KB instead of 262KB if I download it manually. Ping of that server also evaluates ok.
Looks like I have problems with Ant download task.
Probably the reason is some proxy settings I need to provide to Ant. But I dont know how to find out my proxy settings. All settings in all browsers and OS point to automatic detection of proxies and thus I cannot setup proxy in Ant build. And I dont know whether I need this at all.
MacOs Lion, Tomcat 6 or 7, Java 6.
With Ant 1.7 or later you can use the -autoproxy option to Ant to tell it to use the proxy settings from the operating system
ant -autoproxy download
Ref: Ant manual

Resources