Problems with awt.Toolkit on Tomcat

Hello! I'm trying to get the Default Toolkit (java.awt.Toolkit.getDefaultToolkit() ) to determine the scrren size of the client, and Tomcat keeps throwing an Exception - now it's the website's Tomcat and the one on my localhost - there it worked.. Is there another way to determine the client's screen size in JSP (not JavaScript!)?? Thanx!

first, the previous poster was right - learn how these protocols are interacting before you try something like you want to do - and they're right, you can't use the AWT toolkit to find out ANYTHING about the client.
HTTP is stateless. so it's like this:
browser request -> your code on server, jsp completely exeutes, generates html -> html PLAIN old html goes to the browser. in that order. no exceptions. ergo, all your code has executed once the browser starts getting data (buffers on the server not withstanding).
As to why you're getting the exception, the server you are trying to run it on is most likely running in a mode called "headless", that is, there is no windowing api available to the JVM, so any awt calls will fail anyway. It works on your box because you are probably running a full windowing os, such as windows or Linux with gnome or kde. it just happens to return the correct screen size because that's the screen size of your screen, not the screen of the browser that it's outputting to. (try running your code locally and making your browser window small, you'll be dismayed that the rendered HTML is not the "right" size - because the screen size call was based on your resolution, NOT the size of the requesting browser window.
if the last 2 sentences don't make sense, re-read them until they do.
best of luck, sorry you're learing these frustrating lessons this way.

Similar Messages

  • I have a problem with JDBC Realm in Tomcat/Oracle/Win XP

    I have a problem with JDBC Realm in Tomcat.
    I have attached my server.xml file located in the
    C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\server.xml
    The Problem is that when I login I get the user name and password prompt but it does not resolve.
    When I enter in the tomcat-users.xml password with memory realm uncommented it works fine.
    C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\tomcat-users.xml
    Is there a cache or something I need to reset for the JDBC Realm to work?
    I have attached my tables and contents as well...
    Did I miss something????
    Thanks
    Phil
    server.xml
    <Server port="8005" shutdown="SHUTDOWN">
    <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
    <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
    <!-- Global JNDI resources -->
    <GlobalNamingResources>
    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    </GlobalNamingResources>
    <!-- Define the Tomcat Stand-Alone Service -->
    <Service name="Catalina">
    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector
    port="8080" maxHttpHeaderSize="8192"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" redirectPort="8443" acceptCount="100"
    connectionTimeout="20000" disableUploadTimeout="true" />
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
    enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Catalina" defaultHost="localhost">
    <!--
    <Realm className="org.apache.catalina.realm.MemoryRealm" />
    -->
    <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="oracle.jdbc.driver.OracleDriver"
    connectionURL="jdbc:oracle:thin:@localhost:1521:orcl"
    connectionName="testName" connectionPassword="testPass"
    userTable="users"
    userNameCol="user_name"
    userCredCol="user_pass"
    userRoleTable="user_roles"
    roleNameCol="role_name" />
    <!-- Define the default virtual host
    Note: XML Schema validation will not work with Xerces 2.2.
    -->
    <Host name="localhost" appBase="webapps"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">
    </Host>
    </Engine>
    </Service>
    </Server>
    Tables
    create table users
    user_name varchar(15) not null primary key,
    user_pass varchar(15) not null
    create table roles
    role_name varchar(15) not null primary key
    create table user_roles
    user_name varchar(15) not null,
    role_name varchar(15) not null,
    primary key( user_name, role_name )
    select * from users;
    ----------------------+
    | user_name | user_pass |
    ----------------------+
    | tomcat | tomcat |
    | user1 | tomcat |
    | user2 | tomcat |
    | user3 | tomcat |
    ----------------------+
    select * from roles;
    | role_name |
    | tomcat |
    | role1 |
    select * from user_roles;
    -----------------------+
    | role_name | user_name |
    -----------------------+
    | tomcat | user1 |
    | role1 | user2 |
    | tomcat | tomcat |
    | role1 | tomcat |
    -----------------------+

    Jan 2, 2008 11:49:35 AM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    Jan 2, 2008 11:49:35 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 734 ms
    Jan 2, 2008 11:49:35 AM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Jan 2, 2008 11:49:35 AM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.9
    Jan 2, 2008 11:49:35 AM org.apache.catalina.realm.JDBCRealm start
    SEVERE: Exception opening database connection
    java.sql.SQLException: oracle.jdbc.driver.OracleDriver
         at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:684)
         at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:758)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1004)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
         at org.apache.catalina.core.StandardService.start(StandardService.java:450)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    Jan 2, 2008 11:49:35 AM org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    Jan 2, 2008 11:49:36 AM org.apache.catalina.core.StandardContext resourcesStart

  • Problem with PermGen memory (Java) - Tomcat Server - Business Object XI

    We have installed Business Objects XI on a W2003 Standard with SP2 (x86), using Tomcat as web server and MySQL as DBMS. The server has 4 GB of RAM and dual-core processor. From the beginning we have been given the memory problems of the Java virtual machine. The exception that occurs is of type "java.lang.OutOfMemoryError: PermGen space failure". We modify environment variables (JAVA_OPTS) -XX: PermSize = 256m and-XX: MaxPermSize = 512m and install the monitor LambdaProbe to see the use made of memory. We note that at no time was the PermGen memory indicated by these variables, continuing in that has a default 64MB. For this reason we decided to change the Tomcat 5.5 BO included in the version 6.0.20 and also updated Java to version 1.6.0_18-b07, and make deployment by wdeploy.bat file that comes with BusinessObjects (changing config.tomcat55 and tomcat55.xml). The deployment was successful and everything works, but as with the previous version of Java / Tomcat, shortly PermGen memory fills and returns to "hang". In this latest version of Tomcat installed as a service, do not use environment variables, use an application, "Configure Tomcat", which is a tab to pass parameters to the JVM. After looking at many sites, I have seen to be putting "-D" to pass the parameter. Currently this is my configuration:
    -Dcatalina.home = C: \ Program Files \ Apache Software Foundation \ Tomcat 6.0-Dcatalina.base = C: \ Program Files \ Apache Software Foundation \ Tomcat 6.0-Djava.endorsed.dirs = C : \ Program Files \ Apache Software Foundation \ Tomcat 6.0 \ endorsed-Djava.io.tmpdir = C: \ Program Files \ Apache Software Foundation \ Tomcat 6.0 \ temp-Djava.util.logging.manager = org.apache.juli . ClassLoaderLogManager-Djava.util.logging.config.file = C: \ Program Files \ Apache Software Foundation \ Tomcat 6.0 \ conf \ logging.properties-Dcom.sun.management.jmxremote-D-Xms2g-D-Xmx2g-D -XX: + UseConcMarkSweepGC-D-XX:-D PermSize = 256m-XX: MaxPermSize = 512m-Daf.configdir = C: / Program Files / Business Objects / Dashboard and Analytics 12.0-D-verbose: gc-D-XX : + PrintGCTimeStamps-D-XX: + PrintGCDetails
    I tried changing the values of-XX: PermSize and XX: MaxPermSize, and modifying the various policies of the Garbage Collector (-XX: + UseConcMarkSweepGC,-XX: + UseParNewGC,-XX: + UseParallelGC, ...), but nothing. Any idea how to get change the value of the report? Or how to solve this problem?
    Thank you!

    Victor,
    Is the Product you are using BusinessObjects Enterprise XI (Release 1)?
    With XIR2 and XI31, Tomcat 5.0 and Tomcat 5.5 are included with the software, and when installed with the BOE installer, you will get an application installed to the startmenu named "Tomcat Configuration".
    Using this "Tomcat Configuration" utility, there are several configuration options available.  On the JAVA tab, you will see the JAVA_OPTS that are set (These are prefixed with "-D") and also your initial and max memory sizes are listed at the bottom (Max 1024 by default in XI31).
    Here is the default setting for permsize in XI31 Tomcat:
    -XX:MaxPermSize=256M
    From your post, your issue might be the spaces in between your values (there should be no spaces, each "-" parameter on its own line).
    I would suggest starting Tomcat and reviewing your stdout.log file to review what options were set.
    Hope that helps
    -Brian

  • Problems with RMI tutorials using Tomcat 4.1.24

    Hi
    I have some problem when I try the rmi Hello example tutorial (http://java.sun.com/j2se/1.4.2/docs/guide/rmi/getstart.doc.html)
    When I start rmi server as follows:
    java -Djava.rmi.server.useCodebaseOnly=true -Djava.security.policy=file:E:\Rmi\Hello\mysrc\bin\policy.policy -Djav
    a.rmi.server.codebase=http://127.0.0.1/classes/ examples.hello.HelloImpl
    I got the following errors:
    HelloImpl err: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
    java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
    at java.security.AccessController.checkPermission(AccessController.java:401)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
    at java.lang.SecurityManager.checkConnect(SecurityManager.java:1044)
    at java.net.Socket.connect(Socket.java:420)
    at java.net.Socket.connect(Socket.java:376)
    at java.net.Socket.<init>(Socket.java:291)
    at java.net.Socket.<init>(Socket.java:119)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Naming.java:160)
    at examples.hello.HelloImpl.main(HelloImpl.java:67)
    I have granted all permission in the policy file. I have put all the classes in a subfolder call classes just after the Root directoy Can someone enlighten me. Thanks.

    i don't know if it helps but i had the following problem:
    an rmi-component software plus a servlet contacting the system.
    and rmi from the servlet in tomcat did not seem to work ...
    java.rmi.MarshalException: error marshalling arguments; nested exception is:
         java.net.SocketException: Software caused connection abort: socket write error
         at sun.rmi.server.UnicastRef.invoke(Unknown Source)
         at net.metamagix.essence.Agents.DataAgentI_Stub.storeObjects(Unknown Source)
         at net.metamagix.essence.CAgents.ParameterSaviour.save(ParameterSaviour.java:1556)
    finaly i changed back to tomcat 4.0.x but it still was not any better, when i found out that most of the problems resulted from pathnames...
    tomcat 4.1.24 had a problem with pathnames getting too long (2k on win 2000) and tomcat 4.0 produced errors because of the blank in it's path name "Tomcat 4.0" so i made a new installation with C:\Tomcat4 as home directory and - what a surprise - things turned out fine and rmi worked.

  • Problems with Oracle 9i and Tomcat

    Hello,
    I am running Tomcat and Oracle 9i. I am trying to get my connection pooling working so I can use a JNDI. But I am having a problem.
    When I include everything in a jsp file it connects to the database and produces a result.
    Connection conn = null;
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    conn = DriverManager.getConnection(
    "jdbcracle:thin:@xxx.xxx.xx.xx:1521:dev",
    "happy",
    "xxxx");
    When I have it in the Context I just get:
    A Java.nullpointerexception
    My server.xml is:
    <parameter>
    <name>url</name>
    <value>jdbcracle:thin:@xxx.xxx.xxx.xxx:1521:dev</value>
    </parameter>
    With the same parameters for username and password as above.
    My servlet is:
    Context ctx = new InitialContext();
    if(ctx == null )
    throw new Exception("Oops - No Context");
    DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/database");
    if (ds != null)
    conn = ds.getConnection();
    All your help is appreciated:
    CC

    Try out the new driver by Oracle ojdbc14.zip or ojdbc.jar

  • Problem with awt

    Hi,
    I have a problem, I learn Java and in my book I reached the section about applets. I would test the example from the book, but I have a problem. I can compile it, but if I start it in a Browser, there is only a gray rectangle and if I try to start it with the appletviewer, there comes an error.
    The Code:
    import java.applet.Applet;
    import java.awt.Graphics;
    public class HalloWelt extends Applet
    public void paint(Graphics g)
    g.drawString("Hello World",50,20);
    The error message from appletviewer:
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D089C08
    Function=AWTIsHeadless+0x1283
    Library=C:\Programme\j2sdk\jre\bin\awt.dll
    Current Java thread:
    at sun.awt.windows.WToolkit.init(Native Method)
    at sun.awt.windows.WToolkit.run(WToolkit.java:222)
    at java.lang.Thread.run(Thread.java:536)
    Dynamic libraries:
    0x00400000 - 0x00407000 C:\Programme\j2sdk\bin\appletviewer.exe
    0x77F40000 - 0x77FF0000 C:\WINDOWS\System32\ntdll.dll
    0x77E40000 - 0x77F37000 C:\WINDOWS\system32\kernel32.dll
    0x77DA0000 - 0x77E3A000 C:\WINDOWS\system32\ADVAPI32.dll
    0x77C90000 - 0x77D05000 C:\WINDOWS\system32\RPCRT4.dll
    0x77BE0000 - 0x77C33000 C:\WINDOWS\system32\MSVCRT.dll
    0x6D330000 - 0x6D45C000 C:\Programme\j2sdk\jre\bin\client\jvm.dll
    0x77D10000 - 0x77D9D000 C:\WINDOWS\system32\USER32.dll
    0x77C40000 - 0x77C80000 C:\WINDOWS\system32\GDI32.dll
    0x76AF0000 - 0x76B1D000 C:\WINDOWS\System32\WINMM.dll
    0x5D100000 - 0x5D107000 C:\WINDOWS\System32\serwvdrv.dll
    0x5B420000 - 0x5B427000 C:\WINDOWS\System32\umdmxfrm.dll
    0x6D1D0000 - 0x6D1D7000 C:\Programme\j2sdk\jre\bin\hpi.dll
    0x6D300000 - 0x6D30D000 C:\Programme\j2sdk\jre\bin\verify.dll
    0x6D210000 - 0x6D229000 C:\Programme\j2sdk\jre\bin\java.dll
    0x6D320000 - 0x6D32D000 C:\Programme\j2sdk\jre\bin\zip.dll
    0x76F50000 - 0x76F60000 C:\WINDOWS\System32\Secur32.dll
    0x6D000000 - 0x6D0FA000 C:\Programme\j2sdk\jre\bin\awt.dll
    0x72F70000 - 0x72F93000 C:\WINDOWS\System32\WINSPOOL.DRV
    0x76330000 - 0x7634A000 C:\WINDOWS\System32\IMM32.dll
    0x77180000 - 0x7729A000 C:\WINDOWS\system32\ole32.dll
    0x5B0F0000 - 0x5B124000 C:\WINDOWS\system32\uxtheme.dll
    0x6D180000 - 0x6D1D0000 C:\Programme\j2sdk\jre\bin\fontmanager.dll
    0x736D0000 - 0x73715000 C:\WINDOWS\System32\ddraw.dll
    0x73B30000 - 0x73B36000 C:\WINDOWS\System32\DCIMAN32.dll
    0x6DE00000 - 0x6DE71000 C:\WINDOWS\System32\D3DIM.DLL
    0x10000000 - 0x1000E000 C:\WINDOWS\system\4DHOOK32.dll
    0x76C50000 - 0x76C72000 C:\WINDOWS\system32\imagehlp.dll
    0x6DA00000 - 0x6DA7C000 C:\WINDOWS\system32\DBGHELP.dll
    0x77BD0000 - 0x77BD7000 C:\WINDOWS\system32\VERSION.dll
    0x76BB0000 - 0x76BBB000 C:\WINDOWS\System32\PSAPI.DLL
    Local Time = Thu Dec 05 02:18:07 2002
    Elapsed Time = 0
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.4.1-b21 mixed mode)
    # An error report file has been saved as hs_err_pid2356.log.
    # Please refer to the file for further information.
    C:\Dokumente und Einstellungen\Bj�rn\Eigene Dateien\Java\Applets\HalloWelt>
    Also, if I try to make a GUI with Swing, there comes a similar error message, but there it wasn't an applet, but a normal application.
    I hope, somebody can help me quickly!
    CU,
    Vampire

    Hi
    I detected another thing!
    If I view the HTML-file with the HalloWelt-Applet in the browser from my PC, then it doesn't run, but there is only a grey rectangle and on the java-console comes the message:
    java.lang.IllegalArgumentException
         at sun.net.www.ParseUtil.decode(ParseUtil.java:151)
         at sun.net.www.protocol.file.Handler.openConnection(Handler.java:56)
         at java.net.URL.openConnection(URL.java:943)
         at sun.applet.AppletPanel.getAccessControlContext(AppletPanel.java:828)
         at sun.applet.AppletPanel.getClassLoader(AppletPanel.java:762)
         at sun.applet.AppletPanel.createAppletThread(AppletPanel.java:138)
         at sun.applet.AppletPanel.init(AppletPanel.java:191)
         at sun.plugin.AppletViewer.appletInit(AppletViewer.java:557)
         at sun.plugin.viewer.LifeCycleManager.initAppletPanel(LifeCycleManager.java:171)
         at sun.plugin.viewer.WNetscapePluginObject$Initer.run(WNetscapePluginObject.java:299)
    But if I put the files (.HTML/.class) on a Webserver and view it from there in my browser, the applet works fine!

  • App builder problem with Fuzzy Toolkit

    Hi,
    today I wanted to build an app (using LV2009) with some functions from "PID and Fuzzy Control Toolkit".
    Now the app builder is searching for a type definition in vi.lib (as shown in the pic), but it doesn't find the CTL file - but the path used for searching is correct! Then I do the search manually, point to the requested CTL in the correct place (and with correct name of course), and the build will succeed.
    What's up here?
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Solved!
    Go to Solution.
    Attachments:
    check.png ‏18 KB

    Hi,
    thanks for your thoughts!
    Answers:
    - I use WinXP SP3, German settings
    - I use LV2009SP1 for that project, toolkits are installed with that version (other LabVIEW versions are installed too, from LV8.5.1 to LV2010SP1)
    - LabVIEW is installed in the "standard" path on drive C: (as can be seen on the attached pic of message #1)
    - the app builder is unable to find the ctl file (the standard search dialog pops up), but the file is located on exactly the path used for searching (as can be seen on the picture)
    - all I have to do (but this really annoys me) is to point LabVIEW to an item in a place it already knows...
    - the type definition is part of the toolkit, it's installed/located in the standard folder of that toolkit, and I never changed/touched any path or file name
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Some problems with servlet.jar and tomcat 4.1.27

    Hello everybody,
    I used to work with tomcat 3.3.1 and i've decided to use tomcat 4.1.27 now. The manual explains that we have to change de version of servlet.jar, it's done with servlet-2.3.jar but on tomcat starting i have this message:
    jar not loaded. See servlet spec [...]. Offending class: javax/servlet/Servlet.class
    what can i do, i've red all de documentation and i think all versions a OK??
    thanks per advance
    antoine

    I am running Tomcat 4.1.18, so your configuration may be slightly different. I found the Servlet.class file you are missing residing in the Tomcat/common/lib directory in the Servlet.jar file. Check your path and also make sure your Servlet.jar file contains the missing class.

  • Problem with rowLayout Tag in tomcat

    Hi,
    when I deploy my uix/jsp application to tomcat I get the error the following error:
    org.apache.jasper.compiler.CompileException: /fdlgLogin.jsp(99,9) Unable to find setter method for attribute: hAlign
         at org.apache.jasper.compiler.TagBeginGenerator.generateSetters(TagBeginGenerator.java:214)
         at org.apache.jasper.compiler.TagBeginGenerator.generateServiceMethodStatements(TagBeginGenerator.java:332)
         at org.apache.jasper.compiler.TagBeginGenerator.generate(TagBeginGenerator.java:394)
         at org.apache.jasper.compiler.JspParseEventListener$GeneratorWrapper.generate(JspParseEventListener.java:834)
         at org.apache.jasper.compiler.JspParseEventListener.generateAll(JspParseEventListener.java:241)
         at org.apache.jasper.compiler.JspParseEventListener.endPageProcessing(JspParseEventListener.java:197)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:215)
         at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
         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:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
         at java.lang.Thread.run(Thread.java:536)
    any one have the some problem
    Thanks in advance.

    Hi,
    when I deploy my uix/jsp application to tomcat I get the error the following error:
    org.apache.jasper.compiler.CompileException: /fdlgLogin.jsp(99,9) Unable to find setter method for attribute: hAlign
         at org.apache.jasper.compiler.TagBeginGenerator.generateSetters(TagBeginGenerator.java:214)
         at org.apache.jasper.compiler.TagBeginGenerator.generateServiceMethodStatements(TagBeginGenerator.java:332)
         at org.apache.jasper.compiler.TagBeginGenerator.generate(TagBeginGenerator.java:394)
         at org.apache.jasper.compiler.JspParseEventListener$GeneratorWrapper.generate(JspParseEventListener.java:834)
         at org.apache.jasper.compiler.JspParseEventListener.generateAll(JspParseEventListener.java:241)
         at org.apache.jasper.compiler.JspParseEventListener.endPageProcessing(JspParseEventListener.java:197)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:215)
         at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
         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:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
         at java.lang.Thread.run(Thread.java:536)
    any one have the some problem
    Thanks in advance.

  • Problem with ExtendScript Toolkit CS4 and Debugger (32bit)

    Help needed. Whenever I tried to edit my script I always have "ExtendScript Toolkit CS4 and Debugger (32bit) has encountered a problem and needs to close" error.
    Thank You.

    Yes, it's a known issue and they are working on it.
    Thanks
    Bob
    Adobe WAS Scripting

  • Urg Problem with using DataSources in Tomcat

    I am trying to use DataSource in Tomcat4.0
    I have a simple jsp file as shown below:=
    <html>
    <head>
    <title>DB Test using DataSource</title>
    </head>
    <body>
    <%
    foo.DBTest dbt = new foo.DBTest();
    dbt.init();
    %>
    <h2>Results</h2>
    Foo <%= dbt.getFoo() %>
    Bar <%= dbt.getBar() %>
    </body>
    </html>
    and a Servlet by the name of DBTest as shown below:-
    package foo;
    import javax.naming.*;
    import javax.sql.*;
    import java.sql.*;
    public class DBTest
    String foo = "Not Connected";
    int bar = -1;
    public void init()
    try
         System.out.println("Inside INIT of DBTest");
    Context ctx = new InitialContext();
    Context envCtx = (Context)ctx.lookup("java:comp/env");
    if(ctx == null )
    throw new Exception("Boom - No Context");
    //DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/TestDB");
    DataSource ds = (DataSource)envCtx.lookup("jdbc/TestDB");
    if (ds != null)
    Connection conn = ds.getConnection();
    if(conn != null)
    foo = "Got Connection "+conn.toString();
    Statement stmt = conn.createStatement();
    ResultSet rst = stmt.executeQuery("select id, foo, bar from testdata");
    if(rst.next())
    foo=rst.getString(2);
    bar=rst.getInt(3);
    conn.close();
    }catch(Exception e)
    e.printStackTrace();
    }//end of init
    public String getFoo() { return foo; }
    public int getBar() { return bar;}
    }//end of class
    I modified my server.xml file to include this:=
    <!-- Tomcat My DataSource Testing Context -->
    <Context path="/DBTest" docBase="C:\Program Files\Apache Tomcat 4.0\webapps\DBTest"
    debug="5" reloadable="true" crossContext="true">
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="localhost_DBTest_log." suffix=".txt"
    timestamp="true"/>
    <Resource name="jdbc/TestDB"
    auth="Container"
    type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/TestDB">
    <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <parameter>
    <name>maxActive</name>
    <value>5</value>
    </parameter>
    <parameter>
    <name>maxIdle</name>
    <value>2</value>
    </parameter>
    <parameter>
    <name>maxWait</name>
    <value>10000</value>
    </parameter>
    <parameter>
    <name>username</name>
    <value>system</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>manager</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>oracle.jdbc.OracleDriver</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:oracle:thin:@localhost:1521:Test2</value>
    </parameter>
    </ResourceParams>
    </Context>
    <!-- Tomcat My DataSource Testing Context -->
    and my web.xml file is as shown below:=
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <description>Oracle DataSource Test App</description>
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/TestDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    Now when i start Tomcat and try to access the jsp page i get this error in Tomcat Console:=
    Inside INIT of DBTest
    javax.naming.NamingException: Cannot create resource instance
    at org.apache.naming.NamingContext.lookup(NamingContext.java:837)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
    at foo.DBTest.init(DBTest.java:25)
    at org.apache.jsp.test$jsp._jspService(test$jsp.java:60)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspSer
    vlet.java:202)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
    82)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:201)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
    2344)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:164)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
    rValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
    462)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
    ve.java:163)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcesso
    r.java:1011)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.ja
    va:1106)
    at java.lang.Thread.run(Unknown Source)
    Why is this happening .
    I am making sure the resource name in server.xml and web.xml are the same
    Any Help highly appreciated
    Thanks
    Raj

    Hi rajess_kr,
    Looks to me like you're pretty close.
    I'm assuming that you've got the JDBC driver JAR in TOMCAT_HOME/common/lib. The JAR containing your data source factory class org.apache.commons.dbcp.BasicDataSourceFactory should be in that directory, too. Since you're using Oracle, I'd also suggest that you repackage classes12.zip as a JAR file if it's not already a JAR.
    I think the JNDI lookup string should be "java:comp/env/jdbc/TestDB".
    I've got a working example on my desktop at work, but I don't seem to have one here at home. I'll give it a look on Monday and see if I can provide more details. It looks to me like you're not very far off. - MOD

  • Could not find the main class - Problem with Webservice-Access

    Hello Everybody,
    I'm having serious Problems with accessing a WebService (Tomcat-Axis) per executable jar-File.
    I constructed a simple GUI with 3 Textboxes 1 Button and 1 Resultbox.
    I use eclipse so it was no Problem to simple generate the Backgroundclient by Processing the .wsdl-File of the WS.
    Now I do this:
    Head_tServiceLocator serviceLocator = new Head_tServiceLocator();
    Head_t service = serviceLocator.getRPCCall();
    RPCCallSoapBindingStub Head_t = (RPCCallSoapBindingStub) service;and use the Webservice like an Object.
    All this works very well.
    Now the Problem:
    Head_t service = serviceLocator.getRPCCall();this Line has to throw a ServiceException.
    If i add a try-catch Block to Process the Message JAVA tells me after i exported to JAR (with Manifest-stuff and so on) and double Click on the JAR the following :
    Could not find the main Class - Program will exit.
    And if i add a throws Declaration to the Methodheader it tells me:
    Fatal Exception Occured - Program will exit
    But if i Comment out that Line at least the GUI is being displayed (so it DOES find the main-Class). But then of course the Webservice won't be accessed.
    All the JARs needed (axis.jar, commons-discovery.jar and so on) are in the same Directory as the Webservice-Client.jar
    Please Help me.
    Greets,
    Zap

    I am not done any typing mistake while creating the jar file i already followed the suggestion that you have mentioned but still the same error .
    This is my MANIFEST.MF file created under META-INF folder
    Manifest-Version: 1.0
    Class-Path: qtjambi-4.4.3_01.jar qtjambi-win32-msvc2005-4.4.3_01.jar
    Created-By: 1.5.0 (Sun Microsystems Inc.)
    Main-Class: Ui_MainWindow
    When i extracted the app.jar following this i got
    1. META-INF folder inside that MAINFEST.MF file the contents i have already placed above
    2. qtjambi-4.4.3_01.jar
    3. qtjambi-win32-msvc2005-4.4.3_01.jar
    4. Ui_MainWindow.class
    Please tell me whats wrong in that i can also give you the app.jar file please let me know the email id ..

  • Problem In Awt List

    I am Having problem with Awt List component
    setSize
    setPrefferedSize
    setMaximumSize
    None is working I have limited screen are to use in applet Hence I want to limit the width of List
    Below Is My code I am using in Devloping Some Applet.
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.Frame;
    import java.awt.List;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    public class ListSizeProblem extends Frame {
         public List list1;
         ListSizeProblem (String t) {
              this.setTitle(t); // setting up the main window
              this.setSize(500, 400);
              this.setLocation(50, 50);
              this.setLayout(new BorderLayout());
              addWindowListener(new WindowAdapter() { // application will exit if window is closed
                 public void windowClosing(WindowEvent e) {
                      System.exit(0);
              list1 = new List(15, false);
              //list1.setSize(new Dimension(40,200));
              list1.setPreferredSize(new Dimension(40,200));
              //list1.setMaximumSize(new Dimension(40,200));
               for (int i = 1; i < 21; i++) {
                 list1.add("But"+i);
              this.add(list1,BorderLayout.WEST);
              this.pack();
              this.setVisible(true);
         public static void main (String [] args) {
              ListSizeProblem mainframe = new ListSizeProblem("List Size");
    }can somebody help me

    It is indeed a bug. Once your List has data in it, the getPreferredSize method starts calling preferredSize(int rows) method. This method in turn asks the list's peer for the size. The result is that the preferred size you set is completely ignored (hence a bug). Quick fix would be to override the getPreferredSize method like so.
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.Frame;
    import java.awt.List;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    public class ListSizeProblem extends Frame {
        public List list1;
        ListSizeProblem(String t) {
            this.setTitle(t); // setting up the main window
            this.setSize(500, 400);
            this.setLocation(50, 50);
            this.setLayout(new BorderLayout());
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    System.exit(0);
            list1 = new List(15, false) {
                Dimension size = new Dimension(40, 200);
                public java.awt.Dimension getPreferredSize() {
                    return size;
            for (int i = 1; i < 21; i++) {
                list1.add("But" + i);
            this.add(list1, BorderLayout.WEST);
            this.setVisible(true);
        public static void main(String[] args) {
            ListSizeProblem mainframe = new ListSizeProblem("List Size");
    }The list is not 200 pixels high, but this just comes from the fact that you don't have a BorderLayout.NORTH or BorderLayout.SOUTH object yet, so the BorderLayout is alowed to extend the height of the list.
    And you seem to havea pretty exact idea on the size you want your components to be. If the frame is not going to be resizable, then you can use no layout manager if you want. This would require you to set the exact bounds of every component you add to the frame.

  • Repaint problems with an applet under Netscape 4.75

    Hello,
    I'm currently working on an applet created with VisualAge for Java, running under the standard Netscape 4.75 JVM, with Windows NT4.
    I am experiencing problems with AWT components which randomly disappear, especially Labels and sometimes Panels. When I drag a window over the missing label and then drag it back, the label appears.
    I have tried a lot of combinations with the repaint(), paint(), paintAll() and paintComponents() methods, but it has not been efficient for the moment. Introducing lots of repaint() calls on the concerned labels is even worse.
    Is there a known bug in the Netscape 4.75 JVM concerning this problem ? Do you have an idea of what can be done to solve this problem ? Changing the JVM is not an option that can be chosen. Netscape 4.75 has been defined as the only browser for the whole project.
    Thanks for your help !
    Kevin

    Well, I finally solved this problem.
    For your information, the JVM included in Netscape 4.75 running under NT4 does not like having AWT labels with either Background or Foreground not initialised. If any of these 2 properties is not defined, it could sometimes occur that the JVM can't display the label.

  • Quality of Cursors created with java.awt.Toolkit(createCutsomCursor)

    Hi -
    I encountered a small problem while creating my own cursors for my Java application , I used the java.awt.Toolkit Objects createCustomCursor method to use a .GIF image as a cursor ... it worked but the quality of that cursor is horrible, the outline is rough ... I tried the same with a transparent PNG file afterwards unfortunately the same result , does anyone know why the quality is that bad or may this just be a problem of the choosen color pool ?
    Help would be very appreciated since I have no clue how to use .cur files ... seems like a non supported format , in case someone knows how to import those it would help a lot if you would drop some lines of code.
    I am currently using Java 2 SDK 1.4.0_01 , newest version.
    Thanks for you time and thanks in advance for possible answers
    -- Harald Scheckenbacher

    I noticed this problem too. It looks like the routine is generating cursors which are scaled to to the maximum size of the system. On my win XP system,
    Dimension dim = toolkit.getBestCursorSize(256, 256);
    int maxColors = toolkit.getMaximumCursorColors();
    return 32,32 and 256 respectively
    If I provide a 16x16, all the pixels have been pixel doubled. If I specify a 32x32 image, then the cursor looks perfect. This looks like a bug for the java folks. Not sure why someone would ever want a cursor image to be pixel scaled.
              

Maybe you are looking for