Questions About Appserver

secure cookies when https is done on balancer, but balancer->appserver is http

We're trying to maintain PCI compliance for our application and after an audit, the report was telling us that we need to set the secure flag on our cookies. The site is HTTPS (using pound for https termination) sitting in front of haproxy which serves to a number of backened appservers, as follows:

CLIENT ->(https)-> [Pound]->[HAProxy] ->(http)-> { app001 | app002 | appNNN }

I've done some research (googling) around but haven't been able to find anything definitive about this, but would there be any issue with an appserver setting a secure cookie over http between it and the balancer, and would it make it through to the client over https?

Our staging environment doesn't have SSL set up the same way as production so I'm unable to test this, but I'm trying to come up with a plan of action and see if there's anything I'm missing before we try to move forward with this.

JSR-160 access to a secured WebSphere AppServer

I'm trying to access a WebSphere 7 AppServer, which has security enabled, using JSR-160 classes. I can get a connection going with the following, provided I define the java.ext.dirs system property pointing at various WebSphere lib directories:

Hashtable env = new Hashtable();
env.put("java.naming.factory.initial", "");
env.put("java.naming.provider.url", "corbaloc:iiop:myhost:2809/WsnAdminNameService");
env.put("jmx.remote.credentials", new String[] { "admin", "password" });
JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL("service:jmx:rmi:///jndi/JMXConnector"), env);

But as soon as I access something like the stats attribute on an MBean, I get the following error:
        >> SERVER (id=4773e3aa, host=myhost) TRACE START:
        >> ADMN0022E: Access is denied f

How to implement extensions mechanism in appserver?

I developing the servlet that should work 24/7. And I want to create some extensions mechanism: placing new jar in classpath must be detected by the main servlet and some class should loaded (without appserver restart).

Purpose: main servlet recieves events and redirect data to process to loaded classes (extensions). Extensions implements some interface (e.g. IMyExtension).

Maybe there is way to find all classes that implements particular interface? Or what do you suggest?

Websphere ND Dmgr - AppServer collocation disadvantages

In a Websphere Network Deployment Architecture, what would be the drawbacks of collocating a deployment manager server with one or more managed application servers on the same host?

In other words, should I collocate Dmgr with other servers or have a dedicated host for it?

It would be interesting to hear about bad experiences anyone had while following the first approach.

Is it right to use full Java EE in this approach vs just a Web and Persistence Tier?

I want to devlop a site for managing sport stats. Lets say soccer stats. I want to pusblish a front end site with nice presentation for the public, no login required.

Im building a second site for the soccer leagues back office. This sites is where the soccer leagues will register their games anotation sheet so the statitics of each player will be calculated from that game. Here the league will register the instructors, catogories (range of age), and players.

I thougth using Full Java EE architecture. Develope an EJB project common both for front end and back office webapps, and a Front End and Back Office as I mentioned. Im planning using wicket for both sites. But I'm planning to publish on a 1GB RAM VPS with Glassfish 3.

Another option is to make a common project(eclipse), and make 2 webapps using that common project. That common project is a JPA project and have some common dependencies (Apache commons lang), that I will use in all projects. So deploy t

servletConfig.getInitParameterNames() is not working

I need to show two URLs into a JSP, but I want to pass some init parameters to the JSP page for doing this.

So, this is my web.xml :

<web-app ... >

In the index.jsp, I wrote the following code:

    // This is only a test code. Obviously, it doesn't show the URLs
      java.util.Enumeration e = getServletConfig

Glassfish can not find JNDI DataSource while deploying

I am trying to deploy an ear in glassfish, but it fails to depoly it complaining that it can't find the DataSource written in the persistence.xml

In persistence.xml DataSource is configured asjava:app/jdbc/mysqlDS but it is looking for java:app/jdbc/mysqlDS__pm. This is weird. Any idea?

EDIT I have created following dtasources

  • mysqlDS
  • mysqlDS__pm


Here are some detail:

  • ear application
  • uses maven
  • application is deployed from eclipse

here goes the persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
  xmlns="" xmlns:xsi=""

Deploy from maven released repository to application

I just figured out, how to release to CB hosted maven "release" repository. I am trying to figure out, how to deploy tagged version to CB application. I understand, I can manually upload WAR file but is there any script. As far as I know maven plugin for CB doesn't support it.

I have one appserver is running snapshot builds from jenkins. I have other appserver, which I want to deploy only tagged/released artifact.

Glassfish Error when deploying WAR - Error occurred during deployment: Exception while preparing the app : Invalid resource :

I'm trying to deploy a WAR file called "VodfoneContractsDB.war". Its a simple web service created using Netbean's "RESTful Web Service from Database" wizard.

"Vodafone" is the name of my database connection.

I get the following error message:

Error occurred during deployment: Exception while preparing the app : Invalid resource : Vodafone__pm. Please see server.log for more details.

This is the log file:

[#|2012-10-01T09:23:35.542+0400|WARNING|glassfish3.1.2|org.apache.catalina.connector.Request|_ThreadID=119;_ThreadName=Thread-2;|PWC4011: Unable to set request character encoding to UTF-8 from context , because request parameters have already been read, or ServletRequest.getReader() has already been called|#]

[#|2012-10-01T09:23:36.052+0400|INFO|glassfish3.1.2|org.glassfish.admingui|_ThreadID=119;_ThreadName=Thread-2;|GUI deployment: uploadToTempfile|#]


UNION statement in query

I wrote a query but I got following error, Any ideas ?!

Error :

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in E:\AppServ\www\admin\index.php on line 545

Code :

                    require_once '../_db/databaseConnect.php';
                    $db = new databaseConnect();
                    $queryResult = mysql_query("(SELECT * FROM tabelcomments WHERE publishStatus = 2) UNION (SELECT appTitleFa FROM tableapps WHERE appID = '$appID');");
                    for ($dataCnt = 0; $dataCnt < mysql_num_rows($queryResult); $dataCnt++) 

Import Image works on GAE but not in

I'm using PIL for a GAE application, and have been importing the PIL modules directly using

import Image, ImageDraw, ImageChops,

The application works correctly with no complaints when uploaded to GAE but when trying to run with it refuses to import the modules.

Is there a way to force to recognize them, as GAE obviously supports them?

GAE can't import module in virtualenv

I'm trying to set up a (0.37) project in a virtualenv to run on Google App Engine (1.7.2) but I'm getting a ImportError: No module named web from the appserver.

I've installed using python install from inside my virtualenv and can confirm that it's installed properly because I can import it from the python interpreter.

My actual GAE folder is outside the virtualenv but linked like so:

ln -s ~/Development/google_appengine $VIRTUAL_ENV/google_appengine

and added to my python path in $VIRTUAL_ENV/lib/python2.7/site-packages/gae.pth

There must be an extra step I'm missing, heres the error message:

    ERROR    2012-10-03 09:03:17,442] 
Traceback (most recent call last):
  File "/home/sett/Development/google_appengine/google/appengine/runtime/", line 195, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())

Database connection not closed inspite of close statements

I am facing a problem in closing database conenctions. I am getting the below error


267137 [http-8080-Processor23] FATAL  - Failed to get a connection from DataSource JNDI/TPXSRUDB
org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted
    at org.apache.commons.dbcp.PoolingDataSource.getConnection(
    at org.apache.commons.dbcp.BasicDataSource.getConnection(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(

http 401 for Spring Tutorial when running "ant list"

I'm tired of Googling.

I'm getting this stacktrace when running "ant list" from the command-line:

/home/tgh/workspace/FiLTH/build.xml:138: Server returned HTTP response code: 401 for URL: http://localhost:8080/manager/html/list
at org.apache.catalina.ant.AbstractCatalinaTask.execute(
at org.apache.catalina.ant.AbstractCatalinaTask.execute(
at org.apache.catalina.ant.ListTask.execute(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(

error while creating adminclient for websphere

I need to develop an application for managing WebSphere Application Server v7.0.0.11. I explored a bit and found out that we can use Mbeans. Actually I need to create something similar as Web-sphere's web console.

My problem is that the application should be in C# .net so is there any connector/Adapter to invoke web-sphere's management API. Please point me in right direction.

I am a developer and a total newbie in java/websphere, I tried creating Admin Client Example from IBM site by using packages found at IBM/Webshpere/Cimrepos directory. The name of Jar file is I unzipped that jar file in the same folder.

So now My App is starts, connects to websphere successfully and finds mbean on the nodeAgent. The problem I am facing in invoking mbean. I am getting following error message.

exception invoking launchProcess : Target Method not

https only connects in local using Apache

I'have configured apache to use ssl certificates, when I type it connects on local, but when I try outside of the server, it doesn't connect.

Here are my config and other details, I hope some one can help me.

Firewall exception for port 443 is enabled.

OS :

windows server 2008 R2

Web server:

AppServ 2.5.10(Apache 2.2.8,PHP 5.2.6,MySQL 5.0.51b,phpMyAdmin-2.10.3)

Note: I have purchased the domain at , when I type, www.mysite or it works good(it have been working good since 2 years ago)

httpd.conf file

Added :

Listen 443


LoadModule ssl_module modules/


DocumentRoot  C:/AppServ/www/SaresInterno 
SSLEngine on
SSLCertificateFile C:/AppServ/Apache2.2/conf/c

Puppet Can't Start Service That Can Be Started By Hand?

On Debian, I have written a simple init script for a Pyramid application using pserve. I am not 100% sure that it is complete/correct, but it works for now:

DAEMON="/home/project/.virtualenvs/project/bin/pserve /home/project/production.ini"

case "$1" in
    echo "$1 project app server: "
    cd $CWD
    $DAEMON $1 --pid-file=$PIDFILE --user=$USER --group=$GROUP --log-file=$LOGFILE
    if [ "$RETVAL" -eq "0" ]; then
        echo "Success"
    echo "Usage: /etc/init.d/project {start|stop|restart|status}"
    exit 1

exit 0

When I log in as root, I can run the following without issue:

~# service project start
start project app server: 
Changing user to project:project (200:1001)
Entering daemon mode

I put the followi

GlassFish cluster-targeted jdbc is not enabled

I have a GlassFish cluster.

When I tried to add node and a instance, DAS saids a bunch of error messages telling

Resource [ jdbc/xxxx ] of type [ jdbc ] is not enabled

        at Method)
        at sun.nio.cs.StreamEncoder.writeBytes(
        at sun.nio.cs.StreamEncoder.implFlushBuffer(
        at sun.nio.cs.StreamEncoder.implFlush(
        at sun.nio.cs.StreamEncoder.flush(