JSP and HTTP return code
I am new at developing jsp, and I am looking for a way to send an HTTP return code under a specific condition.
for ex :
if(data==ok)
HTPP_return_code = 200;
else
HTPP_return_code = 500;
Is it possible ?
Within your JSP you can use the sendError method on the response object.
e.g.
if (data == ok) {
response.sendError(HttpServletResponse.SC_OK);
} else {
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
} See http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletResponse.html
for possible HTTP return code constants.
Similar Messages
-
Is there a way to direct requests based on HTTP return-code checking?
I'd like to implement a policy based on return-code. The algorithm is as below,
If HTTP return-code == 500 to 600
serverfarm1
else
serverfarm2
We have a CSM V3.2. Can someone tell me if this is doable? If yes, would you please tell me how.
Appreciation, Q.XieThe solution I suggested is still what I recommend.
What you have to do is split your serverfarm in multiples instances. One for HTTP and another one for the rest of your applications. Or you could do one for each application.
The serverfarm for HTTP will have the HTTP probe and will go down when the response is 500-600.
The other serverfarm(s) will not use the same HTTP probe and should not go down based on the response code.
ie:
serverfarm WEB
real 10.10.10.10
ins
real 20.20.20.20
ins
probe http
serverm ALL
real 10.10.10.10
ins
real 20.20.20.20
ins
no probe
vserver web
vip 1.1.1.1 tcp 80
serverfarm WEB backup WEB_B
vserver all
vip 1.1.1.1 any
serverfarm ALL
Hope this helps.
Gilles.
Thanks for rating this answer. -
HTTP Return Code Checking on ACE
Hey there.
I have a question regarding return code checking for a serverfarm on ACE. I am looking to have the ability to monitor a client's session real-time and monitor return codes passing back from the origin servers to the client.
For example, if during a client's session there is a single HTTP 500 error code sent from server to client, the intercept that response and first retry the request on a different server in the farm. Or perhaps only if I see three 500 error codes in 30 seconds. Something like that.
From what I can tell from the docs the retcode check command for a serverfarm is maybe only for statistical purposes?
Thanks for any help.
/ahuffer/In ACE return codes checking is only used to count number of return codes from Rservers. Unlike CSMs (where return codes were used for inband health monitoring) ACE is not using them for load balancing or inband health
monitoring. Once you enable return code checking and counting you can then display the return code statistics per serverfarm
for example
serverfarm host serverfarm1
retcode 200 499 check count
rserver real1
inservice
rserver real2
inservice
show serverfarm serverfarm1 retcode
serverfarm : serverfarm1
rserver : real1
np : 1
return code action total count
+------------+--------+------------+
200 count 100
201 count 0
202 count 0
203 count 0
204 count 0
205 count 0
206 count 0
498 count 0
499 count 0
Syed -
HTTP Return Code on CSM causes IP Sticky does not work
I have CSM running on 3.1(1a).
I configured HTTP Return Code Checking:
map HTTPCHECK retcode
match protocol http retcode 404 404 action remove 5 reset 60
And apply it to the following web server serverfarm:
serverfarm DCMSWEB
nat server
no nat client
predictor leastconns
retcode-map HTTPCHECK
real 10.1.31.1
inservice
real 10.1.31.2
inservice
I also configure IP sticky for my web server:
sticky 2 netmask 255.255.255.255 timeout 60
And apply that sticky to the virtual server:
vserver DCMSWEBHTTP
virtual 10.1.30.100 tcp www
serverfarm DCMSWEB
sticky 60 group 2
replicate csrp sticky
replicate csrp connection
persistent rebalance
inservice
But, the problem is my sticky does not work if I apply HTTP return code checking on the serverfarm.
"show mod contentswitchingmodule 8 sticky" does not show any IP sticky connection.
If I remove HTTP return code checking from serverfarm, my IP sticky is back to normal.
Has anyone encoutered this similar problem before?
Is this a bug on the CSM software?This is a new bug.
The workaround is to use the command 'client 0.0.0.0 /0' under the vserver.
Gilles. -
Hey again.
I have been looking into the CSM return code checking feature as suggested by this forum. This is a little closer to what I am looking for but I have question about what happens when there is a failure.
If a 500 code for HTTP is seen three times, for example, and the server is removed from the farm, is the original request from the client tried on the next server? Or is a reset sent back to the client, or the original code, and the client must try again.
I am trying to understand if the client will notice if the CSM noticed X number of a particular error and removed the server from the farm.
Thanks for any help!
/ahuffer/I think you are mixing two things up(Inband health monitoring & HTTP return code checking).
The "Inband health monitoring" feature checks for both RSTs from a server and the failure of the server to respond to a SYN. If a SYN ACK response to a SYN is not received,the TCP portion of the code will perform several retries of a SYN before timing it out.
It is configured as follows
CSM(config-module-csm)# serverfarm xyz
CSM(config-slb-sfarm)# health retries 10 failed 50
(Retries are the number of abnormal end sessions that the CSM will tolerate before removing a real server from service. The failed time is the number of seconds that the CSM waits before reattempting a connection to a real server that was removed from service by inband health checking.)
"HTTP Return Code checking" is the CSM feature that can be configured to take a server out of use in response to receiving specific return codes.
When HTTP return code checking is configured, the CSM monitors HTTP responses from all balanced HTTP connections and logs the occurrence of the return code for each real server. The CSM stores return code counts. When a threshold for a return code is reached, the CSM may send syslog messages or remove the server from service.
Unlike "Inband Health monitoring", "Http Return code checking" feature has a small (estimated in 10-15%) impact on CPS setup rate, since it requires parsing L5 information in the server-to-client direction.
If the server is taken out of service, Client's request will be loadbalanced among available servers.
Syed
Syed -
OTA Download and HTTP Status Codes
Hi there,
i am planning to check the http status code of an OTA download. Even if I interupt the download process, the server still responds with status 200.
Does anbody have an idea, how to implement this process?
Thanx,
Simonei have relatively a same question. I am developing an OTA Provisioning platform for Java Games . Herez the flow:
-> End User (Client) requests a content by entering his mobile no. via website
-> Server sends a WAP PUSH (Binary SMS) to his mobile.
-> When User opens the WAP PUSH (SMS), it will connect via GPRS to the server and start retrieving the game ( I am using Servlet to stream the JAD File)
-> Then it will retrieve JAR file (path defined in JAD file)
-> I have defined:
MIDlet-Install-Notify: http://myserver.com/content?323
in JAD File. So after Installation the Mobile handset connects the URL specified. I am then grabbing the status code i.e 900 or 901 ....
Problem:
<b> User Tracking: </b> I am not able to track the user e.g there are number of register users each having unique Id. When they download the content the Midlet-Install-Notify connects to servlet, but i am not able to distinguish among users as i am not able to dynamically assign User ID to MIDlet-Install-Notify URL in JAD File.
I am in now in real trouble. If any one knows the solution how to maintain session or URL rewriting i.e dyanmically assign Parameters to MIDlet-Install-Notify plz share it.
Thanks in advance
Regards
Hamid
[email protected] -
Can WLS 10.3.x with certain settings return http-code=503 in a situation where under normal settings it returns http-code=500?
Hi,
Yes, I understand the issue.
However, error 500 doesn't mean that the server is unavailable. The server could return 500 for different reasons, and the issue could be related to the application behaviour.
I don't know exactly what kind of application you have, but if we think of webservices for example, whenever the app returns a SOAPFault, HTTP 500 is also returned. In some cases, it could be just a payload validation error.
Having said that, if you can identify an error condition when you believe the server is unavailable due to specific exception, you could monitor either Weblogic resources using JMX or the log files, and write scripts to either stop/restart the server.
Regards,
Fabio. -
I'm trying to send SOAP message to MS Provider
(to Analysis Services) but having response code 500.
What am i doing wrong?
Here's the sources:
SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
SOAPConnection con = scFactory.createConnection();
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage message = factory.createMessage();
SOAPPart soapPart = message.getSOAPPart();
SOAPEnvelope envelope = soapPart.getEnvelope();
SOAPHeader header = envelope.getHeader();
SOAPBody body = envelope.getBody();
header.detachNode();
envelope.addNamespaceDeclaration( "xsi", "http://www.w3.org/2001/XMLSchema-instance" );
envelope.addNamespaceDeclaration( "xsd", "http://www.w3.org/2001/XMLSchema" );
Name actionName = envelope.createName("Execute", "", "urn:schemas-microsoft-com:xml-analysis");
SOAPBodyElement action = body.addBodyElement( actionName );
action.setEncodingStyle( "http://schemas.xmlsoap.org/soap/encoding/" );
Name commandName = envelope.createName( "Command" );
SOAPElement command = action.addChildElement( commandName );
Name statementName = envelope.createName( "Statement" );
SOAPElement statement = command.addChildElement( statementName );
statement.addTextNode( "SELECT {[Measures].members * [1997].children} ON COLUMNS, {[Store].[usa].children * [Position].[All Position].children} DIMENSION PROPERTIES [Store].[Store SQFT] ON ROWS FROM [Hr]" );
Name propName = envelope.createName( "Properties" );
SOAPElement prop = action.addChildElement( propName );
Name propListName = envelope.createName( "PropertyList" );
SOAPElement propList = prop.addChildElement( propListName );
Name dataSourceInfoName = envelope.createName( "DataSourceInfo" );
SOAPElement dataSourceInfo = propList.addChildElement( dataSourceInfoName );
dataSourceInfo.addTextNode( "Provider=MSOLAP;Data Source=local;" );
Name catalogName = envelope.createName( "Catalog" );
SOAPElement catalog = propList.addChildElement( catalogName );
catalog.addTextNode( "Foodmart 2000" );
Name formatName = envelope.createName( "Format" );
SOAPElement format = propList.addChildElement( formatName );
format.addTextNode( "Multidimensional" );
Name axisFormatName = envelope.createName( "AxisFormat" );
SOAPElement axisFormat = propList.addChildElement( axisFormatName );
axisFormat.addTextNode( "ClusterFormat" );
Name contentName = envelope.createName( "Content" );
SOAPElement content = propList.addChildElement( contentName );
content.addTextNode( "Data" );
message.writeTo( System.out );
URLEndpoint endpoint = new URLEndpoint( "http://epmw012/xmla/msxisapi.dll");
SOAPMessage response = con.call( message, endpoint);
response.writeTo( System.out );
As far as I know this forms a valid XML for analysis.I am too working on the JSP SOAP and XMLA Technology. can u send me the details or links where i can find the details.
Thanks in advance
Sundar M S -
Issue with JRun, PDF's, and HTTP Status Codes
I've been having an issue where, in our production
environment, PDF's report status codes 200, instead of the proper
200 and 206. Our Test/Staging environment have the exact same
setups (hardware, software, patches, etc), but report the proper
single 200 and multiple 206's. I've racked my brain trying to
figure out what's causing the different results between test and
production, but couldn't find anything. I happened upon this JRun4
patch...
http://www.adobe.com/support/documentation/en/jrun/4/releasenotes_4_updater6.html
... which states:
quote:
60181 - Inline PDF downloads are logging 200, instead of 206,
for the partial content portions in the IIS logfiles when the
ColdFusion Wildcard handler and an ISAPI filter is loaded (site or
global level).
... I can't find any reference to this fix for ColdFusion.
When I examine the jrun version of CFMX7.0.1 Updater 2, it reports
JRun4 Updater 5, instead of 6 even though 6 was released long
before CFMX7.0.1. What can I do? Can I apply the jrun4 patch to
CFMX7?You can only apply the JRun hot fix if you have the
multiserver or j2ee install of CFMX. You cannot apply the patch if
you have the server install.
Ted Zimmerman -
OTA and HTTP Status Codes in Motorola T720
Hi,
I am trying to check OTA status code by using T720. I wrote a simple servlet to receive the status code after midlet install, and also set up the MIDlet-Install-Notify attribute to point to the servlet.
T720 works fine in download and install, but doesn't start my midlet and I didn't get the status code.
I truly believe I missed something which is very important in this issue which I really have no clue (servlet code? config? ...)
Can anyone help?
Greatly appreciated!I am developing an OTA Provisioning platform for Java Games . Herez the flow:
-> End User (Client) requests a content by entering his mobile no. via website
-> Server sends a WAP PUSH (Binary SMS) to his mobile.
-> When User opens the WAP PUSH (SMS), it will connect via GPRS to the server and start retrieving the game ( I am using Servlet to stream the JAD File)
-> Then it will retrieve JAR file (path defined in JAD file)
-> I have defined:
MIDlet-Install-Notify: http://myserver.com/content?323
in JAD File. So after Installation the Mobile handset connects the URL specified. I am then grabbing the status code i.e 900 or 901 ....
Problem:
<b> User Tracking: </b> I am not able to track the user e.g there are number of register users each having unique Id. When they download the content the Midlet-Install-Notify connects to servlet, but i am not able to distinguish among users as i am not able to dynamically assign User ID to MIDlet-Install-Notify URL in JAD File.
I am in now in real trouble. If any one knows the solution how to maintain session or URL rewriting i.e dyanmically assign Parameters to MIDlet-Install-Notify plz help/advice the solution.
Thanks in advance
cheers
Hamid
[email protected] -
Received return code 500 ( Error during conversion of XI message )
Hello Experts,
I am configuring the WSRM for SD in SAP. I have only configured services CreditWorthinessQuery_Out and CreditWorthinessQuery_In on soamanager to carry out credit checks.
while i am creating sales order i am getting below error.
Received return code 500 ( Error during conversion of XI message )
In debug i checked the string of error it showed me below string :
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">#<SOAP:Hea
der>#</SOAP:Header>#<SOAP:Body>#<SOAP:Fault xmlns:SOAP="http://schemas.xmlsoap.o
rg/soap/envelope/"><faultcode>SOAP:Client</faultcode><faultstring>Error during c
onversion of XI message</faultstring><faultactor>http://sap.com/xi/XI/Message/30
</faultactor><detail><SAP:Error SOAP:mustUnderstand="1" xmlns:SAP="http://sap.co
m/xi/XI/Message/30"><SAP:Category>XIProtocol</SAP:Category><SAP:Code area="PARSE
R">UNEXPECTED_VALUE</SAP:Code><SAP:P1>Main/@versionMajor</SAP:P1><SAP:P2>000</SA
P:P2><SAP:P3>003</SAP:P3><SAP:P4/><SAP:AdditionalText/><SAP:ApplicationFaultMess
age namespace=""/><SAP:Stack>XML tag Main/@versionMajor has incorrect value 000;
expected value is 003##</SAP:Stack></SAP:Error></detail></SOAP:Fault>#</SOAP:Bo
dy>#</SOAP:Envelope>#
Does anyone have any idea about this? I am not integrating with PI/XI system.Hi
Can you check this out?
Transaction SXMB_ADM Integration Engine Configuration
For an application system you have to maintain the role of the business system as an application system. Set the corresponding Integration Server as an HTTP destination (for example, dest://INTEGRATION_SERVER). Create the destination in transaction SM59 and set the type to HTTP Connections to R/3 System. Test the connection by using the Connection Test button; you should get HTTP 500 u2013 Empty HTTP Request received, because no u201Ereal‟ XML document is sent during this test.
A HTTP return code 500 (Internal Server Error) is OK.
Regards
Pothana -
How to generate the return code automatically through EP
Hello all,
I have created a transaction Iview and i am calling transaction SE16 to which i am passing application parameter as the table name which i want to see.Now i am getting the SE16 screen with the table name successfully passed on to the input field. But i want the Iview to process this screen also so that i dont have to press enter to see the next screen. i want this iview to process the SE16 screen directly and show me the next screen. I dont know how can i pass the return code parameter which will directly execute the table name entered in SE16 screen.suppose my table name is "ABC" and i have set the application parameter as DATABROWSE-TABLENAME=ABC&~okcode=ANZE where ANZE is the sy-ucomm value.Plz reply at the earliest.
Thanks and regards,
Alpa Desai.Madden wrote:
I do think OOP can only complement procedural programming,Wrong. They don't have to have anything to do with each other.
but I just wish for my app to exit the same way whether I return or not an exit code.
I mean we are talking about the implementation, or the system, here.
Simply let it end and the "return code" will be 0.
But ... is there a way for a Java application to execute another Java application ? The analog for CreateProcess, but in the Java world ?Start a thread and call the main method of the class that kicks it off with the necessary arguements is one way.
When an Java app executes another Java app will a new VM be created ?Runtime.getRuntime().exec() and call java ...... Which will, obviously, start a new VM.
Is ther an internal way, for this that will work inside the same VM ?See the thread situation above.
How will the parent get the exit code from the child ?If called with Runtime simply call System.exit and then (from the original program) evaluate the return code (see the Runtime and Process classes).
If called in a thread, without using Runtime.exec any where, then you use a return at the end of the main method, but, if you are looking for a "return code" from an entire application, you're probably looking at Runtime.exec anyway. Otherwise, you are better of writing it so that it can be used in a real OOP manner (i.e. you don't have to call the main method of another application at all, you simply start instantiating and using the classes involved), in which case, a "return code" from the "application" is meaningless.
>
Timothy Madden,
RomaniaEdited by: masijade. on Nov 19, 2007 10:18 AM -
Load Error with return code 7000 when call sqlldr in interface.
Hi All,
I have created a interface to load data from 'File' to 'Oracle' in ODI 11g.
Below are the running order of this interface.
1 - Loading - SrcSet0 - Drop work view
2 - Loading - SrcSet0 - Drop Temp Table
3 - Loading - SrcSet0 - Create Temp table
4 - Loading - SrcSet0 - Create Work View
5 - Loading - SrcSet0 - Generate CTL file
6 - Loading - SrcSet0 - Call sqlldr
We are getting the following error while running the step 6.
org.apache.bsf.BSFException: exception from Jython:
Traceback (most recent call last):
File "<string>", line 22, in <module>
Load Error: See C:\home\oracle\joc\odi/AIM.log for details
at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.execInBSFEngine(SnpScriptingInterpretor.java:322)
at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.exec(SnpScriptingInterpretor.java:170)
And it return code 7000 indicated in 'Execution Statistics'.
If anyone has encountered a similar issue and able to solve it, please share your thoughts with me.
Thanks in advance for your help.
DicksamThis forum is dedicated to supporting the use of Maven with FMW and the new Oracle Maven Repository. Given that ODI does not currently provide Maven support, you are unlikely to get a response in this forum. You might want to try posting in a different forum dedicated to Data Integration, such as the Master Data Management forum.
-
Error /SAPAPO/OM102, return code 40,015 in APO DP
I am using APO DP V5.
In interactive DP, we are getting error /SAPAPO/OM102 with return code 40,015.
Had anyone had experience of this?
Thanks,
Bob Austin, Atos Origin.Hello,
As per my understanding of your qurery...
You are accessing intractie Demand planning
that time you are getting error.
/SAPAPO/OM102 Return code 40015
With the above understanding ... I am trying to reply your query as
When I tried to execute transaction /SAPAPO/OM10 - Display Meaning of Return Code
And entered return code 40015
I received Display messages as "Date is before start date of time buckets profile"
ON long text it is "Date is before start date of time buckets profile
Message no. /SAPAPO/OM_TS015
Diagnosis
The date lies before the start date of the time buckets profile used.
This problem is due to an error in the application.
Procedure
Open an OSS message in accordance with SAP Note 167280.
Please check the details above.
In Intractive demand planning what type of work you were doing during this error occured? -
Sendmail gives Return Code 8 - Can't Get Past It - Ideas?
I used 'sendmail' function. It worked fine in 3 of my test environments but not a 4th. Environmental engineers have looked at SMTP setup & other configurations & recycled the trouble region to no help. If you have seen before or can suggest help, thanks!
I get return code 8 from the sendmail, which I find means some kind of 'platform dependent' error. Bear in mind that our test environments are all pretty much identical & this error only occurs in 1 out of 4.
I note in documentation for 'Pbooks 8.9' the following warning with the 'sendmail' function, which leads me to conclude Oracle recommends NOT to use sendmail:
"The flags parameter of this function and its return codes are platform dependent: the SMTP mail API ignores any additional flags. For this reason, SendMail should be used only in customizations that run on a known platform, if it is used at all. The preferred, platform-independent method for sending email from PeopleCode is to define an email routing as part of a business event, then trigger the business event using the TriggerBusinessEvent function."
Here is my sendmail code, embedded to a record SEd event(some parts of code not printed to save space):
Local SQL &EmailBodySQL;
Local string &EMMsgText;
Local number &msg_nbr;
Local number &email_return;
Local string &Email_From, &Email_Sep, &Reply_To, &EMSender;
&EmailBodySQL = GetSQL(SQL.KP_PC_EMAILBODY_SEL);
If Not &EmailBodySQL.Fetch(&EMMsgText, &msg_nbr) Then
MessageBox(0, "", 20100, 8, "No Message for Message Set 20100, number : :1", &msg_nbr);
&email_return = 99;
Else
%This.EmSubject = &EMMsgText | &projBU | " " | &projID;
&Email_From = %EmailAddress;
&Reply_To = %EmailAddress;
&EMSender = "";
&Email_Sep = ";";
&email_return = SendMail(0, &team_members, "", "", %This.EmSubject, &em_text_body, "", "", &Email_From, &Email_Sep, &Reply_To, &EMSender);
End-If;
&EmailBodySQL.Close();
Return &email_return;
&email_return = &KP_PC_Email.pcattach_email_send(&team_members, &email_body, &projBU, &projID);
If &email_return = 0 Then
MessageBox(0, "", 20100, 12, "Email sent for business unit :1 , project ID :2", &projBU, &projID);
Else
MessageBox(0, "", 20100, 11, "Email failed. Return status from sendmail = :1 ", &email_return);
End-If;
Edited by: 1001697 on Apr 22, 2013 1:52 PM
Edited by: 1001697 on Apr 22, 2013 1:53 PMTry enabling logging by setting SMTP Trace parameter to 1 to get more info on the cause.
PeopleBooks > PeopleTools 8.52: System and Server Administration > Setting Application Server Domain Parameters
SMTPTrace
Enter 1 to enable the tracing of email details to the log file. Enter 0 to disable SMTP tracing.
LogFence should be set to 5.
The system writes the log information to SMTP<DDMM>.log in %PS_SERVDIR%/LOGS, by default, or the custom value set for Log Directory. For example:
PS_CFG_HOME\APPSERV\domain\LOGS\SMTP6_27.log
Maybe you are looking for
-
E-mail not outgoing, and intermitely E-Mail access
Greetings Apple Discussions: I have my OSX firewall off, Verizon DSL westell 2200 modem, and a Linksys wired router-that has a firewall. A few days ago I reconfigured the router through an IBM laptop with NetSet software from Linksys. Regular interne
-
Load balancing In weblogic 6.1 JMS Cluster
hi i have implemented distributed queues in weblogic as suggested in the JMS performance guide.but the problem is that of the 3 queues in cluster the messages always end up going to the same queue and the remai
-
What actions will trigger azure worker role reboot
Hi team, we have a application host in worker role, the worker process will create a new process if it receive a request, i we want to update the worker and keep new process still working smoothly, what we should do during the Udate. we did some tes
-
IPDA3 not sending outgoing email
I get the message that the server is not accpeting my out going email. I have gone through the intitial set up stage through IPAD. Golowed the Apple instructions re checking smtp but no luck so fae. Any advice gratfully recieved. K
-
HI SAP BPC Experts, I check the table UJA_SVR_DEFAULT in our BI system for BPC and i noticed that it contains a 'strange' record only in development system. The record's value for field is UJT_CHKPT. can someone help me on this? Can you explain what