Timeout when importing a grails project - java

I am trying to import a Grails project into STS. I'm running STS 3.6.1. I've also got the Groovy plugin installed, running compiler 1.8.6. Finally, I have Grails 2.1.4.
When I try to import a Grails project though (which is a Subversion repository), it is painfully slow, before it finally gives up:
The command 'C:\Program Files\Java\jdk1.6.0_45\bin\javaw.exe (4 Sep
2014 12:10:28)' was terminated because it didn't produce new output
for some time.
See details for the output produced so far.
If you think the command simply needed more time, you can increase the
time limit in the Grails preferences page.
See menu Windows >> Preferences >> Grails >> Launch Command:
C:\Program Files\Java\jdk1.6.0_45\bin\javaw.exe (4 Sep 2014 12:10:28)
---- System.out ---- | Loading Grails 2.1.4 | Configuring classpath | Downloading:
C:\Users\607534885\Software\grails-2.1.4\plugins\database-migration-1.3.2.pom
| Downloading:
C:\Users\607534885\Software\grails-2.1.4\lib\org.liquibase\liquibase-core\ivy-2.0.5.xml
| Downloading:
C:\Users\607534885\Software\grails-2.1.4\plugins\jquery-1.8.3.pom
---- System.err ----
Terminating process: Timeout: no new output for 180000 milliseconds
------System.out:----------- | Loading Grails 2.1.4 | Configuring classpath | Downloading:
C:\Users\607534885\Software\grails-2.1.4\plugins\database-migration-1.3.2.pom
| Downloading:
C:\Users\607534885\Software\grails-2.1.4\lib\org.liquibase\liquibase-core\ivy-2.0.5.xml
| Downloading:
C:\Users\607534885\Software\grails-2.1.4\plugins\jquery-1.8.3.pom
------System.err:-----------
Terminating process: Timeout: no new output for 180000 milliseconds
Why is Grails proving to be so slow? Or is this an issue with something else?

Figured it out. Rather pointless question in the end. We have an aggressive firewall in work and I simply needed to use a wifi connection instead as importing the project for the first time required third party software to be installed. Simples in the end.

Related

The module has not been deployed : Tomcat 9

I am using Netbeans 8.2 and Tomcat 9. I just create a new project and trying to run but every time it shows this error and for existing projects also it is running another PC smoothly.
Can you please suggest something for the solution -
ant -f "C:\\Users\\UserName\\Documents\\NetBeansProjects\\Test" -Dnb.internal.action.name=run -Ddirectory.deployment.supported=true -DforceRedeploy=false -Dnb.wait.for.caches=true "-Dbrowser.context=C:\\Users\\Rifat Tanjir\\Documents\\NetBeansProjects\\Test" run
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
In-place deployment at C:\Users\UserName\Documents\NetBeansProjects\Test\build\web
deploy?config=file%3A%2FC%3A%2FUsers%2FRIFATT%7E1%2FAppData%2FLocal%2FTemp%2Fcontext4316755968276891464.xml&path=/Test
Server returned HTTP response code: 500 for URL: http://localhost:80/manager/text/deploy?config=file%3A%2FC%3A%2FUsers%2FRIFATT%7E1%2FAppData%2FLocal%2FTemp%2Fcontext4316755968276891464.xml&path=/Test
C:\Users\UserName\Documents\NetBeansProjects\Test\nbproject\build-impl.xml:1045: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 14 seconds)

Cant deploy on google cloud app engine using Bitbucket pipeline

I have a java web application deployed in app engine and the source code is in Bitbucket under master branch,
And I heard about bitbucket pipelines I found it helpful as a fast way of auto deploying
My master branch having this list of 4 projects:
master --
|- project1
|- project2
|- project3
|- project4
|- bitbucket-pipelines.yml
And I followed exactly what is written in this link to provide the pipeline functionality:
https://confluence.atlassian.com/bitbucket/deploy-to-google-cloud-900820342.html
and here is my bitbucket-pipelines.yml content and its located directly under my master branch
image: maven:3.3.9
pipelines:
branches:
master:
- step:
caches:
- maven
script:
# Downloading the Google Cloud SDK
- curl -o /tmp/google-cloud-sdk.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-155.0.0-linux-x86_64.tar.gz
- tar -xvf /tmp/google-cloud-sdk.tar.gz -C /tmp/
- /tmp/google-cloud-sdk/install.sh -q
- source /tmp/google-cloud-sdk/path.bash.inc
# Authenticating with the service account key file
- echo $GOOGLE_CLIENT_SECRET | base64 --decode --ignore-garbage > ./gcloud-api-key.json
- gcloud config set project $CLOUDSDK_CORE_PROJECT
- gcloud components install app-engine-java
- gcloud auth activate-service-account --key-file client-secret.json
- cd project1
- mvn clean install package
- 'mvn appengine:update'
CLOUDSDK_CORE_PROJECT : is a pipeline variable contains the project ID
GOOGLE_CLIENT_SECRET : is a pipeline variable contains the base64 encoded service account json file as explained in the attached link
and here is my app engine plugin in the pom.xml
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.target.version}</version>
<configuration>
<enableJarClasses>false</enableJarClasses>
<oauth2>false</oauth2>
</configuration>
</plugin>
after I run my pipelines I got this error at executing the line of "mvn appengine:update"
lease visit https://developers.google.com/appengine/downloads for the latest SDK.
********************************************************
The following URL can be used to authenticate:
https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force&client_id=550516889912.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&scope=https://www.googleapis.com/auth/appengine.admin%20https://www.googleapis.com/auth/cloud-platform
Attempting to open it in your browser now.
Unable to open browser. Please open the URL above and copy the resulting code.
Please enter code: Encountered a problem: No line found
Please see the logs [/tmp/appcfg3177766291803906341.log] for further information.
and then the pipeline result is failed, I looked for this error for 2 days with no hope, I hope come one here help me out
Thanks in advance!
I fixed it, it turned out that the docs in bitbucket is misleading, here is the correct pipeline script, you just need to put this 3 lines of code to build and deploy to google cloud right after:
- mvn install package
- echo $GOOGLE_CLIENT_SECRET > /tmp/client-secret.json
- mvn appengine:update -Dappengine.additionalParams="--service_account_json_key_file=/tmp/client-secret.json"
$GOOGLE_CLIENT_SECRET is an environmental variable having the service account json of App Engine default service account or you can create a new one having project editor privileges
It helped me pass the authenticate error but now I see 403 in my logs. Surprisingly, the version is still getting pushed to app-engine but 0% traffic.
Beginning interaction for module default...
0% Created staging directory at: '/var/folders/ny/z92xw4ps0j71v43mnvjzjyd80000gn/T/appcfg16663468200304338426.tmp'
5% Scanning for jsp files.
8% Generated git repository information file.
20% Scanning files on local disk.
25% Initiating update.
28% Cloning 34 application files.
40% Uploading 3 files.
52% Uploaded 1 files.
61% Uploaded 2 files.
68% Uploaded 3 files.
73% Sending batch containing 3 file(s) totaling 41KB.
77% Initializing precompilation...
90% Deploying new version.
95% Closing update: new version is ready to start serving.
98% Uploading index definitions.
Feb. 19, 2018 1:21:24 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/datastore/index/add?app_id=clean-aleph-191303&version=beta-001&
403 Forbidden
You do not have permission to modify this app (app_id=u'f~clean-aleph-191303').
This is try #0
Feb. 19, 2018 1:21:25 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/datastore/index/add?app_id=clean-aleph-191303&version=beta-001&
403 Forbidden
You do not have permission to modify this app (app_id=u'f~clean-aleph-191303').
This is try #1
Feb. 19, 2018 1:21:25 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/datastore/index/add?app_id=clean-aleph-191303&version=beta-001&
403 Forbidden
You do not have permission to modify this app (app_id=u'f~clean-aleph-191303').
This is try #2
Feb. 19, 2018 1:21:25 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/datastore/index/add?app_id=clean-aleph-191303&version=beta-001&
403 Forbidden
You do not have permission to modify this app (app_id=u'f~clean-aleph-191303').
This is try #3
Error Details:
2018-02-19 01:20:57.438:INFO::main: Logging initialized #378ms
2018-02-19 01:20:57.575:INFO:oejs.Server:main: jetty-9.3.18.v20170406
2018-02-19 01:20:58.829:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=711ms
2018-02-19 01:20:58.843:INFO:oejq.QuickStartDescriptorGenerator:main: Quickstart generating
2018-02-19 01:20:58.859:INFO:oejsh.ContextHandler:main: Started o.e.j.q.QuickStartWebApp#2aceadd4{/,file:///private/var/folders/ny/z92xw4ps0j71v43mnvjzjyd80000gn/T/appcfg16663468200304338426.tmp/,AVAILABLE}
2018-02-19 01:20:58.861:INFO:oejs.Server:main: Started #1808ms
2018-02-19 01:20:58.863:INFO:oejsh.ContextHandler:main: Stopped o.e.j.q.QuickStartWebApp#2aceadd4{/,file:///private/var/folders/ny/z92xw4ps0j71v43mnvjzjyd80000gn/T/appcfg16663468200304338426.tmp/,UNAVAILABLE}

Jenkins: Duplicate building of jars in a single build

I am using Jenkins 1.596 along with Maven 3.1.1. I have multiple branches in my repository and I am using following goals for build:
'-T 5 clean install'
When I start the build, it shows following log:
Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/<my_job>/workspace
> git rev-parse --is-inside-work-tree # timeout=10
....
[workspace] $ /usr/local/apache-maven/apache-maven-3.1.1/bin/mvn -s /var/lib/jenkins/.m2/settings.xml -T 5 clean install
[INFO] Scanning for projects...
It then shows the projects and Reactor build order. It executes the tests successfully and builds all the jars. Following Success message gets displayed after completion of build:
BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3:39.752s (Wall Clock)
[INFO] Finished at: Wed Apr 15 00:02:57 BST 2015
[INFO] Final Memory: 104M/406M
Now, the issue is, just after this success message, it repeats the whole build again. It starts scanning all the poms, downloads jars, executes tests and again, I can see the success message. Following is the starting trace of unwanted build:
Parsing POMs
[workspace] $ java -Xmx1024M -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.6.jar:/usr/local/apache-maven/apache-maven-3.1.1/boot/plexus-classworlds-2.5.1.jar:/usr/local/apache-maven/apache-maven-3.1.1/conf/logging jenkins.maven3.agent.Maven31Main /usr/local/apache-maven/apache-maven-3.1.1 /var/cache/jenkins/war/WEB-INF/lib/remoting-2.49.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.6.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.6.jar 54000
<===[JENKINS REMOTING CAPACITY]===>channel started
Due to this, the whole build takes twice as much time. I have disabled archiving but that doesn't seem to have affected this. Can anyone please let me know what am I doing wrong here?
Thanks in advance.
I finally managed to figure out the cause of this. Apparently, the 'Pre Steps' was enabled in jenkins which was doing mvn clean install and then the actual build was configures to start which in turn, was doing the same thing :)
I have removed the pre step and it is now building in half amount of time compared to earlier builds.
Hope this helps someone :)

Maven 3.0.5 + Windows 8 + jdk 7 issue

I trying to figure out what is happening with my maven. I have switch to windows 8 last days and found problem with building apps with maven (please see failure message at the bottom):
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.400s
[INFO] Finished at: Sat Apr 13 18:36:56 CEST 2013
[INFO] Final Memory: 18M/178M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Example: Could not resolve dep
endencies for project
(Here are lots of libs)
Could not transfer artifact com.sun.xml.bind:jaxb-impl:pom:2.2.4-1 from/to central (
http://repo.maven.apache.org/maven2): Connection to http://repo.maven.apache.org
refused: connect: Address is invalid on local machine, or port is not valid on
remote machine -> [Help 1]
When switched to java 6, eveything is working fine. I have even disabled windows firewall, without any success though. Maybe someone has faced with that problem?
Here is my environment:
Windows 8 x64
JDK 7u17 (check on both, x86 and x64)
Maven 3.0.5
Well the answer look is so simple that I'm embarrassed to give but... . As I have written above I have disabled firewall / antyvirus but without any effect. However I don't add java as a exception to my antyvirus, which is as it turns out, scanning my apps and don't allow some to access event if it's disabled... . That's wierd but adding an exception in AV helped. Sorry for bother....

Sinatra Jruby Heroku - jruby: No such file or directory -- trinidad (LoadError)

I'm trying to get this application running: github.com/Soliah/sinatra-jruby-heroku.git
One update was necessary according to this release note from Heroku:
http://devcenter.heroku.com/articles/release-note-java-2011-09-29
The build goes fine, without any errors. Bellow some log parts:
[INFO] --- jruby-rake-plugin:1.6.3:jruby (install-bundler) # jruby-heroku ---
[INFO] Successfully installed bundler-1.0.21
[INFO] 1 gem installed
[INFO]
[INFO] --- jruby-rake-plugin:1.6.3:jruby (bundle-install) # jruby-heroku ---
[INFO] Fetching source index for http://rubygems.org/
[INFO] Installing jruby-rack (1.0.10)
[INFO] Installing rack (1.3.2)
[INFO] Installing tilt (1.3.3)
[INFO] Installing sinatra (1.2.6)
[INFO] Installing trinidad_jars (1.0.1)
[INFO] Installing trinidad (1.2.3)
[INFO] Using bundler (1.0.21)
[INFO] Your bundle is complete! It was installed into ./vendor/bundle
(...)
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33.408s
[INFO] Finished at: Tue Jan 31 10:58:03 UTC 2012
[INFO] Final Memory: 9M/490M
[INFO] ------------------------------------------------------------------------
-----> Discovering process types
Procfile declares types -> jruby, web
-----> Compiled slug size is 18.6MB
-----> Launching... done, v5
http://jrubyandjava.herokuapp.com deployed to Heroku
But when I access the deployed application. An application error occurs.
Here is the log, with the error:
$ heroku logs
2012-01-31T10:57:21+00:00 heroku[slugc]: Slug compilation started
2012-01-31T10:58:13+00:00 heroku[web.1]: State changed from created to starting
2012-01-31T10:58:19+00:00 heroku[web.1]: Starting process with command `sh script/jruby -S trinidad -p 52233`
2012-01-31T10:58:20+00:00 app[web.1]: Classpath is: :/app/etc:/app/target/dependency/jruby-complete.jar
2012-01-31T10:58:21+00:00 app[web.1]: jruby: No such file or directory -- trinidad (LoadError)
2012-01-31T10:58:23+00:00 heroku[web.1]: State changed from starting to crashed
2012-01-31T10:58:23+00:00 heroku[web.1]: State changed from crashed to created
2012-01-31T10:58:23+00:00 heroku[web.1]: State changed from created to starting
2012-01-31T10:58:23+00:00 heroku[web.1]: Process exited
2012-01-31T10:58:28+00:00 heroku[web.1]: Starting process with command `sh script/jruby -S trinidad -p 26224`
2012-01-31T10:58:28+00:00 app[web.1]: Classpath is: :/app/etc:/app/target/dependency/jruby-complete.jar
2012-01-31T10:58:31+00:00 app[web.1]: jruby: No such file or directory -- trinidad (LoadError)
2012-01-31T10:58:32+00:00 heroku[web.1]: State changed from starting to crashed
2012-01-31T10:58:33+00:00 heroku[web.1]: Process exited
2012-01-31T10:58:33+00:00 heroku[router]: Error H10 (App crashed) -> GET jrubyandjava.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=
It seems that JRuby is not finding the gems.
But I've tried all kinds of configurations (in script/jruby, heroku config:add, Procfile, etc.) and no one worked.
One more thing: this is the actual heroku config output (stack cedar).
$ heroku config
DATABASE_URL => postgres://kfgubrhars:mYBlJ2YKewqG7LwmPqVI#ec2-50-17-200-129.compute-1.amazonaws.com/kfgubrhars
JAVA_OPTS => -Xmx384m -Xss512k -XX:+UseCompressedOops
MAVEN_OPTS => -Xmx384m -Xss512k -XX:+UseCompressedOops
PATH => /usr/local/bin:/usr/bin:/bin
SHARED_DATABASE_URL => postgres://kfgubrhars:mYBlJ2YKewqG7LwmPqVI#ec2-50-17-200-129.compute-1.amazonaws.com/kfgubrhars
Here is the updated repository: https://github.com/tomasmuller/sinatra-jruby-heroku
Thank's in advance!
Ok! I found the solution. Here are the steps:
Adjust the GEM_HOME, in script/jruby to:
GEM_HOME="$APPDIR"/vendor/bundle
Created the script/bundle, with ENV['GEM_HOME'] and ENV['GEM_PATH'] pointing to 'vendor/bundle' dir.
Adjusted the executions of jruby-rake-plugin, in pom.xml:
install-bundler: <args>-S gem install bundler --no-ri --no-rdoc --install-dir vendor/bundle</args>
bundle-install: <args>script/bundle install --without development:test</args>
There's been a recent change to where the gems get installed. The launcher script/jruby expects the gems to be in .gems but it looks like that has now changed to vender/bundle.
Try changing the line https://github.com/tomasmuller/sinatra-jruby-heroku/blob/master/script/jruby#L94 to export GEM_HOME="$APPDIR"/vender/bundle instead.
I've been meaning to update my blog post with these changes but just haven't got around to it.
As of Bundler 1.2 you are now able to specify the Ruby implementation and version in your Gemfile. The nice thing about this is that Heroku will understand these settings and prepare the your Heroku application for your environment.
Take this Gemfile for example:
source "https://rubygems.org"
ruby "1.9.3"
gem "rails"
gem "puma"
What's cool about this is that by default Celadon Cedar uses Ruby 1.9.2. However, when you specify ruby "1.9.3" in the Gemfile it'll actually compile Ruby 1.9.3 for your Heroku environment.
Now, if you want to add a different Ruby implementation to your Heroku environment, you can do so like this:
source "https://rubygems.org"
ruby "1.9.3", :engine => "jruby", :engine_version => "1.7.0.preview1"
gem "rails"
gem "puma"
Now it'll install and use JRuby 1.7.0.preview1 in Ruby 1.9 mode for your Heroku application upon deployment. It'll also even define the proper JVM options in the Heroku environment variables.
Best of all is that this comes with the official Heroku buildpack, so there is no need to switch to a 3rd party buildpack to get the JRuby/JVM going on Heroku. Although I haven't gotten it to work yet, this should also work with Rubinius, but I believe it's currently bugged. Either that, or I'm doing it wrong.
This is in my opinion an awesome and scalable feature. Just define the Ruby implementation/version/mode you're using in your Gemfile along with your other dependencies and Heroku will ensure the environment is prepared.
It is no longer necessary to use a workaround or use 3rd party buildpacks using this method. It is also no longer necessary to create a hacky Jemfile. Instead, just do everything as you would normally do with MRI, keep the Gemfile, don't use 3rd party buildpacks, just define the Ruby implementation/runtime in the Gemfile via the ruby method and Heroku should take care of things.

Categories

Resources