Debug jboss app in Intellij idea - debugging

I am using intellij idea and jboss server.
When I run it it works fine but when I debug it it gives me:
ERROR: transport error 202: connect failed: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
Disconnected from server
What is the problem?

Make sure the jboss vm is running with the parameters Idea shows in Debug dialog - specifically the port number seems incorrect to me.

If you're running on OS X Mountain Lion you could try popping -d64 into the VM options, that seemed to work for me. Not passing the variables, I think, will just prevent you from debugging.
For more information check here.

Unchecking the pass variables didn't work for me. What I ended up doing running the jBOSS separately and using 'Remote jBOSS' configuration in intelliJ.
To make debugging work I ened up adding the following lines to the "standalone.sh"
DEBUG_JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=localhost:62307,suspend=n,server=y "
JAVA_OPTS="${DEBUG_JAVA_OPTS} $JAVA_OPTS"
The value of DEBUG_JAVA_OPTS has to be copy and pasted from IntelliJ dialog box. These lines have to be inserted into the script right after the place where script sets up "JAVA_OPTS"
Update:
Looks like IDE generates a new port number for each project. So you have to edit the standalone.sh file every time you switch project. Hopefully somebody can suggest a fix for it.

Another option might be to comment out the 'if' statement in standalone.conf as below.
Note the first $JAVA_OPTS is added (it is the one passed in from IntelliJ). This way there is no need to remember to change the port number for every project.
#Specify options to pass to the Java VM.
#
#if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="$JAVA_OPTS -Xms64m -Xmx512m -XX:MaxPermSize=256m - Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
JAVA_OPTS="$JAVA_OPTS -Djboss.server.default.config=standalone.xml"
#else
#echo "JAVA_OPTS already set in environment; overriding default settings with val ues: $JAVA_OPTS"
#fi

Related

Error when setting up Shapeshifter on OpenVPN Oracle Cloud (orport provided but not defined)

I'm trying to set up Shapeshifter with OpenVPN on Oracle Cloud instance and receiving an error when running the following: ./shapeshifter-dispatcher -transparent -server -state state -orport 127.0.0.1:3344 -transports obfs4 -bindaddr obfs4-IPADDRESSHERE:2233 -logLevel DEBUG -enableLogging
The error message is "orport is provided but not defined" despite me literally defining it in the next few characters. How can I properly define orport in this context?"
I'm following this guide to set up Shapeshifter, and I copied the code directly and replaced it with my IP, seeing that it was pretty straightforward.
I've also tried running the command as root and asking ChatGPT to help me debug the code, but I still got the same error.
Any help is appreciated, thanks.

Debugging GWT remote

I know there is a question about this:
Is it possible to debug GWT client code on a REMOTE server using IntelliJ 9 Community Edition?
Im struggling on this one too. Everything works as he explained it. But when I "Launch Default Browser" in the Development Mode I get the following Exception.
[TRACE] Finding entry point classes
[ERROR] Unable to find type 'de.factorplus.retail.artgui.client.app.main.MainViewImpl'
Could someone explain the parameters more in detail?
-noserver -war "[full path to your exploded war]" -gen "[full path to generated files]" -logLevel INFO -port [remote server port] -startupUrl "[URL of the remote page]" [com.company.YourEntryPoint]
I have it like:
noserver
war "C:...*workspace*\project-name\target\Project-Version-SNAPSHOT" (the zip as dir)
gen "C:...*workspace*\project-name\target\classes"
logLevel INFO
port 8765
startupUrl "http://server:8765/PROJECT/PROJECT.html" packages.PROJECT
and I use the classpath of the project.
It seems like it misses the sources on the server? OR am I wrong?
Is there already a better way to do this. Or do you see a mistake?
Hope you can help me.

How to use sbt from behind proxy - in windows 7?

I am trying to run SBT on Windows 7. To do so I followed the steps in the similar thread "How to use sbt from behind proxy?".
I have the following relevant "System variables":
Variable name:
JAVA_OPTS
Variable value:
-Dhttp.proxySet=true -Dhttp.proxyHost=192.168.0.150 -Dhttp.proxyPort=8080
Variable name:
SBT_OPTS
Variable value:
-Dhttp.proxySet=true -Dhttp.proxyHost=192.168.0.150 -Dhttp.proxyPort=8080
and
Variable name:
SBT_HOME
Variable value:
C:\Program Files (x86)\sbt\
I also changed the content of C:\Program Files (x86)\sbt\conf\sbtconfig.txt
***** sbtconfig.txt BEGINNING *****
*Set the java args to high
-Xmx512M
-XX:MaxPermSize=256m
-XX:ReservedCodeCacheSize=128m
*Set the extra SBT options
-Dsbt.log.format=true
*Set proxy
-Dhttp.proxySet=true
-Dhttp.proxyHost=192.168.0.150
-Dhttp.proxyPort=8080
***** sbtconfig.txt END *****
Running cmd.exe I enter sbt. The cmd echos
Getting org.fusesource.jansi jansi 1.11 ....
After around 1 minute i get a lot of warnings and errors like:
[...]
:::: ERRORS Server access Error: Connection timed out: connect
url=https://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.jansi/jansi/1.11.ivys/ivy.xml
[...]
which is exactly the same I get without the proxy settings. Also I was surprised when I entered the mentioned address in my browser and all I got was:
***** Browser display BEGINNING *****
{
"errors" : [ {
"status" : 404,
"message" : "File not found."
} ]
}
***** Browser display END *****
How can I find out if SBT is even trying to use the proxy, or there is a different problem?
Thank you Paweł for your answer.
This is what I found out:
"-Dhttp.proxySet=true" doesn't have any effect (for me at least)
The settings are prioritized in the following order:
SBT_OPTS overrides JAVA_OPTS overrides %SBT_HOME%conf\sbtconfig.txt
The Solution is either to set one of the environmental variables
JAVA_OPTS=-Dhttp.proxyHost=192.168.0.150 -Dhttp.proxyPort=8080 -Dhttps.proxyHost=192.168.0.150 -Dhttps.proxyPort=8080 -Dhttp.nonProxyHosts=localhost
OR
SBT_OPTS=-Dhttp.proxyHost=192.168.0.150 -Dhttp.proxyPort=8080 -Dhttps.proxyHost=192.168.0.150 -Dhttps.proxyPort=8080 -Dhttp.nonProxyHosts=localhost
OR to edit the %SBT_HOME%conf\sbtconfig.txt file :
***** sbtconfig.txt BEGINNING (hashtags in this file have been replaced by stars) *****
*Set the java args to high
-Xmx512M
*-XX:MaxPermSize=256m
-XX:ReservedCodeCacheSize=128m
*Set the extra SBT options
-Dsbt.log.format=true
*Proxy settings
-Dhttp.proxyHost=192.168.0.150
-Dhttp.proxyPort=8080
-Dhttps.proxyHost=192.168.0.150
-Dhttps.proxyPort=8080
***** sbtconfig.txt END *****
Let's take a look at your errors:
:::: ERRORS Server access Error: Connection timed out: connect url=https://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.jansi/jansi/1.11.ivys/ivy.xml
Sbt is trying to use https, but you don't have proxy configuration for it.
Try setting https proxy variables:
https.proxyHost
https.proxyPort
I guess you could try the same values as for http proxy.
Go to your SBT folder and use the below command
set SBT_OPTS=-Dhttp.proxyHost=10.10.10.154 -Dhttp.proxyPort=8080 -Dhttps.proxyHost=10.10.10.154 -Dhttps.proxyPort=8080 -Dhttp.nonProxyHosts=localhost <Enter your IP settings >
and then
sbt.bat
sbt uses Gigahorse with OkHttp for parallel downloading. You can try turning it off by passing -Dsbt.gigahorse=false.
Another thing you could try is turning off https, and use http by passing -Dsbt.repository.secure=false
Reference: https://github.com/sbt/sbt/issues/4307

gsoap error: SOAP-ENV:Client [no subcode]

I downloaded gsoap 2.8 and went into the samples folder and ran a make. Everything seems to have built fine. I then navigated into the "ssl" folder and ran the sllserver in one xterm and ran sslclient in a second xterm window. (I am running RHEL 6) The server seems to run fine, it says "Bind successful: socket = 4". But when I run the client I receive the following message:
Error -1 fault: SOAP-ENV:Client [no subcode]
"End of file or no input: Operation interrupted or timed out (30 s receive delay) (30 s send delay)"
Detail: [no detail]
I have not modified any of the sample code, so it seems like it should just work. Can anyone please give me some advice as to what I should look at? I am trying to learn how to set up a soap server that uses ssl. (I have a gsoap server running already) I searched all day for an example on the web and as usual, there is not one.
Thank you so much for any help.
You could rebuild this example with compiler switch -DDEBUG to enable message logging (make 'sslclient_CFLAGS = -DWITH_OPENSSL -DWITH_GZIP -DDEBUG'). The TEST.log will tell what went wrong. I suspect it is a network issue with the server address/port that is set by default to "https://localhost:18081".
You could set the timeout parameter: soap.recv_timeout = 60 (for 60 seconds)

selenium-server-standalone-2.20.0.jar -userExtensions command line argument throwing error

I was trying to execute selenium ide test suite with the following commandline.
java -jar selenium-server-standalone-2.20.0.jar -userExtensions: "C:\Selenium\user-extensions.js" -htmlSuite "*iexplore" "http://google.com" "C:\Selenium\3" "C:\Selenium\results1.html"
I observed that, without -userExtensions argument above command executes perfectly fine but when i added -userExtensions argument it threw following error,
11:13:39.734 WARN - Embedded iexplore seems to have ended on its own (did we kil
l the real browser???)
Tests failed, see result file for details: C:\Selenium\results1.html
On the other hand if I change the browser to firefox then script stuck at following
11:20:52.296 INFO - Checking Resource aliases.
What is possibly going wrong with the -userExtensions argument.
Help on this would be highly appreciated.
I had the exact same issue. It turned out I had extensions in there that was incompatible with selenium server. Removing those extensions fixed the issue.

Resources