Intellij and local Tomee 7.0.1 - debugging

I have instance of Tomee 7.0.1 on my local HDD with latest Intellij.
When starting server using configuration in Intellij, it randomly connects, most of time it won't.
Trying to manuly deploy war:exloped using button in Intellij cause message:
Artifact xxx:war exploded: Server is not connected. Deploy is not available.
Configuration in Intellij doesn't have anything different that can be found in tutorials, etc.
I spend so much time searching for sollution of this problem, found many possible like:
- setenv.bat overwrting env var
- wrong env JAVA_OPTS
- missing JAVA_HOME
and probably others which now I can't remember.
None of this works.
Any thoughts?

which version of idea is it? They had a bug when 7.x was released and you needed to customize the properties they passed to the deployer of tomee as well as tomee properties but it has been fixes in recent releases.

Related

AEM 6.1 and 6.5 switching on local machine

~We have some projects still running in AEM 6.1 SP2 (the move to newest version of AEM is in progress) and new projects in AEM 6.5.
AEM 6.1 runs in java 8 and AEM 6.5 runs in java 11.
For us developers this switching between jdk versions is difficult in our local environment, quite often we get our AEM instances corrupted or maven project imports are no longer working properly in IDE.
Anyone else had this situation? What are the best practices for such a situation?
My recommendation would be to set up vagrant box instances to your specs (AEM version + Java) and use automated deployments. This way, you can bring up a preconfigured instances in minutes by executing a single vagrant up command, run your automated deployment, and test your projects. If your instance gets corrupted, run a vagrant destroy command, bring up a new instance again with 0 configurations needed for the next deployment. You willincrease your productivity manifolds with this approach.
I have been using this approach for years and it has saved hours of devops work during critical project timelines
If you are using MAC [OSX], you can try Jenv. It can help you to have a unique Java Environment to a specific directory. We did find it very useful.
https://github.com/jenv/jenv
Thanks!
If you are running your AEM instances via shell scripts E.g. ./crx-quickstart/bin/start you can always specify the JAVA_HOME variable to be used in this particular file.
E.g.
export JAVA_HOME="path to your JVM"
export PATH=$JAVA_HOME/bin:$PATH

Is it mandatory to install tomcat 7 to install klaros test management community edition even though there is tomcat installed and running

We are trying to install the Klaros-Testmanagement test case management tool (Community Edition). While installing, the Apache Tomcat application container will be installed by the package automatically.
My doubt is even though there is tomcat running, why tomcat server needs to be installed again.
Is there any work around for this?
Klaros-Testmanagement is supported and tested with the supplied Tomcat version only, which also contains some configuration changes from a vanilla Tomcat distribution.
The rationale behind this is to update the distribution on a regular basis and ensure that JVM memory settings and other parameters are configured properly.
If you are feeling adventurous you can try using another version of Tomcat or a completely other application server.
For this you may download the .war only distribution and install it in your container.
Make sure you are picking up configuration changes in the conf and bin folders by diffing them to a vanilla tomcat distribution.
You definitely have to:
Raise memory limitations, esp. MaxPermSize when running under Java 7: -XX:MaxPermSize=192m -Xms256m -Xmx768m or more if needed/available.
Disable session persistence: Uncomment <Manager pathname=""/> in conf/context.xml
Beware that other configuration changes may arise in future releases without further notice, so you are pretty much on your own if things stop working.

compiling with maven and nexus stuck on downloading artifacts

we are using here nexus 1.9.2.4 and maven 2.2.1 and on one pc (and only that one) when we try to compile our code using maven, it get stuck on downloading jars.
for example it'll be stuck on:
Downloading: http://mainserver:8081/nexus/content/groups/public/org/codehaus/mojo/javascript/javascript-maven-plugin/1.0-alpha-1-SNAPSHOT/javascript-maven-plugin-1.0-alpha-1-20090530.211438-7.jar
17/54K
and won't continue at all. tried using maven 3.0.4, but with the same result.
the machine runs windows 7.
any advise will be appreciated
This appears to be a bug related to using Maven on Java 7 and 64bit Windows. I have been experiencing similar problems.
The maven bug report and some discussion can be found here:
http://jira.codehaus.org/browse/MNG-5162
Workaround documented here:
https://cwiki.apache.org/confluence/display/MAVEN/ConnectException
Add -Djava.net.preferIPv4Stack=true to MAVEN_OPTS
Maven really needs to have some kind of support for mirrors and failsafes for the qurkeyness of the internet. Really, not everyone is going to be able to have a peered connection with the Oracle and Apache repositories. Every internet connection is going to drop a packet here and there, the "get a new ISP" response from Maven fans wouldn't help even if it were an option.
I've been staring at a 400k download go nowhere for about 10 minutes. I've noticed it gets stuck on the same files every time I wipe my repo too (bad sector maybe?). Which is a complete pita since it doesn't seem I can specify mirrors for it (short of hacking a hosts file). If you're a Maven project leader, look to Aptitude for ideas on what Maven could be.
EDIT:
I found a solution to my Maven problem here.
https://jira.codehaus.org/browse/MNG-5162
Under Ubuntu 13.10 simply...
sudo gedit /etc/environment
Add
MAVEN_OPTS="-Djava.net.preferIPv4Stack=true"
Save
Close
Reload terminal.

IntelliJ forcing me to restart my app on every code change

I am on Grails 1.3.5 and IntelliJ 9.0.4 on a Mac with the latest JDK
I have the simplest of Grails projects: a helloworld that simply renders a string directly from a controller. I created it through the New Project wizard in IntelliJ. That went fine and IntelliJ picks up the correct grails SDK.
The problem is that IntelliJ makes me restart the app to see any changes I make to my code, (e.g. changing the "hello world" string.
If I edit the same controller with a text editor (eg TextMate) and run the app from the command line with grails run-app I do get hot code replacement, which is obviously what I want...
Anyone got a clue?
Some points:
I strongly recommend using the latest IntelliJ X EAP (http://confluence.jetbrains.net/display/IDEADEV/IDEA+X+EAP) since Grails support has been improved a lot since 9.0.x
If your IntelliJ config files got messed up, you can easily recreate them with 'grails integrate-with --intellij'. N.B. this recreates the config files in and old format and IntelliJ suggest to upgrade them - follow this procedure
Make sure your run configuration has uses at least the same memory settings than Grails uses when run from the command line, I'm fine with setting the 'VM parameters' field to '-XX:MaxPermSize=256m -Xmx1G'
If build problems occur (in rare cases the IntelliJ's internal compiler is more strict than plain Groovy), disable the 'Make' checkbox in the run config dialog.
If the problem persists, paste a screenshot of the run configuration you're using.

RAD Websphere - EAR not picking up latest jar

I am using RAD 7.0. My web application works with a jar(contains the backend code for our application) which undergoes frequent changes. But whenever I replace the jar in the WebInf/lib folder of the war and restart the server, it does not pick up the latest jar. It keeps referring to the previous jar. I have to undeploy, restart server several times to make the war pick up the latest jar. Has anyone come across this issue? Any pointers will be useful.
Many thanks,
RJ
Is your server configured with "Run with resources within the workspace"?
If so, switch to "Run with resources on the server" and see if this solves the problem.
I have had my share of RAD problems not picking up new code, especially on RAD 6.0 and 7.0; on RAD 7.5, IBM finally seemed to have a grip on these issues.
You can also do a server clean to force the temp and work dirs to be cleaned and the code to be republished. RAD 7 has a problems and if you can upgrade to 7.5 many get resolved in that version.

Resources