I've got two versions (1.0 and 2.0) in karaf of the same war bundle containing the servlet running on the same address. I'm running it with this command:
bundle:install -s
"webbundle:file:///home/marat/projects/webmodule/target/webmodule-1.0.war?Bundle-SymbolicName=Runner&Web-ContextPath=/sample"
And both war bundles are shown Active in Karaf webconsole.
I have an app that pings the address http://localhost:8181/sample/hello (the servlet) every 10ms (the app sends GET requests). Firstly the app is getting the answers from the servlet represented by war v1.0. If I stop the bundle containing war v1.0 I expect that karaf automatically switches the requests sent to address http://localhost:8181/sample/hello to war v2.0 since the servlet in that bundle is on the same address as of war 1.0. The app gets this response instead:
java.io.IOException: Server returned HTTP response code: 401 for URL:
http://localhost:8181/sample/hello
When I restart a pinger app then it successfully connects to war v2.0.
What can I do to make Karaf switch without automatically to war v2.0 when I stop war version 1.0?
I think the second war is not deployed, you can't register the same endpoint twice.
Related
Since I have deployed my struts based Java application over UAT environment using AWS Fargate, AWS codepipeline and codebuild feature.
I'm getting HTTP 400 error on accessing a JSP page of my application. The url is like-
https://uat.xxx.org/xxx-partner/contract/suxxxriodxxxxxPairsAction.do?target=prepareSuxxxriodxxxxxPairs&contractIdSubPeriodId=416|837
The same application on production, which is deployed as an ear over EC2 instance works just fine.
Using AWS docs I tried troubleshooting HTTP 400, but it doesn't helps.
Because the request size is below 16k.
The codebuild for Fargate uses Wildfly 18.0 for deployment
whereas EC2 use JBoss 7.1.1 for deployment.
Aws has nothing to do with this error.
Wildfly 18.0 doesn't recognises pipe operator.
Also '|' (pipe) character is unsafe according to the RFC1738 specification of HTTP.
Hence url encoding must be used here to address the issue.
I am trying to integrate Jenkins and Web deploy v3.5 over "HTTP" connection. The server has IIS 10 and Windows Server 2016. The build is getting failed with an error,
Web deployment task failed. (Could not complete the request to remote agent URL 'http://IPAddress:8172/MSDeploy.axd?site=WebSite'.)
I am using the following command,
/property:configuration=Dev /p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=False /p:AllowUntrusted=True /p:MsDeployPublishMethod=WMSvc /p:MsDeployServiceUrl="http://IpAddress:8172/MSDeploy.axd" /p:DeployIisAppPath="WebSite" /p:AllowUntrustedCertificate=True /p:Username=SomeUsername /p:Password=SomePassword
Troubleshooting:
8172 port is allowed for Jenkins.
Web deployment services are running.
Users have been given with sufficient rights to the directory.
WebDeploy user is added to administrator group.
I am suspecting if Web deploy tool doesn't work over HTTP connection, is that true?
Web Deploy is actually just a way of deploying. The services are running on a server and listening on the port 8172. I do not get why you are using a whole web adress, when all you need is the connection to the server (ip or domain only!).
Example: 0.00.000.000 or example.org
Check if you installed the handler too. You need the web deploy service and handler running.
Regards,
Maheshvara
I encountered the problem by taking following steps,
Ms web deploy works under the secure connection. it should be called by https://
Configured three rules as mentioned under Management Service Delegation Rule
2.1 ---- createApp with WDeployConfigWriter User
2.2 ---- setAcl
2.3 ---- contentPath_intiApp
Reference: https://learn.microsoft.com/en-us/iis/publish/using-web-deploy/configure-the-web-deployment-handler
In 2.1 step, WDeployConfigWriter user needs to be created manually. Web deploy tool use two users WDeployAdmin and WDeployConfigWriter
Reference: https://blog.richardszalay.com/2013/08/02/manually-creating-wdeployadmin-and-wdeployconfigwriter/
I'm reading up and doing basic mesos/marathon installation. If Im deploying a webapp as a marathon application, the instance(s) of my webapp could run in any mesos slave. Howe would I then configure my nginx upstream to point to correct host(s).
Should my webapp register its host in zookeeper and reconfigure nginx periodically ?.
Is there any examples how to do this.
Thanks
Should my webapp register its host in zookeeper and reconfigure nginx periodically ?
You don't need zookeeper. All data required to configure nginx are available in Mesos or Marathon. You can periodically query Mesos/Marathon and generate Nginx configuration like Nixy does.
To minimize unavability time you can use Marathon SSE to get information about instances start/stop just like allegro/marathon-consul does.
I am in Plone 4.1.6, if you go in Site setup > Users and Groups and then click the checkbox "Reset Password" for a user and click "Apply changes", than the system hangs and after 5 min I have this error from Apache:
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request POST /##usergroup-userprefs.
Reason: Error reading from remote server
Apache/2.2.22 (Ubuntu) Server at 192.168.1.4 Port 443
After the error, I have to restart Plone to make Plone respond again.
My Environment:
Plone 4.1.6 (4115)
CMF 2.2.6
Zope 2.13.15
Python 2.6.8 (unknown, Apr 27 2013, 22:01:31) [GCC 4.6.3]
Addons:
Diazo theme support 1.0b8
Installs a control panel to allow on-the-fly theming with Diazo
Thème Plone classique 1.1.2
L'ancien thème utilisé dans Plone 3 et versions antérieures.
Static resource storage 1.0b5
A folder for storing and serving static resource files
I am running Plone behind Aapache
Testing locally
Running a virtual machine with VirtualBox 4.2.12
Plone is install on the Virtual machine
Plone version is 4.1.6
Virtual machine is running Ubuntu 12.04 AMD64
Zeocluster with 2 clients
Email is properly configured in the Plone instance
As I know, everything is working fine with my Plone instance including the other checkboxes available in Users and Groups.
I did a test with ssmtp to send an email to myself from my node on the vm and I have no problem sending the email.
I did try fg mode and everything seems OK.
I did check the Apache logs and everything seems OK too.
If a create a ssh tunnel to avoid Apache and access Plone directly, I don't have a proxy error but the system hang forever.
I don't know what to do to solve this stuff problem. Any idea?
Does the python process use a lot of CPU when it hangs? Check using top.
Install ZopeHealthWatcher, then when it hangs again, use zope health watcher to get a list of what each thread is doing. That will often give you an idea of where the code is sitting either in a loop, in infinite recursion of some sort (this can happen in the zodb, especially with acquisition and similarly named things), or if it is merely blocking on something (eg, mtu issues on the network link to the smtp server for example, so small emails work but big ones hang).
You could also stop the smtp server (or just change the port in the plone control panel) and see if you at least get an exception out of that. Plone should, by default, raise an exception if it cannot connect to the smtp server.
In really extreme cases, you can use gdb to connect to the hanging python process (I usually use "top" to find the one sitting at 100% CPU), and you could then find where it is hanging. This is a lot more complex than using ZopeHealthWatcher, but I successfully traced a hang to a race condition in reportlabs font code recently using precisely this method, it is very powerful. What is nice about gdb, is it stops the process and allows you to step through the code, and up and down the calling stack, unlike ZopeHealthWatcher which just gives you a snapshot (a bit like that Heissenberg uncertainty thing, you can observe where it is now...)
following is a paragraph from glassfish 3.1.2.2 administration guide
You can rotate log files manually by using the rotate-log subcommand
in remote mode. The default target of this subcommand is the DAS.
Optionally, you can target a configuration, server, instance, or
cluster.You can rotate log files manually by using the rotate-log
subcommand in remote mode. The default target of this subcommand is
the DAS. Optionally, you can target a configuration, server, instance,
or cluster.
what is the difference between configuration, server, instance and cluster ? i understand cluster is a collection of instances. but what is difference between server and instance and configuration ?
From the Glassfish admin guide:
The default target for these two subcommands is the DAS. However, you
can optionally specify one of the following targets:
Configuration: to target all instances or clusters that share a specific configuration name.
Server: to target only a specific server.
Instance: to target only a specific instance.
Cluster: to target only a specific cluster.
A GlassFish Server instance is a single Virtual Machine for the Java
platform (Java Virtual Machine or JVM machine) on a single node in
which GlassFish Server is running. A node defines the host where the
GlassFish Server instance resides.
and
It is usually sufficient to create a single server instance on a
machine, since GlassFish Server and accompanying JVM are both designed
to scale to multiple processors. However, it can be beneficial to
create multiple instances on one machine for application isolation and
rolling upgrades.
This means you can have multiple instances of glassfish running on a single server, and you can either target a single instance or the whole server.