I have created a web site using NetBeans IDE by File -> New Project -> Java Web -> Web Aplication using apache-tomcat-7.0.67 as my Server.
The website consits of 3 .jsp pages, 1 servlet and 1 javaBean and json.org (extension is .jar)
Now I'm trying to deply it on http://app1-lolcheck.rhcloud.com/ but I have no idea how both to use git or Openshift.
I've installed git, ruby and OpenShift rhc Client Tools.
Finally I have already done what this video says (but using Tomcat 7 (JBoss EWS 2.0)) : https://www.youtube.com/watch?v=vbvOQ2gopwo
So what should I do?
Victor,
I will try my best to answer your question in the general steps needed rather than the exact steps which will require some configuration.
If you log into your OpenShiftAcount and go into your developer portal you can go into your applications settings. Among other things, listed there will be git address.
What you will need to do is, assuming you have downloaded git, set it up following these steps:
Getting started with git
Then you need to go into your project directory and initialize the git there using:
git init
then add everything in your project folder except what's included in .gitignore (more details on the link that i provided you)
git add .
then commit everything
git commit -m "Some commitment message here."
now you need to add the application git address to your git's origin
git remote add origin [git address like git#github.com:user/gitname.git]
then you deploy using
git push origin
There are a lot of things I did quick and dirty and the actual configuration of the projects for rhc will need to be done by changing some settings file or in some cases procfiles. With everything that you need to get used to, please use this as a guideline for solving your problem.
A good crash course on git is going to be very helpful in any development work with version control and especially so with web development since so much deployment is done using git.
I am by no means a git expert, not even close to it, but I do use it in android development, web development and recently even in arduino programs just becasue of version controlling it offers.
To remove existing remote origin
git remote rm origin
Then you can add it one more time using the git remote add I mentioned above.
Git and OpenShift are two different things. Git is a version control software, like CVS or SVN. OpenShift is a PaaS provider, like Google App Engine. OpenShift is using Git to manage the deployment.
Your link shows that you've successfully created and deployed a running web app. The next thing you want to do is clone the source from OpenShift to your local disk, make changes and do a git commit and push your changes to the OpenShift cartridge. Your cartridge already has scripts that will be automatically be triggered to deploy your changes.
Follow these steps:
Netbeans > Team > Git > Clone:
Give your Repository URL. something like ssh://app1-lolcheck.rhcloud.com/~/git/.... (Hint copy it from your application page on openshift...see on right side under "source code")
username will be automatically filled
provide private/public key (you can get from settings menu on openshift website)
select master branch and in next step give parent directory where you want to clone and finish. Now copy your project contents in that directory...
right click on project in netbeans, click git > Commit
Then right click again your project > Git > Remote > Push. Done
Application will be deployed within few minutes.
Related
A plug-in that I want to install (Eclipse Jubula Database Drivers) is only available in Eclipse Marketplace. However, I need to install it to an Eclipse package running in a machine that is not connected to the Internet. Is any way to get the update site address so I can download the files for offline installation? This answer solves the problem to download an update site, but I don't see a way to get the update site address from eclipse marketplace
On every plugin page of Eclipse Marketplace, use the rightmost icon underneath the "Install" button. That opens an overlay containing the URL of the update site.
Yes. After spending a couple of weeks, I found this simple process:
Unpack Eclipse in folder A
Unpack Eclipse in folder B
Start Eclipse in folder A
Install the plug-in
Delete all files in the folder plugins/ which are the same in both Eclipse installs.
Delete all files in the folder features/ which are the same in both Eclipse installs.
That leaves you with the files necessary to run the plugin. But since this isn't an update site anymore, you can't easily install the plugin.
To solve this problem, you have two options:
Put the files into the dropins/ folder
Create an update site using the files which you identified. Good luck with that. I tried it for months but the result was unstable at best ("Component can't be installed because ...").
Just to follow up on Aaron's answer, the relevant files from plugins/ and features/ go into a new folder eclipse/ which can then be put into the dropins/ folder.
So for a concrete example, I wanted to install the Jenerate plugin to an offline machine. At the time I tried this, the update site was offline. So I went ahead and installed it via Marketplace on another machine with internet access, which lead to the creation of a folder features/org.jenerate.feature_1.0.2 as well as a jar plugins/org.jenerate_1.0.2.jar. I put those into newly created directories on the offline machine in dropins/jenerate/eclipse/features and dropins/jenerate/eclipse/plugins, respectively. See also this Eclipse help document.
Setup
I'm using Netbeans 7.4 on Mac OSX Mavericks and Glassfish 4.0 (build 89) on my dedicated server and JDK 1.7. To use the server locally I setup and ssh-tunnel. The following way:
ssh -L 4848:127.0.0.1:4848 -p 6122 glassfish#XXXXXXXXXX
This is working perfectly fine, I can access the server via localhost without any problems. To use this server I added a server in Netbeans, see prinscreen:
Problem
Now I'd like to deploy the project to the server (Right-Click Project -> Deploy) but I get following Error:
Building jar: /Users/tzhware7/NetBeansProjects/SkyLogicAddon/dist/SkyLogicAddon.war
Distributing /Users/tzhware7/NetBeansProjects/SkyLogicAddon/dist/SkyLogicAddon.war to [glassfish.ivo]
glassfish.ivo, deploy, null, false
/Users/tzhware7/NetBeansProjects/SkyLogicAddon/nbproject/build-impl.xml:1050: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 1 second)
Now I'd checked the line where the Error-Show's up, which is following (1049-1051). For me everything looks normal:
<target if="netbeans.home" name="-run-deploy-nb">
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
</target>
In advance I checked the serverlogs, which are empty - no error is shown. What am I doing wrong? Can someone advice me what to change? Thank you in advance!
Edit 1 - 08.01.2014
Allright, I didn't found a solution for solving the problem above, but following way worked at least to deploy the app manually.
Netbeans -> Right-Click on Project -> Clean/Build (now check your outputlog where it save's the project.
Now go to that path, you'll shoud find a .war file
Log into your glassfish-server -> Click Application's -> Click deploy -> upload the .war file -> Click again deploy
Now glassfish deploys the project for you. :)
Edit 2 - 17.01.2014
I could fix the problem, following was wrong. In netbeans I configured that the Target should be domain1, if you do this, it won't work. Let the target be empty, and everything works fine.
Thank you Tim B for your help!
If NetBeans can't talk to the server when you add it to the list then it silently fails. The server appears in the list but you can't click on the + and expand it out to see what it contains.
Check in your server list that NetBeans can actually see the server. Also keep in mind that NetBeans needs access to the admin port (usually 4848) not the normal web one, although it looks like your tunnel is correct for that.
You also need to turn on remote administration and set up the username and password etc. Try pointing a web browser to your localhost 6122 and check you can log in to the admin panel using the same username and password that netbeans is using.
To turn on remote administration:
https://blogs.oracle.com/quinn/entry/securing_adminstration_in_glassfish_server1
asadmin enable-secure-admin
You will also need to add an administrator username and password.
I currently have a sprimgmvc app that uses maven. I am currently using mvn:package to build war and deploy it to tomcat to develop and this is getting very cumbersome. I dont have the eclipse configured to automatically build and deploy to tomcat for that matter?
Can anyone please provide me steps that I need to take so that if I make any changes in my project I can just hit save and run and it will deploy to the tomcat OR a way in which I dont use tomcat but use maybe jetty or something else to build and test my app?
Thank you
download STS > Import your project as maven project to the new workspace > mvn install (only once to download all your dependencies) > run AS > Server > baam!
For any other eclipse version pretty much the same but you need to open the server window and configure tomcat , basically open the server tab > new > select your tomcat installation path and then .. just run it on the server. You can even modify code while running your app.
I was able to make this work using some helpers from: Running Tomcat from within Eclipse always gives me 404 (but index.html works) and following these steps:
I suspected that there was something wrong with the initial set up in eclipse. So, I closed the project in eclipse using: Right Click project > Close Project
Then I deleted any files related with eclipse from the folder. These were: .settings, .project, .classpath
I then Re-imported the project as maven project.
I used Window > Show view > server view
In the server view I created a new server and pointed it to XAMPP > tomcat since I already had tomcat.
Right click on the project > Run As > Run on Server.
It should run properly at that point in the browser as well
Make sure to check Right Click Project > Properties > Deployment Assembly - There should be Maven Dependencies added to the project and the deploy path for that should be "WEB-INF/lib"
here is a my way to debug and run maven web project with eclipse. though code is not hot deployed but it works fine for me.
Steps are as follows
open command prompt and go to your project directory. Lets say it is /opt/myhome/myproj
run mvnDebug tomcat:run command, make sure you have mvn and mvnDebug at system path
A message will be appeared like one mentioned in screenshot attached below, this states that maven is waiting for remote connection.
Now we need to Remotely connect to maven from IDE. To do that
Right click on the project and select "DebugAs" ---> "Debug configuration"
Add an new entry under Remote Java application with highlighted details and then select Debug button.
switch back to your terminal and you will get a screen like one displayed below
your web app is ready to debug, put a break point and call it and your IDE will switch to debug perspective
We are done with it. now if you make some changes in your code. you need to stop it from terminal with Ctrl-C and re-execute mvnDebug tomcat:run and then Remote Debug from IDE.
As i mentioned in starting code is not hot deployable as in local debug mode but it is pretty much better approach than rebuilding war and deploy it to external tomcat instance.
I hope this targets your query
I am going to use Git version control by IntelliJ Community Edition in order to make branches of the programs I intend to develop. I am striving to accustom myself to its functionality and I come accross obstacles.
I follow the instructions of the web-page http://wiki.jetbrains.net/intellij/Using_Git_Locally and although I do what it orders, when I reach Image5 I find an empty list under Default.
It is possible that it does not matter I thought, so I continued the procedure.
However when I come to most important section of Committing Changes to Master (Revision 1) the list is also empty and the commit changes does not detect any changes to my project (see Image13 and Image 14).
Apart from that, I receive a message when I open the project once more indicating that the Git execution path is not correct. But how can I get knowledge of what execution path should be appropriate so as to insert it?
Does anybody know a decent order of instructions (on a web site or by his won experience) which can guide me to how I can take advantage of Git functionality to incorporate it to my work? It is crucial for me to put my work through.
You need to specify the executable path of Git in the Git Settings, as mentionned in the per-requesites:
The Git integration plugin is enabled and the location of the Git executable file is correctly specified on the Git page of the Settings dialog box.
As long as you see "a message indicating that the Git execution path is not correct", the rest of the instructions won't work.
Path to Git executable
In this text box, specify the path to the Git executable file.
Type the path manually or click the Browse button to open the Select Path - Git Configuration dialog box and select the location of the Git executable file in the directories tree.
See "Where is git.exe located?" for the path of Git on Windows.
with Git for Windows:
C:\Program Files\Git\mingw64\bin
OR
c:\path\to\PortableGit-2.6.2-64-bit\usr\bin
OR
c:\path\to\PortableGit-2.x.\mingw64\bin
With GitHub Desktop:
%USERPROFILE%\AppData\Local\GitHub\PORTAB~1\bin\git.exe
Update 2020, three years later:
As noted by Daniel Connelly in the comments
IntelliJ now lets people install it through the path specified in the help above (just look for the "Download Now" button on the Git menu).
If you download Git from the website, a version that IntelliJ does not support will be installed.
GitHub for Windows on Windows 7 currently installs Git in a path similar to this:
C:\Users\{username}\AppData\Local\GitHub\PortableGit_93e8418133eb85e81a81e5e19c272776524496c6\bin\git.exe
The guid after PortableGit_ may well be different on your system.
On unix systems, you can use the following command to determine where git is installed:
whereis git
If you are using MacOS and did a recent update, it is possible you have to agree to the licence terms again. Try typing 'git' in a terminal, and see if you get the following message:
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
On Window machine install any version of Git. I installed
Git-2.14.1-64-bit.exe
. Got to search program and search for git.exe. The file can be located under
C:\Users\sd\AppData\Local\Programs\Git\bin\git.exe
.
Open Intelli IDEA>Settings>Version Control>Git. On Path To Git executable add the path. Click on Test button. It will show a message as
Git executed successfully
Now click on Apply and Save. This will solve the issue.
.
git.exe is common for any git based applications like GitHub, Bitbucket etc. Some times it is possible that you have already installed another git based application so git.exe will be present in the bin folder of that application.
For example if you installed bitbucket before github in your PC, you will find git.exe in C:\Users\{username}\AppData\Local\Atlassian\SourceTree\git_local\bin
instead of C:\Users\{username}\AppData\Local\GitHub\PortableGit.....\bin.
For Linux users, check the value of GIT_HOME in your .env file in the home directory.
Open terminal
Type cd home/<username>/
Open the .env file and check the value of GIT_HOME and select the git path appropriately
PS: If you are not able to find the .env file, click on View on the formatting tool bar, select Show hidden files. You should be able to find the .env file now.
Literally, just restarted IntelliJ after it kept showing this "install git" message after I have pressed and installed git, and it disappeared, and git works
I have faced problems in trying to install new portlets to Liferay running on Glassfish domain. I figured out the flow very lately and want to share it with others also. So, please read the answer and hope this helps someone :)
(Pre requisites for the problem is that I knew that adding projects running on Glassfish is done with a autodeploy folder, but making them visible on Liferay was another story.)
So, you make first a .war file let's say a portlet of name your_file.war. You wanna have it running on a glassfish domain under Liferay portal.
Steps to success:
1) Navigate to Control Panel -> Plugins Installation on Liferay
2) hit Install new portlets
3) hit Configuration
4) Fill in to Deploy Directory a new place for deployment let's say [your domain]/autodeploy2
5) Check that in the next line target is [your domain]/autodeploy (it is the Glassfish default deployment directory)
6) hit save
Now deployment will be done by copy pasting files to that new directory [your domain]/autodeploy2. The rest of it is handled automatically. Setting takes action imediatedly.
Done with deployment: Make a victory jig and enjoy :)
..you stop dancing and face a bug. You want a new revision to be deployed.. In this case, continue reading.
So, you have built your war again and want to re-deploy. Do the following:
1) undeploy old stuff from (your domain)/autodeploy folder by deleting the war file. Don't delete any other file.
2) result is that your_file.war_UnDeployed file will appear.
3) deploy new file by copying the newly built war in (your domain)/autodeploy2 folder.
4) result is that your_file.war_deployed will appear in (your domain)/autodeploy folder.
Make a dance again :)
There is several methods to deploy plugins (portlets, hooks, filters...) into your Liferay Portal.
If you're using Administration you can do it as Mico descripted. but if you're using Maven, Gradle, Ant, Ivi... you can configure their deployment descriptors and redirect their outputs (that are the wars) to the hotdeploy server folder (If you're using Tomcat, JBoss, Glassfish...).
This approach is quite better because you can create backup webapp folder and restore it whenever you want easily.
Below are not for Glassfish but common startup steps:
To install a portlet in lliferay portal
• first install liferay portal from below link
http://www.liferay.com/en_GB/community/wiki//wiki/Main/Liferay+IDE+Getting+Started+Tutorial
this requires installation of
liferay ide
liferay portal bundled with tomcat
add this tomcat as run server time and start it, it will start liferay portal
• create a portlet application
• open liferay at localhost:8080 and goto Admin -> control panel
• goto Plugins Configuration
• goto Intall tab and give location of war file (some logging error might come
at tomcat console, ignore it)
• again goto home page at localhost:8080 and click + button
• go at the bottom in the list and u will find ur portlet
• click add button present at the right side of it and ur portlet would be added to the page.
Modifying code of portel requires to uninstall and install again the portlet from war file.
All existing added portlets would also be modified.