• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Embedded Tomcat 7 - add connector not being added  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trying to add a https connector to embedded Tomcat, but the new port is not working, not listening.
netstat -an shows port 9010 listening, port 8443 not showing up.
Not sure what to try at this point.
Any help would be great,
Thanks Stephen

Code part: below


 
Bartender
Posts: 20727
124
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Stephen!

Nothing really pops out at me except that you are allocating an HttpsConnector in the startTomcat method only to discard it in favor of a freshly-allocated HttpsConnector.

Which seems kind of pointless, but I'm not sure it should have actually stopped a proper Connector from opening.

In the normal stand-alone Tomcat, you'd see log messages as the various ports were opened. Maybe you can get this info from the embedded form?
 
Stephen Goodall
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, i can cleanup the httpsconnector, originally I wasn't doing that, but started trying everything.
I'll try to see about what I can log.

with the above netstat should show the 8443 port? would you agree
 
Stephen Goodall
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fixed!
My keystorefile parameter was not including the path correctly. oops!

I was able to see that only after I added logging to the Tomcat startup.

I added the following code(which I found on another forum) in the StartTomcat() method.

This was added:
import java.util.logging.Level;
import java.util.logging.Handler;
import java.util.logging.FileHandler;
import java.util.logging.SimpleFormatter;

if(tomcatLog)
{
Level level = Level.ALL;
java.util.logging.Logger logger = java.util.logging.Logger.getLogger("");
logger.setLevel(level);
//Logger logger = Logger.getLogger("");
Handler fileHandler = new FileHandler("C:\\tomcat.out", true);
fileHandler.setFormatter(new SimpleFormatter());
fileHandler.setLevel(Level.INFO);
fileHandler.setEncoding("UTF-8");
logger.addHandler(fileHandler);
}
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!