EzDevInfo.com

appserver

A multithreaded application server for PHP, written in PHP. Next-generation PHP infrastructure – appserver.io next-generation php infrastructure consisting of a lightning fast webserver written in php plus additional useful services in one powerful bundle...

Web server vs App server

Is an application server something like an additional layer of application servicing above a web server?

Does an application server always have a web server as its core?

What is the difference?


Source: (StackOverflow)

Does application server create new thread for each request from same user?

Here is the simple scenario:

User triggers some operation from a web page of the web application. This operation is heavy one and takes some more time.

And before the operation is completed on server side, user triggers say same operation with some different parameters. so the second operation for second request will also start processing.

So in this case, are there two different threads like 1st one processing first request and other for 2nd request ? or it's just one thread processing both the requests and first operation is just interrupted (left uncompleted) for sake of execution for second request ?

Here I don't want to avoid user requesting same operation multiple times. Just want to know how it works.

This might be a silly question but i am little confused with this. And what is happening with me is adding into the confusion. For me it seems like operation for 1st request is not getting completed.

It's Websphere application server, if that helps.


Source: (StackOverflow)

Advertisements

Trusted certificates becomes invalid

In a Sun Glassfish server I have deployed an application that communicates with an external webservice over SSL.

I have manually imported certificates in cacerts.jks with java keytool cli (keytool -import -trustcacerts -keystore cacerts.jks -alias somealias -file somecert.cer).

I verify that everything works, but then after a longer while things stop to work and I get the following output in log:

[#|2010-06-18T09:13:23.930+0200|WARNING|sun-appserver9.1|...|_ThreadID=850;_ThreadName=p: thread-pool-1; w: 901;javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: The certificate chain from the server is not trusted|...|#]

And from here the service stops working. According to the log, shortly before the exception occurs, the certificate is questioned and the server by default replies no and I suspect this is what generates the error.

But what trigger the server to suddenly question the certificate? Certificate is already imported and marked as trusted in the keystore. All dates are ok. Have I missed something?


Source: (StackOverflow)

WebSphere equivalent in .NET

Is there an equivalent in .NET to a websphere-style app server? Something that will manage all our WCF endpoints across multiple projects/solutions, track dependencies and versions, handle WS-Discovery (or WSDL or whatever)?

Ideally something F/OSS?


Source: (StackOverflow)

How can I log the Glassfish domain?

I do a bit of logging in a ServletFilter to log which web services are being called, response times, etc, and I would ideallly like to log the domain name of the running Glassfish server. But so far I have not been able to come up with any way of programmatically access this info.

Do any of you know of a way to access this info from the currently running web application?

org.glassfish.admin.amx.base.DomainRoot seems to have some methods that might give some info, but I have no idea on what classes implement these interfaces.


Source: (StackOverflow)

Relative and absolute path on Apache localhost

I have installed Apache on my local machine (Windows 7, using AppServ). I opened a library called "MySite" under AppServ directory, so to access it I use the following URL:

http://127.0.0.1/MySite

The problem is that when I use

<link type='text/css' rel='nofollow' href='/stylesheets/main.css' rel='stylesheet' media='all' /> 

The file is not loaded since it tries to look it in http://127.0.0.1/ instead of http://127.0.0.1/MySite .

How can I change this?

Thanksm

Joel


Source: (StackOverflow)

How do I create a jetty 6 and jetty 7 compatible jetty-web.xml file in the same war file?

In Jetty 6 I need to create a WEB-INF/jetty-web.xml file which contains this:

<Configure id="webAppCtx" class="org.mortbay.jetty.webapp.WebAppContext">

But in Jetty 7 I need the same exact file WEB-INF/jetty-web.xml to contain this:

<Configure id="webAppCtx" class="org.eclipse.jetty.webapp.WebAppContext">

Both files differ (org.mortbay vs org.eclipse). How do I create 1 war file which is compatible with both jetty 6 and jetty 7?


Source: (StackOverflow)

How to enable PDO on AppServ on windows?

I am trying to create an app fir the first time using PDO and when i

try {
    $db = new PDO('mysql:host=localhost;dbname=DBname', 'user', 'pass');
} catch(PDOException $e){
    echo '<div class="errorMSG">Failed to connect to database. Please try to refresh this page in 1 minute. However, if you continue to see this message please contact your system administrator.</div>';
    echo '<br /><br />' . $e->getMessage();
    exit();

}

ofcourse i have change pass user and DBname to the correct once but i have get an error could not find driver

So with few searches i found out that i need to enable pdo_mysql but i can't seems to find out where do I do that and how? Can some one please help me with how to enable this and/or get this to work on my local machine. I have windows 7. I can't find where is my php.int is located.

Thanks :)


Source: (StackOverflow)

How can I stop the spawned process in jetty 7 using jetty.sh?

I am using Jetty 7.4 for one of my projects. I need to configure it so that it can start/stop automatically whenever the server starts up or goes down. Also, I should be able to start/stop the server on demand. I am using the start/stop script that comes along with jetty(bin/jetty.sh). The server starts just fine. However, when it comes to stopping the server, I am facing some problems.

Jetty expects you to start the server with "--exec" command line parameter and this parameter spawns another JVM instance. Now there are two processes running for jetty. When you try to stop the jetty server using the script the first process dies successfully. However, I can still see the spawned process.

I've searched the web and people have asked this question at multiple places but I could not find a solution to this problem. Any ideas?

thanks,

NG


Source: (StackOverflow)

Are java app servers able to destroy threads? If yes, how?

Destroying threads is deprecated in Java (and not implemented according to javadoc), and interrupting it is only a suggestion which upon the thread is expected to quit, but might not do so. (Not to provide any way to kill a thread inside the J*VM* is a disturbing design, but my question is not design related.)

How do Java application servers unload applications? Are they able somehow to destroy the threads of an application being unloaded? If yes, how? If no, then a single thread of a deployed app with an infinite-loop could bring down an entire app server without any possibility to intervene?

Sorry that I'm not writing test cases for this, but I would like to know what is really going on there.


Source: (StackOverflow)

Multiple JVMs vs single app server

I'm dealing with a system that runs a Java application per customer in its own JVM. We've got about a half dozen dedicated servers that are running close to 100 JVMs total now and sets of custom scripts for managing these JVMs. This setup is really showing its age at this point: managing that many JVMs is becoming a monitoring/management nightmare and we are constantly dealing with heap sizing issues. We'd like to move to a more modern approach and just run a bunch of applications in a single app server per physical machine. However, keeping the applications separate does have distinct advantages in terms of isolation (e.g. out of memory errors only affect one customer). Each customer's software stack has memory requirements that vary widely.

My question: is there a way to have the best of both worlds here and run multiple applications in one JVM (app server) and still maintain some level of isolation? Or is it just a modern fact of life that you need to manage memory requirements of a set of applications these days? Are there other solutions here besides an app server or Java EE container (e.g. Wildfly or Spring) that I'm missing here? It seems like this system is a holdout from another era!


Source: (StackOverflow)

Can I get the tenant ID when an app is deployed on AS

all. I wonder if I can get the tenant ID except for carbonContext API. I see this set of API can get anything from the server, but it is too powerful to be exposed the the developers. An evil dev-er can easily get the whole osgi services. He can even modify other users's registry by just setting the tenantID to others. So is there any method I can use, to get the tenant ID of an app?


Source: (StackOverflow)

Run the some code whenever I upload the project on to the app engine server

I've built an appeninge project so, how can I run some piece of code on the appserver only once, i.e when ever I upload the whole project on to the server.

How should I achieve this task???


Source: (StackOverflow)

Avoid Byte Code injection Java

I am currently using javassist to manipulate byte code at runtime for my appserver. I am not creating methods or changing prototype nor creating additional member variables. Are there any security policies or any other ways to block runtime byte code manipulations.


Source: (StackOverflow)

php - Fatal error: Call to undefined function mcrypt_get_iv_size() in AppServ

I found a problem when I use mcrypt_get_iv_size function via AppServ.

I try to find a topic that related to solved a problem.

However, I try yo download libmcrypt.dll into symtem32 and edit php.ini by removing a comment from ;extension=php_mcrypt.dll to extension=php_mcrypt.dll. Then restart apache.

Unfortunately, after reload a page to see a result after modify.

It still error as Fatal error: Call to undefined function mcrypt_get_iv_size() in C:\AppServ\www\folder\index.php on line 36

A function contains following:

class Encryption {
    var $skey     = "SuPerEncKey2010"; // you can change it

    public  function safe_b64encode($string) {

        $data = base64_encode($string);
        $data = str_replace(array('+','/','='),array('-','_',''),$data);
        return $data;
    }

    public function safe_b64decode($string) {
        $data = str_replace(array('-','_'),array('+','/'),$string);
        $mod4 = strlen($data) % 4;
        if ($mod4) {
            $data .= substr('====', $mod4);
        }
        return base64_decode($data);
    }

    public  function encode($value){

        if(!$value){return false;}
        $text = $value;
        $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
        $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
        $crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->skey, $text, MCRYPT_MODE_ECB, $iv);
        return trim($this->safe_b64encode($crypttext)); 
    }

    public function decode($value){

        if(!$value){return false;}
        $crypttext = $this->safe_b64decode($value); 
        $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
        $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
        $decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->skey, $crypttext, MCRYPT_MODE_ECB, $iv);
        return strtolower(trim($decrypttext));
    }
}

Thanks


Source: (StackOverflow)