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.
Related
I need help on this. If I deploy the code manually application is reachable, endpoints working fine, but throws 404 when I deploy from eclipse. I changed property of tomcat from workspace metadata to /servers tomcat v8.0, changed the server location to "Use Tomcat Installation" on server overview. I even tried with copying ROOT folder from tomcat installation folder/webapps to wtpwebapps though it existed there.
Donno what else I can do. I can see server welcome page. I can access service endpoints when I manually deploy in same server but not after publish from tomcat. I seek some help on it.
Try this,
Project: Properties-> Java Build Path-> Add Library -> Select "Server Runtime" from the list-> Next->Select "Apache Tomcat"-> Finish
I'm trying to add a new tomcat server in eclipse. However, when I'm defining a new server, the interface seems abnormal(the icons are all red):
what's more, after I click 'Next', there is no page telling me to select Tomcat installation directory.
After I click on finish, there is a problem pop up and I cannot start the server:
Could anyone tell me what's wrong with my eclipse and what should I do? Thank you!
my environment:
eclipseEE: neon.2
os: macOS Sierra
tomcat: apache-tomcat-8.0.41
Close Eclipse ide
Go to {workspace-directory}/.metadata/.plugins/
Delete the following folders:
org.eclipse.wst.server.core.prefs
org.eclipse.jst.server.tomcat.core.prefs
org.eclipse.core.runtime/.settings
Open Eclipse ide and try to configure again
Another option is when you open Eclipse ide and choose other workspace and configure all again.
If the problem persist maybe your eclipse or tomcat files are corrupts, try to download and setup all again.
I'm trying to deploy-on-save a sample Wicket project from Netbeans 8.0.2 with pom.xml generated as shown here: http://wicket.apache.org/start/quickstart.html. I have added Tomcat to servers and added an admin user and password (checked tomcat-users.xml, of course). When I "Run" the project, Tomcat starts, but the project is not deployed. The "Run" output shows
NetBeans: Deploying on tomcat8
profile mode: false
debug mode: false
force redeploy: true
Starting Tomcat process...
Waiting for Tomcat...
... and once I "Terminate" Tomcat from Servers tab, the build goes ahead and ends up with a WAR file generated in the project's target directory.
I haven't done any changes to the default Tomcat configuration other than adding a user.
By contrast, deploy-on-save works fine with Glassfish-4.1.
I've tried to change the server port and adding <netbeans.hint.deploy.server>t8</netbeans.hint.deploy.server> to pom.xml as some posts suggested (for earlier netbeans versions, though) - but no success so far.
So, is it possible to configure deploy-on-save for tomcat-8.5 in netbeans 8, and if yes, then how?
Ahhaa, upgrading to Netbeans 8.2 (from 8.02) did the trick!
Now, when you "Run" the app, another window pops up and asks for manager password again but just once. That is, the same you gave when adding a server. It seems that one has to add <role rolename="manager-script"/> to tomcat-users.xml manually to avoid this double-asking.
After the first run, the app is re-built and re-deployed on Save.
How to rectify module deployment error while using GlassFish Server?
While trying to run jsf web-application in Netbeans8 I am getting the following error:
ant -f C:\\Users\\admin\\Desktop\\WebTime -Dnb.internal.action.name=run -Ddirectory.deployment.supported=true -DforceRedeploy=false -Dnb.wait.for.caches=true -Dbrowser.context=C:\\Users\\admin\\Desktop\\WebTime run
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
Starting GlassFish Server
GlassFish Server is running.
In-place deployment at C:\Users\admin\Desktop\WebTime\build\web
GlassFish Server, deploy, Connection refused: connect, false
C:\Users\admin\Desktop\WebTime\nbproject\build-impl.xml:1045: The module has not been deployed. See the server log for details.
Being new to programming, I need hint to rectify this error. Kindly help me to rectify it.
The line:
GlassFish Server, deploy, Connection refused: connect, false
... is a clue.
I had the same error, but I solved it. The steps:
1) Grant privileges to write on the glassfish server installation folder. If you use Windows the path is:
C:\Program Files\glassfish-xx
2) Run C:\Program Files\glassfish-xx\bin\asadmin.bat as Administrator. Then in the console type: start-domain
3) Clean and Build the project
4) Deploy
5) Run
PD: I recommend use JDK7
after a whole day solving this problem on my own, because nobody's answer was usefull for me on internet, I found following:
don't try to use different web server (I tried wildfly), it wont
help.
give glassfish folder permission to write (I mean the folder with
version in name)
restart pc to shut down all (or the) running server
after my restart, I got still the same error during developing build-impl.xml:1045: The module has not been deployed., but now there was different error in server log - java.lang.IllegalArgumentException: Invalid URL Pattern: [{0}].
Then I realised that my problem was in web.xml file, where I tried to set different welcome page. All other projects with this file untouched were working (developing, running) properly
so this was my story of waisting whole day - check your web.xml file
Being new to programming, I need hint to rectify this error. Kindly
help me to rectify it.
If you look carefully, the hint is given in the output itself.
See the server log for details.
In NetBeans IDE output's sub-window, you should see another tab called "GlassFish Server", you can look there for logs from the server.
Alternatively , you can use GlassFish's Administration GUI to see some more detailed logs, it is accessible in a browser and by default from localhost:4848.
While trying to run jsf web-application in Netbeans8 I am getting the
following error:
Looking at what you have posted (project's deployment log), I can say your GlassFish instance is running fine , but your project contains errors, so it couldn't be deployed.
I doubt anyone here can concretely solve your problem because we need more details from GlassFish's logs.
Suggestion : Edit your question by appending GlassFish's logs.
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