How to connect NetBeans 8 with Tomcat 8 in Mac OS X? - macos

I found other Questions and Answers dealing with getting the NetBeans IDE to talk to the Apache Tomcat servlet container. But they seem to be out of date or involve extraneous steps. I remember the process as being less complicated on my Mac. But I cannot remember the exact steps.

Indeed, getting Tomcat to talk to NetBeans is fairly simple though not obvious.
Java EE edition of NetBeans
If downloading NetBeans, grab an edition of NetBeans IDE already bundled with Tomcat. You may need to customize the installation to get Tomcat, as described in this Question.
But that version of Tomcat is likely to be out of date. So let‘s look at hooking up a fresh copy of Tomcat with NetBeans IDE.
File Permissions
First be sure your copy of Tomcat can run. The permissions by default usually do not allow execution, at least in my experience on a Mac. So reset the permissions. If you are a Unix whiz, you can do so in the command-line. The rest of us use the BatChmod app.
I turn on all the checkboxes except Clear xattrs.
Verify that Tomcat can run by executing the startup.sh file in Tomcat’s bin folder. Point your web browser to http://localhost:8080/ to see a Tomcat page. Then run shutdown.sh to quit Tomcat.
Tip: You may delete all the files ending in .bat. Those are "batch" files used only on Microsoft Windows. Mac OS X uses the Unix files ending in .sh instead.
Define a Server in NetBeans
In the Services pane, context-click on the Servers item. From the context menu, choose Add server.
Big NetBeans Tip: When in doubt, context-click. While the Mac convention is to provide a main menu item for every item with context-menu being a mere convenience, NetBeans depends heavily on context-menus.
In the dialog that appears, choose Apache Tomcat or TomEE. Type a name to be displayed in NetBeans list of "Servers". I suggest typing "Tomcat" plus the version number.
Click Next for the next panel of this Add Server Instance wizard.
Tomcat Location
Click the Server Location > Browse button, and choose where your Tomcat folder. I keep mine in my "home" folder.
Deployment Location
Turn on the Use Private Configuration Folder checkbox.
We need to choose a folder where we want Tomcat (specifically, Tomcat’s Catalina module) to do its work, keep its temporary files, keep its logs, and place the installed copy of your web app when you run from within NetBeans. You must create this folder. The folder’s location can be anywhere. For its bundled version of Tomcat, NetBeans uses a folder nested in ~/Library/Application Support. But I tend to create a folder in my home folder with a nested folder for each version of Tomcat, ~/Apache-Tomcat-Netbeans/8.0.27/ for example. Unix & Java tend to get cranky about spaces in file paths, so I use hyphens rather than spaces in those folder names.
Click the Cataline Base > Browse button to display a file picker. Use the Create New Folder icon button in the upper right corner to create the folder hierarchy you want to use for your web app’s deployment when run from NetBeans (as discussed in previous paragraph).
Tomcat Manager User
Lastly in that panel, make up a user name and password to be used as a Tomcat "manager" to startup and shutdown Tomcat. Be sure to check the Create user if it does not exist checkbox.
The wizard panel should look something like this screen shot.
Click the Finish button. And voilá, you have a new Tomcat server defined within NetBeans.
The last step is to tell your project to use that server.
In your project’s Properties dialog, set Build > Run > Server (popup menu) to your newly defined server.

Related

JDeveloper stuck on Generating the business service

I am using JDeveloper 12.2.1.2 on Windows to develop applications for OSB.
I had previously used the database adapter in another project within the same application. Now when I drag a DB adapter into the composite, the wizard prompts me for all values, then gets stuck on "Generating the business service..." message without actually adding it. The menu works. I can perform other functions.
I tried closing JDeveloper and restarting, then adding again. Stuck at same point.
Found the problem.
I had created a folder named "Database" under "Resources". In the first step of the wizard, I selected this folder as the location to create the business service in.
I then noticed that the files were getting created in "Resources". Apparently, JDeveloper messes up the location and then gets stuck because it can't find the files it creates in the wrong folder.
The solution is to not make any changes to the default folder location.

How to associate types of files in Mac Finder to be opened by IntelliJ IDEA in "LightEdit" mode if I am a JetBrains Toolbox user?

IntelliJ IDEA 2020 can (finally!) simply open a file to be edited, without a project being involved. This is called LightEdit mode.
At this point in a JetBrains video, we see the host platform's file manager app opening a file via IntelliJ while noting that all such files should be opened using that same tool.
No "IntelliJ" application to choose
The problem for me is that I am a happy user of JetBrains Toolbox app to automatically install, upgrade, and open IntelliJ. So in my "Applications" folder on macOS, I have no "IntelliJ" application to choose in the Mac Finder when trying to open a file.
Is there some other way or trick to getting the Finder to know to open files with IntelliJ? And preferably with the latest version, as I believe Toolbox may keep around the older versions.
Basically, I am asking the same as this Question, How to make available “open this project in IntelliJ IDEA” option in Windows context menu, if IntelliJ IDEA has been installed via JetBrains Toolbox?, but for macOS instead of MS Windows. The Answer on that other Question is Windows-specific.
As a Toolbox user you still have access to the "generated shell scripts" (/usr/local/bin/idea, or things like /usr/local/bin/phpstorm, /usr/local/bin/pycharm, etc for individual applications).
But, these are shell scripts, and cannot be used for this because they lack the application identifiers needed by the OS for launching apps.
What you can do is wrap any of this with an Automator application. By wrapping the shell script directly, it should remain updated (since the shell script is itself a Toolbox generated wrapper that points to the latest installed version).
To do so:
Open Automator and click on the "new document" button.
Select "Application".
Add a "Run shell script" action from the library:
Change the "pass input" dropdown from "to stdin" to "as arguments".
Create a script similar to this this (replace phpstorm with idea or whatever IDE you have installed):
for file in "$#"
do
/usr/local/bin/phpstorm -e "$file"
done
Save the application somwhere, with a descriptive name:
Once that one is saved, you'll be able to use it to launch files from Finder, or even set it as default for a file type:
Use the app's menu: IntelliJ IDEA -> Preferences -> Editor -> File Types
Then press the Associate File Types with IntelliJ IDEA button.
A window will open with file groups you could choose from, and then press the OK button, then Apply and another OK.
After this, a MacOS restart is required.

How to correctly create a ColdFusion Builder project?

I am trying to run ColdFusion existing project in my local system, I am getting the error message below. Am I missing anything?
Selected file is not in the document root of the server. If the
project is not in the document root, create a linked folder to the
document root (selecting Project Properties > ColdFusion Project)
Try to do it:
https://forums.adobe.com/thread/896469?tstart=0
The bottom line: In CFBuilder, go to the Servers view and right click on the local server running you are running against. When the initial screen comes up, check to make sure all of that is correct, then click NEXT. On the next view ("Local Server Settings") there is a path for the Document Root. Make sure that's correct and click Finish.
The background: I had to relocate my Apache server to a new directory with a different name. Even though I changed all of the associations in the Projects and the Workspace and the httpd.conf file for Apache, the localhost settings in CF Builder were still pointing to the old Document Root. Once I corrected that, everything worked like a champ.

Deploy a MVC 3.0 web application project on IIS 8.0

Normally, in webforms , when you have to deploy the application , we publish from the Visual Studio and put the published folder only on the server (IIS). But, in MVC web applications , how is it done.
Does it follow the same way (published folder only on server ) or some other method.
I have tried the following methods but not got any result .
Web Deployment Package - After going through this tutorial -> http://pluralsight.com/training/players/PSODPlayer?author=scott-allen&name=mvc3-building-deploy&mode=live&clip=0&course=aspdotnet-mvc3-intro
under the Web Deployment Packages tutorial ,i found how to create a web deployment package which can be imported in the IIS Management Tool. Then I found out this link to help me with the same ->
http://www.iis.net/learn/publish/using-web-deploy/building-a-web-deploy-package-from-visual-studio-2010
. But after following all the steps I got this error ->
(See Screenshot)
What is/are the missing steps in this method?
2. Add roles - Windows Server 2012 - turn certain features of ASP.NET 3.5 and ASP.NET 4.5 on.
I followed this tutorial for the above step ->
http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-using-aspnet-35-and-aspnet-45
As per the tutorial , I should for deploying a MVC 3.0 application , turn on the ASP.NET 3.5 and ASP.NET 4.5 features under the "Application Development" Tab . After this, to deploy the application ,i should under the "Advanced Settings" pop up choose .net V2.0 as the Application Pool ( See ScreenShot)
But even after following the tutorial i get the same error "Server error in Application ...."
3. Publish under the "File System" Method.
We right-click the project and select "Publish" and a Dialog box pops up showing the various options for deployment. In this we select - " File System" ( See Screenshot)
We published the project , but got the same error once again.
Problems / Questions ->
1. What is the correct full proof way of deploying a MVC 3.0 application on IIS 8 . ?
2. Do we need to put the whole solution on the server and run from there or otherwise
3. Are we missing some step or some command in the above three methods
4. Our requirement is to essentially find a way to put only the published folder on the server and run , but is that how it really works in MVC ( like web forms ) ?
5. File System approach ( point 3 above ) is something which is done commonly for Webforms , is it advisable to do the same in MVC as well .
6. The Deployment is working on localhost , but when tried by creating a Virtual Directory , it is again not working .
Working environment is Visual Studio 2012 - Web Server Windows Server 2012- IIS 8
Need help to solve the confusion.
Regards,
Mangesh
I have found a complete solution to Deploying an MVC 3.0 Application using IIS8 on Windows Server 2012. Here are the Steps:
Start your Visual Studio and select the "Run as Administrator" Option while running the IDE.
Change your Web.config to add the following line of code .
<globalization culture="en-US"/>
This ensures that even if your Target server has some different Settings, you enforce your own settings by mentioning this line of code. Otherwise , you might get problems such as
-- Submitting a form which has a Date Field , you might not be able to submit as the Date will be set to
01/01/01 :00:00:00:00
Build - Follow three sure-shot steps .
a. Clean Solution
b. Build Solution
c. Re-build Solution
Check-in your solution completely if you are working on a shared Environment . Right click on the Project Solution and select the Publish Option. ( ScreenShot)
This opens up a Dialog Box such as this.(Screenshot 2) . This will show you possible options for deployment and some other settings.
On this screen you do not have to do much and pretty much it automatically sets the default settings for the current publish profile.
Next Screenshot :
Click on the next tab and you will see a bunch of options such as the following:
The first option asks you for the publish method . They are four options in this :
a. Web-deploy
b. Web -deploy package
c. File system
d. FTP
e. FPSE.
My Publish Method is "File System". I have also deployed applications using the Web- Dpeloy and the Web- Deploy Package, but for the sake of this article I will stick with File System.
The next parameter asks the Target Location where u want the Published folder to be. This can be a local Location on your Hard-Drive or a Remote location on the server. I have chosen a remote location on the server , there i have created a Publish folder and it is here where all my files will go after Publish.
The Destination URL is optional . I have left it Empty.
Lets move on the next screen shot.
The Settings tab gives u the following options :
Configuration: There are two options in this drop Down - Debug and Release. Choose Release option.
Make sure u tick the "Delete all existing files prior to publish" Option. This will clear all the existing files prior to every time u publish your project.
This method of publishing does not support Database Publishing . Hence , if you are creating one in your project , then do not use this for publishing. In my case, I have used an external Database for binding to my Model Classes , hence this method will work.
In the next Screen Shot : You preview your settings before you publish the project.
It will show the Target folder where the published Files/Folder will reside and the Project it is going to publish and again the warning stating that Databases will not be published .
Click on publish .
Check your Output Window as it will show Line by line the steps it will take for publishing.
In the end , it will display the message of Successfully Published Project .
Next step: Go to your location where your published files will be kept.
ScreenShot:
You should get something like this :
This is your published Folder and the Files . Lets now tweek the IIS to run web-site.
Go to IIS8 and right click the on this option as per the screenshot. ( This shot may vary from system to system ).
Click on Add Web Site which opens up another Dialog such as below .
Enter Your Site Name and then Click on the "Select" Button on the right -hand side of the page, which will open up another Pop-Up as below.
Select your appropriate Framework from this Drop Down. Since mine is an MVC 3.0 Project , i went for ASP.NET 4.0 Settings. (Please try these options to know which settings suit you.)
Moving on, Enter/ browse to your physical Path where your solution is kept. In My case, the screenshot I showed where all my published files went . ( Sometimes to avoid conflict of folders , create a separate folder and enter that as your physical location and just copy the files from the folder where you published it to the new folder )
Leave rest of the entries as it is. If some application is already running on the Default -80 port , then give a new port . Click on OK.
Restart your IIS . Go to the browser and type out the URL .
And thats it !!
Your MVC 3.0 Web Application has been successfully Deployed.
Thanks,
Mangesh
(PS -Please leave your comments for anything which is not clear and if you find it useful don forget to +1 :))

XCode Project is not version controlled

I have linux and svn server running and can terminal into it from my mac. In xcode I have setup a repositories and setup the folder structure branches, releases, tags, trunk for a project.
I have imported my first project into the trunk folder successfully.
I then create a different folder locally
In Xcode SCM, I navigate to /truck/ and click on it.
I click the checkout button and choose the location. It checks out successfully and prompts if I wish to open project so I do.
Everything appears fine but when I test by making changes to a file, I do not get any file status letters 'M' etc telling me that the file has be modified. It does not seem to be version controlled even though I have checked it out.
Any ideas?
As well as Foo.xcodeproj (which is actually a directory, not a file, even though it looks like a file in the Finder), you also need to put Foo.xcodeproj/project.pbxproj under version control, since this is where all the important project-related stuff is actually stored.
Don't bother putting anything else under Foo.xcodeproj/ into version control - these are just user-specific settings: window positions, breakpoints, etc.

Resources