What's wrong with my servlet code ?
<p>
Hi,
</p>
<p>
I need to redirect user from jsf application to PHP app with some request attributes using POST method. To check how to do at first I prepared simple servlet:
</p>
<p>
public class TestServlet extends HttpServlet {
public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException,
</p>
<p>
IOException {
req.setAttribute("p1","Value One");
req.setAttribute("p2","Value Two");
res.sendRedirect("http://www.mycompany.pl/test.php");
public void doGet(HttpServletRequest request, HttpServletResponse response)throws IOException,
</p>
<p>
ServletException{
doPost(request,response);
</p>
<p>
I also prepared simple PHP page to display these attributes (Im sure this page works correct):
</p>
<p>
<html>
<body>
Attribute p1: <? echo $_POST["p1"]; ?> <br />
Attribute p2: <? echo $_POST["p2"]; ?> <br />
</body>
</html>
</p>
<p>
Te problem is that attributes from servet don't displayed on PHP page - why. What is wrong wit this servlet ?
</p>
<p>
Kuba
</p>
Well if this line of code works for you:
res.sendRedirect("http://www.mycompany.pl/test.php");
you could append parameters by building the url string dynamically.
res.sendRedirect("http://www.mycompany.pl/test.php?p1=ValueOne&p2=ValueTwo");
Isn't PHP a server technology, if yes why don't you do all the work in php (you'll avoid cookie problems)?
Regards
Fred
PS I don't think this forum is the right place for php questions.
Similar Messages
-
Does any one know what is wrong with this servlet code
package com.bt.ros;
import java.util.*;
import java.io.*;
import java.net.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import javax.sql.*;
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.naming.NamingException;
* This class is a servlet that searches for a Finder Aid.
* @author
public class FinderAidsSearchS extends HttpServlet {
* This is the static initializer,
* executed the first time this class is referred to.
* It makes sure the JDBC pool driver is loaded.
* This method examines an HTTP request and searches for the
* specified Finder Aid record in the database. It then redirects
* the response to the <tt>Results.jsp</tt> JSP page.
public void service(HttpServletRequest req, HttpServletResponse res)
throws IOException
HttpSession session = req.getSession(true);
//res.setContentType("text/html");
//PrintWriter out = res.getWriter( );
//out.println("<HTML>");
//out.println("<HEAD>");
//out.println("<TITLE>");
//out.println("A Servlet Example");
String year = req.getParameter("Year");
String year_range = req.getParameter("Year_Range");
String county = req.getParameter("County");
Connection conn = null;
try {
//example code from tomcatmanual
Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/rosDS");
//Connection
conn = ds.getConnection();
Statement stmt = conn.createStatement();
String select = "select * from abridgment where " +
"(a_county = '" + county +
"' AND a_year_date = " + year +
out.println("<DEBUG> <select> the select staement is : " + select);
stmt.execute(select);
ResultSet resultSet = stmt.getResultSet();
Results abridgeresults = new Results();
abridgeresults.setName("NaeemColl");
Abridgment varabridgment = null;
int nRows = 0;
while(resultSet.next()){
nRows++;
varabridgment = new Abridgment();
varabridgment.seta_county(county);
varabridgment.seta_year_date(Integer.parseInt(year));
varabridgment.seta_sub_year_volume(resultSet.getInt("a_sub_year_volume"));
// out.println("varabridgment - attributes are:");
//out.println("varabridgment - attributes are:" +varabridgment.geta_sub_year_volume());
//out.println("varabridgment - attributes are:"+resultSet.getInt("a_sub_year_volume"));
varabridgment.seta_page_id(resultSet.getString("a_page_id"));
varabridgment.seta_month_date(resultSet.getInt("a_month_date"));
varabridgment.seta_day_date(resultSet.getInt("a_day_date"));
varabridgment.seta_year_sequence(resultSet.getLong("a_year_sequence"));
varabridgment.seta_day_sequence(resultSet.getLong("a_day_sequence"));
varabridgment.seta_year_volume(resultSet.getInt("a_year_volume"));
varabridgment.seta_volume_id(resultSet.getString("a_volume_id"));
varabridgment.seta_summary(resultSet.getString("a_summary"));
varabridgment.seta_batch_id(resultSet.getLong("a_batch_id"));
varabridgment.seta_image_id(resultSet.getLong("a_image_id"));
abridgeresults.addAbridgment(varabridgment);
//trying to use vector construct
req.setAttribute("results",abridgeresults);
//session.setAttribute("results", abridgeresults);
stmt.close();
conn.close();
//out.println("</BODY>");
//out.println("</HTML>");
// String sURL = res.encodeRedirectURL("/rossearch/results.jsp");
try{
//TEMPCOMM res.sendRedirect(sURL);
req.getRequestDispatcher("/rossearch/results.jsp").forward(req, res);
//TEMPCODE
//out.println("</BODY>");
//out.println("</HTML>");
catch(Exception e){
System.err.println("Exception: FinderAidsSearchS.service: " + e);
catch (Exception e) {
System.err.println("Exception: FinderAidsSearchS.service: " + e);
}i really need some assistance at the following areas of code :
where the database results are set to attributes of one bean varabridgment (Type Abridgement) - the declaration and use of this bean.
and where this bean is then added to another bean abridgeresults (Type Results) as a List collection.
i get a null pointer exception when i try to retrieve the List from abridgeresults object of Type Results Bean.
i would really appreciate some assistance in this - i really need to go to sleep now - but cant until i solve this issue. - thanks all in advance.below is exception outputed to tomcat log file.
it is thrown at the following line of code in the jsp that tries to get the List object :
currently jsp code to retrieve List: <% List myAbridgments = (List) request.getAttribute("results");
for (int i = 0; i < myAbridgments.size(); i++) {
abridgment = (Abridgment) myAbridgments.get(i);
%>
line that gives problem is
(results_jsp.java:95)
//myAbridgments - is variable where i store the List object in jsp scriptlet
for (int i = 0; i < myAbridgments.size(); i++) {
Also, i dont understand why the servlet keeps on forwarding to the results.jsp when i even comment out the line of code to forward request oobject to results.jsp - i recompile copy it over original and restart tomcat - but still i get the null pointer exception in results_jsp - but i'm no longer forwarding anything to this jsp. --- i want to do some out.printline statemets in servelt to see some of the data from the query - but i cant as it just forwrads the request to results.jsp - how can i output the data to look at debug - i dont have a log4j logger setup and dont have IDE to be able to place break points - so wanted to just output stuff to browser to have a look at what was going on - but can't as just forwards request on ?
Exception ....
2005-11-07 02:45:20 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)
----- Root Cause -----
java.lang.NullPointerException
at org.apache.jsp.results_jsp._jspService(results_jsp.java:95)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536) -
What's wrong with the following code?
What's wrong with the following code?
Circle cir1;
double rad = cir1.radiusThe circle Object was never instantiated.
In other words, you have set a declaring of a Circle, but it has not been created in memory yet.
You will create it using the " = new Circle( PARAMETERS_HERE ); "
Or some other method that returns a circle. -
What's wrong with this simple code?
What's wrong with this simple code? Complier points out that
1. a '{' is expected at line6;
2. Statement expected at the line which PI is declared;
3. Type expected at "System.out.println("Demostrating PI");"
However, I can't figure out them. Please help. Thanks.
Here is the code:
import java.util.*;
public class DebugTwo3
// This class demonstrates some math methods
public static void main(String args[])
public static final double PI = 3.14159;
double radius = 2.00;
double area;
double roundArea;
System.out.println("Demonstrating PI");
area = PI * radius * radius;
System.out.println("area is " + area);
roundArea = Math.round(area);
System.out.println("Rounded area is " + roundArea);Change your code to this:
import java.util.*;
public class DebugTwo3
public static final double PI = 3.14159;
public static void main(String args[])
double radius = 2.00;
double area;
double roundArea;
System.out.println("Demonstrating PI");
area = PI * radius * radius;
System.out.println("area is " + area);
roundArea = Math.round(area);
System.out.println("Rounded area is " + roundArea);
Klint -
What is wrong with the idl code generated by packager.exe?
Hello everybody,
I am trying to figure out what is wrong with the idl code generated by packager.exe. In the evaluation for the bug posted at http://developer.java.sun.com/developer/bugParade/bugs/4964563.html it says that the IDispatch interface is not exposed correctly and thus early binding of java objects is not possible using the current activex bridge implementation.
As I am no idl expert I have no idea what that means. However, I managed to dig out the idl code generated by packager.exe for the following example bean:
package test;
public class MyBean
protected int value;
public MyBean()
public void setMyValue(int _value)
value = _value;
public int getMyValue()
return value;
public MyBean getSelfReference()
return this;
}The corresponding idl code generated by packager.exe is
uuid(81B0BF63-2A55-11D8-A73E-000475EBF021),
version(1.0)
library MyBean
importlib("Stdole2.tlb");
dispinterface MyBeanSource;
dispinterface MyBeanDispatch;
uuid(81B0BF64-2A55-11D8-A73E-000475EBF021),
version(1.0)
dispinterface MyBeanSource {
properties:
methods:
uuid(81B0BF65-2A55-11D8-A73E-000475EBF021),
version(1.0)
dispinterface MyBeanDispatch {
properties:
[id(4097)]
int myValue;
methods:
[id(32768)]
VARIANT_BOOL equals(IDispatch* arg0);
[id(32769)]
IDispatch* getClass();
[id(32770)]
int getMyValue();
[id(32771)]
IDispatch* getSelfReference();
[id(32772)]
int hashCode();
[id(32773)]
void notify();
[id(32774)]
void notifyAll();
[id(32775)]
void setMyValue(int arg0);
[id(32776)]
BSTR toString();
[id(32779)]
VARIANT wait([optional] VARIANT var0, [optional] VARIANT var1);
uuid(81B0BF62-2A55-11D8-A73E-000475EBF021),
version(1.0)
coclass MyBean {
[default, source] dispinterface MyBeanSource;
[default] dispinterface MyBeanDispatch;
};Does anyone know what is wrong with this code and maybe how to fix the idl code? Generating the dll should then be easy (I already tried several variations of the idl code but as my idl knowledge is limited it didn't really do what I wanted).Then the question is why it does work with visual controls (even if you set them to non-visible)?
-
Does anybody know what is wrong with my java code?
Does anybody know what is wrong with my java code?
--------------------Configuration: <Default>--------------------
stockApplet.java:47: cannot find symbol
symbol : variable M_pointThread
location: class StockApplet
if (M_pointThread==null)
^
stockApplet.java:49: cannot find symbol
symbol : variable M_pointThread
location: class StockApplet
M_pointThread=new Thread(this);
^
stockApplet.java:50: cannot find symbol
symbol : variable M_pointThread
location: class StockApplet
THE CODE:
import java.applet.*;
import java.awt.*;
import java.io.*;
import java.net.*;
public class StockApplet extends java.applet.Applet implements Runnable
int Move_Length=0,Move_Sum=0;
String FileName,Name_Str,Content_Date;
int SP[]=new int[2000];
int KP[]=new int[2000];
int JD[]=new int[2000];
int JG[]=new int[2000];
int Mid_Worth[]=new int[2000];
String myDate[]=new String[2000];
double CJL[]=new double[2000];
double MaxCJL,MidCJL;
Label label[]=new Label[10];
int MaxWorth,MinWorth;
int x_move0,x_move1,MaxLength=0;
int x0,y0,X,Y,Record_Num;
boolean Mouse_Move,Name_Change=true;
int JX_Five1,JX_Five2,JX_Ten1,JX_Ten2;
public void init()
TextField text1=new TextField();
Thread M_pointThread=null;
setLayout(null);
this.setBackground(Color.white);
this.setForeground(Color.black);
for(int i=1;i< 10;i++)
label=new Label();
this.add(label[i]);
label[i].reshape(i*80-65,10,50,15);
if(i==2){label[i].reshape(80,10,70,15);}
if(i==7){label[i].reshape(510,10,80,15);}
if(i >7){label[i].reshape((i-8)*490+45,380,70,15);}
FileName="six";
Name_Str="six";
this.add(text1);
text1.reshape(150,385,70,20);
text1.getText();
public void start()
if (M_pointThread==null)
M_pointThread=new Thread(this);
M_pointThread.start();Welcome to the forum. I think that George123 has your problem and its solution well in hand. Follow his good advice and you will have solved this problem. One other thing though just for future reference. If you post your code, here, you are going to want someone to be able to read it easily. Please use code tags when posting next time and your code will be much easier on the eye. You can find out about them here:
http://forum.java.sun.com/help.jspa?sec=formatting -
What was wrong with the servlet?
I got a similar error(listed below) when I tried to run a jhtml as when
I tried to run a servlet.
I enabled the JHTML
weblogic.httpd.register.*.jhtml=\
weblogic.servlet.jhtmlc.PageCompileServlet
weblogic.httpd.initArgs.*.jhtml=\
pageCheckSeconds=1,\
keepgenerated=true,\
compileCommand=c:/jdk1.2/bin/javac.exe,\
workingDir=C:/weblogic/myserver/servletclasses,\
verbose=true
The class file was generated and everything looked fine inside the
class.
I even set the working dir to servetclasses but the server still can't
find it. What was wrong?
Thanks
============== error =================
Tue Mar 14 13:40:15 PST 2000:<I> <ServletContext-General> *.jhtml:
Serving reque
st for PATH_INFO: /test.jhtml
Tue Mar 14 13:40:15 PST 2000:<E> <ServletContext-General> Error loading
servlet:
jhtmlc.test
java.lang.IllegalAccessError: try to access class
weblogic/utils/classloaders/Fi
leSource from class weblogic/servlet/internal/WarClassFinder
at
weblogic.servlet.internal.WarClassFinder.getSource(WarClassFinder.jav
a, Compiled Code)
at
weblogic.servlet.internal.WarClassFinder.getClassSource(WarClassFinde
r.java:110)
at
weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
ClassLoader.java:287)
at
weblogic.utils.classloaders.GenericClassLoader.reallyLoadClass(Generi
cClassLoader.java, Compiled Code)
at
weblogic.utils.classloaders.RecursiveReloadOnModifyClassLoader$Slave.
loadClass(RecursiveReloadOnModifyClassLoader.java:234)
at
weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
Loader.java:102)
at
weblogic.utils.classloaders.RecursiveReloadOnModifyClassLoader.findLo
calClass(RecursiveReloadOnModifyClassLoader.java:109)
at
weblogic.utils.classloaders.GenericClassLoader.reallyLoadClass(Generi
cClassLoader.java, Compiled Code)
at
weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
Loader.java:120)
at
weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
Loader.java:102)
at
weblogic.servlet.internal.ServletContextImpl.loadClass(ServletContext
Impl.java:1551)
at
weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java, Compiled Code)
at
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
java:130)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:93)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:737)
at
weblogic.servlet.jhtmlc.PageCompileServlet.service(PageCompileServlet
.java:216)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:98)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:737)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:681)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
ContextManager.java:210)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
a:354)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:255)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java,
Compiled Code)
Tue Mar 14 13:40:16 PST 2000:<E> <ServletContext-General> Servlet failed
with Se
rvletException
javax.servlet.ServletException: Servlet class: jhtmlc.test could not be
handled
by the ClassLoader
at
weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java, Compiled Code)
at
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
java:130)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:93)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:737)
at
weblogic.servlet.jhtmlc.PageCompileServlet.service(PageCompileServlet
.java:216)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:98)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:737)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:681)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
ContextManager.java:210)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
a:354)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:255)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java,
Compiled Code)
Sounds like a WL 5 question, try weblogic.beta.denali.servlet
"Mark Qian" <[email protected]> wrote in message
news:[email protected]...
> I got a similar error(listed below) when I tried to run a jhtml as when
> I tried to run a servlet.
>
> I enabled the JHTML
>
> weblogic.httpd.register.*.jhtml=\
> weblogic.servlet.jhtmlc.PageCompileServlet
> weblogic.httpd.initArgs.*.jhtml=\
> pageCheckSeconds=1,\
> keepgenerated=true,\
> compileCommand=c:/jdk1.2/bin/javac.exe,\
> workingDir=C:/weblogic/myserver/servletclasses,\
> verbose=true
>
> The class file was generated and everything looked fine inside the
> class.
> I even set the working dir to servetclasses but the server still can't
> find it. What was wrong?
>
> Thanks
>
> ============== error =================
>
> Tue Mar 14 13:40:15 PST 2000:<I> <ServletContext-General> *.jhtml:
> Serving reque
> st for PATH_INFO: /test.jhtml
> Tue Mar 14 13:40:15 PST 2000:<E> <ServletContext-General> Error loading
> servlet:
> jhtmlc.test
> java.lang.IllegalAccessError: try to access class
> weblogic/utils/classloaders/Fi
> leSource from class weblogic/servlet/internal/WarClassFinder
> at
> weblogic.servlet.internal.WarClassFinder.getSource(WarClassFinder.jav
> a, Compiled Code)
> at
> weblogic.servlet.internal.WarClassFinder.getClassSource(WarClassFinde
> r.java:110)
> at
> weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
> ClassLoader.java:287)
> at
> weblogic.utils.classloaders.GenericClassLoader.reallyLoadClass(Generi
> cClassLoader.java, Compiled Code)
> at
> weblogic.utils.classloaders.RecursiveReloadOnModifyClassLoader$Slave.
> loadClass(RecursiveReloadOnModifyClassLoader.java:234)
> at
> weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
> Loader.java:102)
> at
> weblogic.utils.classloaders.RecursiveReloadOnModifyClassLoader.findLo
> calClass(RecursiveReloadOnModifyClassLoader.java:109)
> at
> weblogic.utils.classloaders.GenericClassLoader.reallyLoadClass(Generi
> cClassLoader.java, Compiled Code)
> at
> weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
> Loader.java:120)
> at
> weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
> Loader.java:102)
> at
> weblogic.servlet.internal.ServletContextImpl.loadClass(ServletContext
> Impl.java:1551)
> at
> weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
> mpl.java, Compiled Code)
> at
> weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
> java:130)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:93)
> at
> weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
> textImpl.java:737)
> at
> weblogic.servlet.jhtmlc.PageCompileServlet.service(PageCompileServlet
> .java:216)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:98)
> at
> weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
> textImpl.java:737)
> at
> weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
> textImpl.java:681)
> at
> weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
> ContextManager.java:210)
> at
> weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
> a:354)
> at
> weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:255)
>
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java,
> Compiled Code)
>
> Tue Mar 14 13:40:16 PST 2000:<E> <ServletContext-General> Servlet failed
> with Se
> rvletException
> javax.servlet.ServletException: Servlet class: jhtmlc.test could not be
> handled
> by the ClassLoader
> at
> weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
> mpl.java, Compiled Code)
> at
> weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
> java:130)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:93)
> at
> weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
> textImpl.java:737)
> at
> weblogic.servlet.jhtmlc.PageCompileServlet.service(PageCompileServlet
> .java:216)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:98)
> at
> weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
> textImpl.java:737)
> at
> weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
> textImpl.java:681)
> at
> weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
> ContextManager.java:210)
> at
> weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
> a:354)
> at
> weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:255)
>
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java,
> Compiled Code)
>
>
>
>
-
What's wrong with this mini-code? (Trying to draw graphics).
Could someone please help me fix what's wrong the following test-program?:
package project;
import java.awt.Graphics;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class GraphicsTester extends JPanel
JPanel thePanel = this;
public void GraphicsTester()
JFrame frame = new JFrame();
frame.setSize(600,600);
frame.add(thePanel);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
protected void paintComponent(Graphics g)
super.paintComponent(g);
g.drawRect(50, 50, 50, 50);
System.out.println("Sup fool");
public static void main(String[] args)
GraphicsTester gt = new GraphicsTester();
System.out.println("works2");
}Any help would be greatly appreciated!
Thanks in advance!Also, all Swing code should be called from the Event Dispatch Thread. It probably isn't hurting much in your case. But, in the body of main, do this (instead of the comment, put what you currently have as the body of main):
EventQueue.invokeLater(
new Runnable()
public void run()
// Your current body of main.
}); -
Whats wrong with this servlet code..?no error in log
hello guys..hope one of you can help....
i have 2 servlet classes. one receives form data sent from a jsp page, then create a form object containing all the inputs.. that object is then added to the session ..
also, it construct a User object containing info about the present user and add it to the session.. IUser and Form are inner to the main class.
the first servlet (check) seems to work fine.. but the problem occurs with the second servlet...i have inserted some printl statements to help me identify how far it goes and it seems that the whole code of the second servlet(update) is almost redundant....I dont get any error message ..simply a blank page which is of course of no help to me...
I hate inserting long code here but i would be pleased if anyone could tell me of a way to find out about the actual problem..program compiles fine but..it just freezes at runtime
..here is part of the code..whats wrong?
HttpSession session=request.getSession();
User user2=(User)session.getAttribute("person");
Form fr=(Form)session.getAttribute("form");
System.out.println("User and Form created");
int uid=user2.getId(); //class User contain the getId method
String uname=user2.getName();
System.out.println("Data for user retrieved");
String goTo=fr.getC();
String password = fr.getP();
String email=fr.getE();
String newName=fr.getN();
System.out.println("data from form retrieved");
thanksthe first servlet was indeed supposed to ass all those attributes...
but the thing is that the data being retrieved later were not of the type expected...
i have now decided to proceed differently but I am a bit curious to lean more about something that you mentionned in relation to servlet listeners..i never thought of the need to remove all those attribute when the session times out...
I thought that it was doned automatically with a call to session.invalidate().
is that not the case?
thanks -
What is wrong with this idoc code snip?
Hi all here's the code that's supposed to give me a default value for a metadata in check-in:
1. <$if dDocAccount like "test*"$>
2. <$dprDefaultValue="Test"$>
3. <$elseif userHasRole("TesterA") or userHasRole("TesterB")$>
4. <$dprDefaultValue="A or B"$>
5. <$elseif userHasRole("TesterC") or userHasRole("TesterD")$>
6. <$dprDefaultValue="C or D"$>
7. <$else$>
8. <$dprDefaultValue="Not A nor B nor C nor D"$>
9. <$endif$>
Now if I leave the code like that only the first 2 lines work meaning that if first condition fails then the whole code stops working even though line 3 is true... is there something wrong in just calling dDocAccount on its own? never seen that happen before.
If I change that first line for <$if *#active.* dDocAccount like "test*"$> then this first condition won't work but the rest (line 3+) does work!
please help!!Hmmmm,
If your first two lines work if true then the issue is with the elseif lines right?
userHasRole("foo") returns true or false. Can you wrap userHasRole("foo") in an "isTrue()" function and test that way?
What about exploding the OR statement and writing a bunch of elseifs to see if it works that way.
The other thing you can do is to wrap your OR clause itself in parens
<$elseif ((userHasRole("foo")) or (userHasRole("bar")))$>
do stuff
<$endif$>
let us know what works for you
Warmly,
Billy Cripe
Fishbowl Solutions -
What's wrong with this button code
Dear All,
I am trying to set up a button handler for many buttons
rather just one. The
intention of this code is to say if I press Load1 to Load40
that button and
only that button's alpha should change to 50%. This code
makes them all 50%
alpha when the frame loads rather than on the onPress event.
Can someone please help me out with this one?
i = 0;
while (i<40) {
this["Load"+i].onPress = btnEvaluate(this["Load"+i]);
++i;
function btnEvaluate(target_btn:Button) {
target_btn._alpha = 50;
Thanks again.
Alastair MacFarlanekglad,
Thanks again. What would this group do without your help.
Alastair
"kglad" <[email protected]> wrote in message
news:gh0sq0$cbv$[email protected]..
> :
>
>
>
> for (var i = 0;i<40;i++) {
> this["Load"+i].onPress =function(){
> this._alpha=50;
> }
> } -
Can't gotoAndStop ...what's wrong with this button code?
Hi,
I'm totally stumped as to why I can't navigate to another frame.
I have put 2 days into this simple problem now and I'm ready to give up and go back to AS2.
Please help!
I'm using CS4; publish settings AS3, 10.0
I have a button on frame 2 that should take me to frame 3 when clicked.
(So far I've tried a hundred different ways but I don't get to frame 3...)
Different things I tried...
> Creating the button dynamically from the library...
> Inserting it statically from the library on frame 2...
> referencing the mainTimeline through a variable...
> wrapping the gotoAndStop action in another function...(if placed directly on the timeLine the movie correctly goes straight to frame 3)
> naming frame 3...
> using 'nextFrame' instead of 'gotoAndStop'...
etc..
In most cases I don't get an error in the output panel and no compiler error either; it just doesn't work!!!
(Just stays on the same frame after I click the button)
Here's the code I think should work; but doesn't:
function moveTo3 (event:MouseEvent):void {
trace("button_clicked"); // always traces correctly; but movie does not go to frame 3 !!!
gotoAndStop(3);
f_btn.addEventListener(MouseEvent.CLICK, moveTo3);
WHAT AM I MISSING HERE?
Thanks in advance ...Hi Ned,
I have to run out and don't have the time to deal with it right now but you're RIGHT.
I do have an 'onEnterFrame' listener on frame 1 !
It's doing some animation with a symbol and I don't think I removed the listener itself.
I just set the object to null when it reached [alpha:0].
THANKS!
I'll check it out as soon as I can but I really think you got me looking in the right direction now.
Thanks again,
Connor
(I'll post an update when I get back to it) -
What is wrong with the Servlet?
i am a newbie,i have some servlet example,but it's too old(servlet 2.3)
import javax.servlet.*;
import java.util.Enumeration;
import java.io.IOException;
public class ContextDemoServlet implements Servlet {
ServletConfig servletConfig;
public void init(ServletConfig config) throws ServletException {
servletConfig = config;
public void destroy() {
public void service(ServletRequest request, ServletResponse
response)
throws ServletException, IOException {
ServletContext servletContext = servletConfig.getServletContext();
Enumeration attributes = servletContext.getAttributeNames();
while (attributes.hasMoreElements()) {
String attribute = (String) attributes.nextElement();
System.out.println("Attribute name : " + attribute);
System.out.println("Attribute value : " +
servletContext.getAttribute(attribute));
System.out.println("Major version : " +
servletContext.getMajorVersion());
System.out.println("Minor version : " +
servletContext.getMinorVersion());
System.out.println("Server info : " +
servletContext.getServerInfo());
public String getServletInfo() {
return null;
public ServletConfig getServletConfig() {
return null;
when i compile and deploy it under tomcat5 ,it's show nothing---no mistake infomation ,i do it under tomcat4.0.6,it ok,and show
````
Attribute value : org.apache.naming.resources.ProxyDirContext@24e2e3
Attribute name : org.apache.catalina.WELCOME_FILES
Attribute value : [Ljava.lang.String;@2bb7e0
Attribute name : org.apache.catalina.jsp_classpath
Attribute value : C:\tomcat4\webapps\myApp\WEB-INF\classes;
Major version : 2
Minor version : 3
Server info : Apache Tomcat/4.0-b5
what i should do to run it under tomcat5.0.16? thxPut it in a package. I don't think Tomcat will deal with objects in the default package anymore. - MOD
-
What is wrong with this trigger code?
Hi folks,
Just wondering whether I might be missing something here about Oracle 9i, that one of you might notice, either from the syntax perspective, or regarding a bug? The code below compiles in the database I have, but the trigger does not fire, and no data is being inserted into the tables. The trigger is owned by sys, and the insert statements are in dynamic sql because I don't want the trigger not to compile if ever the tables are deleted from the b1dev schema.
Incidentally, this same trigger works well on Oracle 10.2.1.0 and Oracle 11.1.0. Any feedback would be much appreciated.
CREATE OR REPLACE TRIGGER cc_LogOff_Trig
BEFORE LogOff ON DATABASE
DECLARE
LogOff_sid PLS_INTEGER;
LogOff_Time DATE := SYSDATE;
Table_1 VARCHAR2(30) := 'CC_SESSION_EVENT_HISTORY';
Table_2 VARCHAR2(30) := 'CC_SESSTAT_HISTORY';
Table_Count NUMBER;
v_sql1 VARCHAR2(4000);
v_sql2 VARCHAR2(4000);
BEGIN
SELECT sId
INTO LogOff_sId
FROM sys.v$MysTat
WHERE ROWNUM < 2;
SELECT COUNT(* )
INTO Table_Count
FROM dba_Objects
WHERE Object_Name = Table_1
AND Object_Type = 'TABLE';
IF Table_Count = 1 THEN
v_sql1 := 'INSERT INTO bdev.cc_session_event_history(sid, serial#, username, osuser, session_process_addr, os_client_process_id, logon_time, type, event, total_waits, total_timeouts, time_waited_csecs,
average_wait_csecs, max_wait_csecs, logoff_timestamp) SELECT se.sid, s.serial#, s.username, s.osuser, s.paddr, s.process, s.logon_time, s.type, se.event, se.total_waits, se.total_timeouts, se.time_waited, se.average_wait,
se.max_wait, '''
||LogOff_Time
||''' FROM sys.v$session_event se, sys.v$session s WHERE se.sid = s.sid AND s.username = '''
||LogIn_User
||''' AND s.sid = '
||LogOff_sId;
EXECUTE IMMEDIATE v_sql1;
END IF;
SELECT COUNT(* )
INTO Table_Count
FROM dba_Objects
WHERE Object_Name = Table_2
AND Object_Type = 'TABLE';
IF Table_Count = 1 THEN
v_sql2 := 'INSERT INTO bdev.cc_sesstat_history(username, osuser, sid, serial#, session_process_addr, os_client_process_id, logon_time, statistic#, name, VALUE, logoff_timestamp) SELECT s.username,
s.osuser, ss.sid, s.serial#, s.paddr, s.process, s.logon_time, ss.statistic#, sn.name, ss.VALUE, '''
||LogOff_Time
||''' FROM sys.v$sesstat ss, sys.v$statname sn, sys.v$session s
WHERE ss.statistic# = sn.statistic# AND ss.sid = s.sid AND sn.name IN(''CPU used when call started'', ''CPU used by this session'', ''recursive cpu usage'', ''parse time cpu'')
AND s.username = '''
||Login_User
||''' AND s.sid = '
||LogOff_sId;
EXECUTE IMMEDIATE v_sql2;
END IF;
COMMIT;
END;
desc cc_session_event_history;
Name Null Type
SID NUMBER
SERIAL# NUMBER
USERNAME VARCHAR2(30)
OSUSER VARCHAR2(30)
SESSION_PROCESS_ADDR RAW(0)
OS_CLIENT_PROCESS_ID VARCHAR2(24)
LOGON_TIME DATE
TYPE VARCHAR2(10)
EVENT VARCHAR2(64)
EVENT# NUMBER
TOTAL_WAITS NUMBER
TOTAL_TIMEOUTS NUMBER
TIME_WAITED_CSECS NUMBER
AVERAGE_WAIT_CSECS NUMBER
MAX_WAIT_CSECS NUMBER
TIME_WAITED_MICRO NUMBER
LOGOFF_TIMESTAMP DATE
17 rows selected
desc cc_sesstat_history;
Name Null Type
USERNAME VARCHAR2(30)
OSUSER VARCHAR2(30)
SID NUMBER
SERIAL# NUMBER
SESSION_PROCESS_ADDR RAW(0)
OS_CLIENT_PROCESS_ID VARCHAR2(24)
LOGON_TIME DATE
STATISTIC# NUMBER
NAME VARCHAR2(64)
VALUE NUMBER
LOGOFF_TIMESTAMP DATE
11 rows selectedI have taken out the 'commit' and have added the 'when others then null' exception clause, but I would imagine there is a better way to do it than this? I don't want to do an insert into another table either. With Oracle 11g, this gives me the compile time warning....
CREATE OR REPLACE TRIGGER cc_LogOff_Trig
BEFORE LogOff ON DATABASE
DECLARE
LogOff_sid PLS_INTEGER;
LogOff_Time DATE := SYSDATE;
Table_1 VARCHAR2(30) := 'CC_SESSION_EVENT_HISTORY';
Table_2 VARCHAR2(30) := 'CC_SESSTAT_HISTORY';
Table_Count NUMBER;
v_sql1 VARCHAR2(4000);
v_sql2 VARCHAR2(4000);
BEGIN
SELECT sId
INTO LogOff_sId
FROM sys.v$MysTat
WHERE ROWNUM < 2;
SELECT COUNT(* )
INTO Table_Count
FROM dba_Objects
WHERE Object_Name = Table_1
AND Object_Type = 'TABLE';
IF Table_Count = 1 THEN
v_sql1 := 'INSERT INTO bdev.cc_session_event_history(sid, serial#, username, osuser, session_process_addr, os_client_process_id, logon_time, type, event, total_waits, total_timeouts, time_waited_csecs,
average_wait_csecs, max_wait_csecs, logoff_timestamp) SELECT se.sid, s.serial#, s.username, s.osuser, s.paddr, s.process, s.logon_time, s.type, se.event, se.total_waits, se.total_timeouts, se.time_waited, se.average_wait,
se.max_wait, '''
||LogOff_Time
||''' FROM sys.v$session_event se, sys.v$session s WHERE se.sid = s.sid AND s.username = '''
||LogIn_User
||''' AND s.sid = '
||LogOff_sId;
EXECUTE IMMEDIATE v_sql1;
END IF;
SELECT COUNT(* )
INTO Table_Count
FROM dba_Objects
WHERE Object_Name = Table_2
AND Object_Type = 'TABLE';
IF Table_Count = 1 THEN
v_sql2 := 'INSERT INTO bdev.cc_sesstat_history(username, osuser, sid, serial#, session_process_addr, os_client_process_id, logon_time, statistic#, name, VALUE, logoff_timestamp) SELECT s.username,
s.osuser, ss.sid, s.serial#, s.paddr, s.process, s.logon_time, ss.statistic#, sn.name, ss.VALUE, '''
||LogOff_Time
||''' FROM sys.v$sesstat ss, sys.v$statname sn, sys.v$session s
WHERE ss.statistic# = sn.statistic# AND ss.sid = s.sid AND sn.name IN(''CPU used when call started'', ''CPU used by this session'', ''recursive cpu usage'', ''parse time cpu'')
AND s.username = '''
||Login_User
||''' AND s.sid = '
||LogOff_sId;
EXECUTE IMMEDIATE v_sql2;
END IF;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;Edited by: efachim on Jan 6, 2009 11:30 AM -
What's wrong with this widget code?
Hi everyone,
(I hope this is a good place to put this) I'm trying to build a widget in Dashcode, and one of the things I want to do is run a system command (specifically "ps -ax"). I enabled command line access in the widget attributes, and I now have:
var processes = widget.system("/bin/ps -ax", NULL);
The problem is that "processes" is always undefined. I read on here that there's a bug that if the output is too long, then the variable is undefined. So I tried substituting the command with this:
var processes = widget.system("/bin/ls ~/", NULL);
When I run the command in Terminal, the output is minimal:
Desktop Documents Downloads Library Movies Music Pictures Public Sites
But when I try to run that in Dashcode, it still returns undefined. Am I missing something obvious here?bump I'm still at a standstill with this. Any ideas?
Thanks!
Maybe you are looking for
-
Hi!! I need subdivide a result of a variabile with top 5 in 5 variabiles,every values in a variabile, for then use them in the structure in another query. Maybe the first variabile can't not be a replace path of a query type, but can anyone tell me
-
Exchange Rate type in sales order
Hi, can we see exchange rate type in sales order. regards sachin
-
I know I have to be missing something real simple but I am drawing a blank on how to solve it this morning. How do you get your pages to nest in iWeb. I can create sites & pages with no problem. I checked the help and it says just drag & drop them to
-
Photoshop crashing cs6 imac os 10.7
Hello my adobe photoshop cs6 keeps crashing and closing. i have tried uninstalling and reinstalling it but still happens. this is the report. my other adboe software seems fine Process: Adobe Photoshop CS6 [234] Path: /Applications
-
CS4 stops responding for long periods of time
First of all, let me say that I am very enthused with the changes in CS4. I feel that this is the best update to PhotoShop that I have seen, and I am a user since version 3.0. The problem that I see, ocassionally, is that PhotoShop becomes non-respon