So I am deploying my REST webservice... Normally I always had it locally hosted on my own computer, but now I am done with the application so I want to host it for real, yet I am stuck deploying it, it keeps on saying: deploying...
So locally it works, but now I've added a remote server and I've tested it with a blanco webservice, and that does work.
Does anyone know what is going on? Because there is no error at all...
BTW I have tested to deploy it with the admin site thing, the [website]:4848 > application > deploy > [add war] --- but that crashes as well... after like 30 seconds of nothing, the webpage says: The connection was reset.
No clue what it is, but if anyone else sees this in the future, where they cannot deploy their webservice, because it takes forever, here's the solution:
Copy your .war that you have build onto the server
./asadmin deploy (For glassfish 4.1, this is located in the [main directory]/bin)
Fill in all information needed
That's it :) I don't like it either, but at least it's a way to deploy!
Related
So, I have had a working Tomcat JDBC session storage solution for some time. I deployed what I consider to be an unrelated change (and I rolled back to previous war and the new issue still exists).
The problem
I can reproduce the problem like this
systemctl restart tomcat
wait for wars to load, manager to respond etc
access web app page that fetches for session, syserr:
java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.apache.catalina.session.JDBCStore.open(JDBCStore.java:955)
(this part of apache's JDBCStore imple tries to load db driver using class name)
I keep accessing the web page -> same error to syserr
I keep doing this for a minute or so
Error suddenly no longer appears and session storage works as it should (persists new sessions all the way to db correctly, fetches sessions since prev restart correctly)
What I have tried
I have checked context.xml (that has the JDBCStore configuration) has not been changed by updates (and surely it is ok since the app does work eventually)
I have double checked jdbc driver is in tomcat/lib folder, has permissions etc (and surely it is since the app does work eventually)
I have tried to think of any change on the server that might cause this but I'm drawing blank
Killing Tomcat with kill -9 <pid> instead of systemctl restart does not make a difference
Stopping Tomcat, waiting for ~3 minutes and starting up: no difference, still have to wait ~1 minute before session storage works
What I suspect it that somehow JDBCStore (which is "internal Tomcat stuff", not part of my app) can not load the driver with Class.forName, but some other app/connection poll that I have running on the same Tomcat succeeds, and after that JDBCStore also works. What I don't know is why this has come up now but not lets say a month ago. In any case, any hints would be nice.
Tomcat8
openjdk version "1.8.0_265"
RHEL 7.9
If tomcat could not open a connection to the database it will throw NPE, check this commit that fixes it. Update your tomcat that will be released which includes this latest patch and you won't get the NPE.
But check why you are not able to connect to the database.
I am deploying a WebApplication with several separate war and ear-files to a wildfly 10.1 server.
What I do is this: I clean the deployments, data/content and tmp folder, then copy all necessary war and ear files into the deployments-folder.
Then, I start the Server either in Debug-Mode via Spring Tool Suite 3.8.1 (basically Eclipse Neon) or directly via standalone.sh.
The server starts up normally, gets deploys all projects and publishes this message:
[org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started in 326001ms - Started 5819 of 6193 services (642 services are lazy, passive or on-demand)
The next message that follows, roughly half a second later, is the first Unregistered web context-message, followed by a general deployment stop.
There is no message in the log connected to this, neither an ERROR, nor a WARNING, SEVERE or FATAL in sight.
After stopping all Deployments, the server still runs, but no context is reachable.
When deploying the applications one-by-one, the server accepts, deploys and keeps running, which leads be to believe that there is something wrong with the server itself.
the memory-relevant VM-Arguments are these: -Xms1024m -Xmx4096m.
The server does not run on a timeout, as that has been thorougly tested and produces error messages.
Okay, long story short: comment was solution.
The parameters deployment-timeout in standalone.xml and jboss.as.management.blocking.timeout as command line parameter do work together on the same thing, considering blocking the command line parameter seemingly has precedence.
So if both values are set, and the management blocker is higher than the deployment-timeout, the following happens:
Deployment is started
Deployment timeout triggers
Management timeout still has time left and does not trigger to stop the server
Applications deploy within the management timeout period.
The After-Deployment Scanner checks the deployments directory for failures
Deloyment-timeout marked all deployments as failures
All Deployments are being undeployed as they are faulty
So: No error message, Deployment as usual, followed by instant undeployment. Should anyone else have that, check those values.
This is my situation:
Eclipse ide that i use to develop java web apps.
Tomcat from apache.
Tomcat stack from bitnami.
OS Windows 8
If i deploy and debug to the apache tomcat all work without problem.
If i try the same thing with the bitnami stack, i see the exact same output from the console, like it is starting well, but actually it doesn't and it gets to the timeout saying it was unable to start withing 45 seconds.
I tried to increase the timeout but that's not the problem.
In both cases the Server Location is set to Use Tomcat installation, and i added my project to the source, everything else in the server config is default.
I'm not an expert of tomcat and java webapp deploying, and i need to get it working with the bitnami stack.
Any hint will be appreciated.
Ok i solved it, seems more a problem from eclipse.
In the server configuration i noticed the HTTP port was not listed and it was commented in server.xml
Could this be because the bitnami stack uses port 80 instead of 8080?
Anyway setting the port 80 in server.xml solved the problem.
I’ve come to an hold with my programing because I’m getting an error from glassfish. I’m using NetBeans IDE 7.3 for this project. And I’ve built a simple program which runs over the web(jsp file etc). But I keep on getting the weirdest error display from glassfish. I’ve searched the internet for my solution and found people posting similar things, but I never seem actually manage to fix it because I don’t really understand the post which I’ve read.
So what is the error that I get at startup? First time I run it I get this from the Output
Starting GlassFish Server 3.1.2
GlassFish Server 3.1.2 is running.
In-place deployment at C:\Users\Vedo\Documents\NetBeansProjects\ÄrendeWebApplication\build\web
Initializing...
deploy?
DEFAULT=C:\Users\Vedo\Documents\NetBeansProjects\ÄrendeWebApplication\build\web&name=ÄrendeWebApplication&contextroot=/_rendeWebApplication&force=true failed on GlassFish Server 3.1.2
Error occurred during deployment: null. Please see server.log for more details.
C:\Users\Vedo\Documents\NetBeansProjects\ÄrendeWebApplication\nbproject\build-impl.xml:1038: The module has not been deployed.
See the server log for details.
The actually name of the project is ÄrendeWebApplication and sure it’s a weird name for some people.
Well anyhow I tried to run the application again just to make sure it’s not something spooky going on, and I got a totally different error message.
In-place deployment at
C:\Users\Vedo\Documents\NetBeansProjects\ÄrendeWebApplication\build\web
Initializing...
deploy?
DEFAULT=C:\Users\Vedo\Documents\NetBeansProjects\ÄrendeWebApplication\build\web&name=Ärende
WebApplication&contextroot=/_rendeWebApplication&force=true failed on GlassFish Server 3.1.2
Error occurred during deployment: Application name ÄrendeWebApplication is already in use.
Please pick a different name.. Please see server.log for more details.
C:\Users\Vedo\Documents\NetBeansProjects\ÄrendeWebApplication\nbproject\build-impl.xml:1038: The module has not been deployed.
See the server log for details.
Alright so this is the weirdest part since it’s complaining that the name of my application is already in use? So I thought first it could perhaps be something with the database, but went to see the “Java DB Database Process” and it seemed fine, will post it too just in case
Fri Jun 07 11:01:10 CEST 2013 : Security manager installed using the Basic server security policy.
Fri Jun 07 11:01:11 CEST 2013 : Apache Derby Network Server - 10.8.2.2 - (1181258) started and ready to accept connections on port 1527
So the database is not the problem “I Believe” so I went later to check on the Glassfish server 3.1.2 and I found some warning messages which read
WARNING: Multiple [2] JMX MBeanServer instances exist, we will use the server at index [0] : [com.sun.enterprise.v3.admin.DynamicInterceptor#297b0d9d].
WARNING: JMX MBeanServer in use: [com.sun.enterprise.v3.admin.DynamicInterceptor#297b0d9d] from index [0]
WARNING: JMX MBeanServer in use: [com.sun.jmx.mbeanserver.JmxMBeanServer#572b43d] from index [1]
INFO: EJB5181:Portable JNDI names for EJB ÄrendeDao: [java:global/ÄrendeWebApplication/ÄrendeDao!com.Ärende.dao.ÄrendeDaoLocal, java:global/ÄrendeWebApplication/ÄrendeDao]
INFO: WEB0671: Loading application [ÄrendeWebApplication] at [/_rendeWebApplication]
SEVERE: The log message is empty or null. Please log an issue against the component in the logger field.
And here is where I’ve tried different things, well I thought it first complained about the name, it’s alredy in use right…. So I deleted the application and moved it to another place on my hard drive and well, I wouldn’t be posting this if it worked. Then I started considering that perhaps the database was something wrong with, I went to the console admin in glassfish to check the connection and the Ping and showed me that it worked as it should. Also perhaps important information is that I’ve connected glassfish through MySQL, but I hardly believe that this is the problem. I then stumbled across someone saying that you could force “redeploy via Eclipse” well first problem here is that I’m not using Esclipse and second problem is I’ve searched A LOT to find if there is a “Force redeploy in NetBeans” and that is not the easiest task in life. So I believe this is perhaps my last stop hopefully and maybe someone here could help me out.
here are some steps you can try:
Fix your projects name :3
If your problem is the one the question title suggests, undeploy your application first, then redeploy. You can easily undeploy and force redeploy in the Glassfish Admin Gui (http://localhost:4848).
If your application still does not work, update your question with proper formatted log messages of the actual problem.
My eclipse used to work fine but now I am no longer the administrator of my computer(I no longer have administrator priveledges) and i see that my already installed and working eclipse is now showing errors in my jsp files of the application which it didn't used to show before..
also I am not able to connect to tomcat server which seperately can be started normally but not inside eclipse.....
Is this something to do with my not being administrator anymore of is it something else....
would highly appreciate the help.....
I have now been able to run my tomcat server without admin previledge but problem of many files showing error still persists.........
the below written jsp code is showing error in all the files....:
<%
pageContext.getRequest().setCharacterEncoding("UTF-8");
String label = pageContext.getRequest().getParameter("rswitb1");
if(label==null)label="";
else label = label.replaceAll("<", "<").replaceAll(">", ">");
%>
I am not able to get what the problem ....
if anyone could help...
The connection to the external tomcat should be using only TCP/IP port 8080, there is no reason why a non-admin user should not be able to do that.
It's possible that your tomcat password has changed (or hasn't been set up at all)
There is a troubleshooting section at the eclipse wiki (if you are using WTP, that is)
First,check out the tomcat server is on: "netstat -an" to
find that whether the port8080 is used(if you didn't assign another server port.).
check out whether the server is on(netstat -an).
Maybe 8080 is used by tomcat.
You'd better reinstall tomcat as non administrator.