Exception in AdminRealm servlet, help needed

I am trying to install the WebLogic LDAP realm, but I get an exception
when I try to test the LDAP realm using the AdminRealm servlet.
Through wlpsadmin, I managed viewing groups and search users, but the
LDAP tab displays no values and I could not login to my portal with
users defined in the LDAP server.
I attached the HTML file returned by the server after calling
AdminRealm.
Any Ideas ?
10x, Eli Kaplan.
[att1.html]

Hi Eli
In the portal definition in your weblogic.properties file, there is a
property called groupname, set this to the name of your LDAP group, this
should solve the problem.
May
"Eli Kaplan" <[email protected]> wrote in message
news:[email protected]...
Hi,
I solved the exception by deleteing the users and groups from the LDAP
server and defining them again.
Another question : I want to allow login to my portal only to certain
groups of users that are defined in my LDAP server, however - all the
users, regardless of their groups, are able to login currently...
What should I do to allow login only to some groups, and not to others ?
Thanks again, Eli.
Eli Kaplan wrote:
I am trying to install the WebLogic LDAP realm, but I get an exception
when I try to test the LDAP realm using the AdminRealm servlet.
Through wlpsadmin, I managed viewing groups and search users, but the
LDAP tab displays no values and I could not login to my portal with
users defined in the LDAP server.
I attached the HTML file returned by the server after calling
AdminRealm.
Any Ideas ?
10x, Eli Kaplan.
An Exception occurred:
java.lang.NullPointerException:
at
weblogic.security.ldaprealm.LDAPDelegate.magicBunny(LDAPDelegate.java:292)
atweblogic.security.ldaprealm.LDAPDelegate.addGroupMember(LDAPDelegate.java:61
1)
atweblogic.security.ldaprealm.LDAPDelegate.getGroupMembers(LDAPDelegate.java:5
75)
atweblogic.security.ldaprealm.LDAPDelegate.getGroupMembers(LDAPDelegate.java:5
18)
atweblogic.security.ldaprealm.LDAPRealm.getGroupMembersInternal(LDAPRealm.java
:81)
atweblogic.security.acl.AbstractListableRealm.getGroupMembers(AbstractListable
Realm.java:302)
atweblogic.security.acl.FlatGroup.ensureFreshness(FlatGroup.java:149)
at weblogic.security.acl.FlatGroup.members(FlatGroup.java:236)
at admin.AdminRealm.composePage(AdminRealm.java:176)
at admin.AdminServlet.service(AdminServlet.java:257)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:105)
atweblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:742)
atweblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:686)
atweblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
Manager.java:247)
atweblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:363)
atweblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:263)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
[Home][Event topics][Event registrations][JDBC info][Licenses]
[Properties][Workspaces][Connections][Threads][Versions][Realm][Help]
[Image]
[Image]
[WebLogic home]
WebLogic Realm for server@developb
[Image]
[Home][Event topics][Event registrations][JDBC info][Licenses]
[Properties][Workspaces][Connections][Threads][Versions][Realm][Help]

Similar Messages

  • Beginner's Servlet Help Needed

    I just copied a HelloWorld.java from an example online
    HelloWorld.java:2: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    HelloWorld.java:3: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    I have Tomcat on my machine and confirgured, but can't find these jar files which contain these classes. I have a book which generally says that they are usually in the lib directory and called servlet.jar and jsp.jar, but I cant' find those. So I just set my CLASSPATH to my Tomcat directory and then lib/*.jar, server/lib/*.jar, common/lib/*.jar and it still does not work.
    I'm new and confused.
    Where are these javax.servlet packages?
    I've also looked in the regular java directory (Java sdk 1.4.1_05)
    Can someone please tell me where I am suppose to go look for this?

    Thanks!
    I didn't look in common! What was this "common/lib/*.jar ", then? :o)

  • Help needed on Servlets and JSTL

    Hi
    I am using tomcat 5.5 and JDK 1.5. What are the softwares I have to download for compiling servlets and creating JSTL ?. Help needed.
    Thanks
    IndyaRaja

    I tried compling servlet, but it is raising error
    that coul not find package javax.servletWhat I did not mention... you need to add those JARs in the Classpath explicitly. You will find them in %TOMCAT_HOME%\common\lib. You atleast need to add servlet-api.jar to your Classpath. :)

  • Help needed to run JSTL 1.1 in Tomcat 6.0.16

    Hi All,Help needed to run JSTL 1.1 in Tomcat 6.0.16. I am trying to run the example given in http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html The example tries to connect to MySQL database from JSP using JSTL and JNDI Datasource.I am running the example using Eclipse 3.4.2 using Sysdeo plugin to start and stop Tomcat server from Eclipse IDE.
    My web.xml file has <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    </web-app>
    and test.jsp has proper taglib directives
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    I have placed the jstl.jar and standard.jarof the jakarta-taglibs-standard-1.1.2.zip under E:\Deepa\workspace\DBTest\WebContent\WEB-INF\lib directory also placedcontext.xml file under E:\Deepa\workspace\DBTest\WebContent\META-INF and the content of context.xml is as below
    <Context path="/DBTest" docBase="DBTest"
    debug="5" reloadable="true" crossContext="true">
    <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
    maxActive="100" maxIdle="30" maxWait="10000"
    username="deepa" password="mysql" driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"/>
    </Context>
    Now while running the example, Eclipse creates one DBTest.xml file under C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\Catalina\localhost
    which has the following line:
    <Context path="/DBTest" reloadable="true" docBase="E:\Deepa\workspace\DBTest" workDir="E:\Deepa\workspace\DBTest\work" />
    I am getting the following error when running http://localhost/DBTest/WebContent/test.jsp
    in Browser:
    <HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/sql cannot be resolved in either web.xml or the jar files deployed with this application
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
    org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:315)
    org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:148)
    org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:431)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:494)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1444)
    org.apache.jasper.compiler.Parser.parse(Parser.java:138)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:154)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:315)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    In the Tomcat Server console, I am getting the following error:
    INFO: Server startup in 7295 ms
    May 20, 2009 6:36:48 AM org.apache.jasper.compiler.TldLocationsCache processWebDotXml
    WARNING: Internal Error: File /WEB-INF/web.xml not found
    May 20, 2009 6:36:48 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/sql cannot be resolved in either web.xml or the jar files deployed with this application
    what is the problem with my code?
    When running the same example, by creating a local server in Eclipse(creating new Server connection pointing to same Tomcat 6.0 installation) it runs fine without any error.

    Hi evnafets,
    Wow, very helpful information, great insight into working of Eclipse. Thanks a lot.
    I have one more question. I have a context.xml file under {color:#0000ff}E:\Deepa\workspace\DBTest\WebContent\META-INF{color} folder and that has the Resource element to connect to MySQL database:
    {code{color:#000000}}{color}<Context path="/DBTest" docBase="DBTest" debug="5" reloadable="true" crossContext="true">
    <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="deepa" password="mysql" driverClassName="com.mysql.jdbc.Driver"
    {color:#0000ff}url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"/>{color}
    {color:#0000ff}</Context>{color}As usual when running application in local Tomcat server of Eclipse, this data source works fine. But when I run the application on Tomcat, by starting Sysdeo plugin from Eclipse, the DBTest.xml file created in C:\Tomcat 6.0\conf\Catalina\localhost has the context entry as<Context path="/DBTest" reloadable="true" docBase="E:\Deepa\workspace\DBTest\WebContent" workDir="E:\Deepa\workspace\DBTest\work">
    </Context>The<Resource> element I have specified in the context.xml of \WebContent\META-INF folder is not taken into account by Tomcat and it gives the following error:May 21, 2009 5:20:04 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException_: Cannot create JDBC driver of class '' for connect URL 'null'"
    _at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(_QueryTagSupport.java:276_)
    at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(_QueryTagSupport.java:159_)
    at org.apache.jsp.test_jsp._jspx_meth_sql_005fquery_005f0(_test_jsp.java:113_)
    at org.apache.jsp.test_jsp._jspService(_test_jsp.java:66_)
    at org.apache.jasper.runtime.HttpJspBase.service(_HttpJspBase.java:70_)
    at javax.servlet.http.HttpServlet.service(_HttpServlet.java:717_)
    at org.apache.jasper.servlet.JspServletWrapper.service(_JspServletWrapper.java:374_)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(_JspServlet.java:342_)
    at org.apache.jasper.servlet.JspServlet.service(_JspServlet.java:267_)
    at javax.servlet.http.HttpServlet.service(_HttpServlet.java:717_)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(_ApplicationFilterChain.java:290_)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(_ApplicationFilterChain.java:206_)
    at org.apache.catalina.core.StandardWrapperValve.invoke(_StandardWrapperValve.java:233_)
    at org.apache.catalina.core.StandardContextValve.invoke(_StandardContextValve.java:191_)
    at org.apache.catalina.core.StandardHostValve.invoke(_StandardHostValve.java:128_)
    at org.apache.catalina.valves.ErrorReportValve.invoke(_ErrorReportValve.java:102_)
    at org.apache.catalina.core.StandardEngineValve.invoke(_StandardEngineValve.java:109_)
    at org.apache.catalina.connector.CoyoteAdapter.service(_CoyoteAdapter.java:286_)
    at org.apache.coyote.http11.Http11Processor.process(_Http11Processor.java:845_)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(_Http11Protocol.java:583_)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(_JIoEndpoint.java:447_)
    at java.lang.Thread.run(_Thread.java:619_)
    {code}
    So to overcome this error I had to place the <Resource> element in DBTest.xml under C:\Tomcat 6.0\conf\Catalina\localhost {color:#000000}and then it works fine. {color}{color:#ff0000}*Why is the context.xml file in META-INF not considered by Tomcat server using Sysdeo Plugin?*
    *Thanks,*
    *Deepa*{color}
    {color}
    Edited by: Deepa76 on May 26, 2009 9:32 PM

  • Getting Servlet Exception while accessing servlets after deployment

    Hi,
    Iam getting a Servlet Exception while accessing servlets after deploying into weblogic 8.1
    Error 500--Internal Server Error
    javax.servlet.ServletException: [HTTP:101249][ServletContext(id=9599010,name=MyWeb,context-path=)]: Servlet class LoginServlet for servlet LoginServlet could not be loaded because the requested class was not found in the classpath F:\bea\weblogic81\samples\domains\examples\MyWeb\WEB-INF\classes;F:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_MyWeb_MyWeb.
    java.lang.UnsupportedClassVersionError: LoginServlet (Unsupported major.minor version 49.0).
         at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:834)
         at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:535)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:373)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6718)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    My Folder Structureis like this,
    F:\bea\weblogic81\samples\domains\examples\MyWeb
    MyWeb is the projectName
    F:\bea\weblogic81\samples\domains\examples\MyWeb\WEB-INF
    Inside WEB-INF, i have web.xml and weblogic.xml, and classes directory with servlet classes.
    Any help will be appreciated.
    Thanx in advance.
    Regards
    Ram

    Hi,
    Thanks for the reply.
    Yes you are correct, i compiled using jdk1.5.
    but my servlet code will not compile in jdk1.4 version since i used advanced vaector classes in that.
    Is there any settings like script file that need to be changed so that i can point to my jdk1.5 compiler rather than the default one pointed by weblogic.
    Thanks in advance
    Ram

  • Help needed on CD740 ???

    Help needed on CD740 ? My CD740 is GREAT , well , it was great !!? The sound and general performance are wonderful , but , it now has a fault !!? Shock Horror !!
    What can it be ?!!? Well , the display illumination has failed , as in , there isn't any !!? Have to use a torch to read it !!? Not good. Now , here's the thing , I want a phone number (UK zone) ?to talk to an actual human and I cannot find one !!? That is soooooo annoying !!? The unit is out of warranty so I want to repair this myself , no worries , I once worked for Philips in their pro studio equipment repair workshop so I know my way around black boxes !! I would like a service manual though so that I can get the case apart without damage. So , can anyone help me with a phone number , pretty please ?!!
    Thanx.

    I tried compling servlet, but it is raising error
    that coul not find package javax.servletWhat I did not mention... you need to add those JARs in the Classpath explicitly. You will find them in %TOMCAT_HOME%\common\lib. You atleast need to add servlet-api.jar to your Classpath. :)

  • Help needed Displaying ALV  Secondary list without using oops concept

    Hi Experts
    Help needed Displaying ALV  Secondary list without using oops concept.
    its urgent
    regds
    rajasekhar

    hi chk this code
    ******************TABLES DECLARATION*****************
    TABLES : VBAP,MARA.
    *****************TYPE POOLS**************************
    TYPE-POOLS : SLIS.
    ****************INTERNAL TABLES**********************
    DATA : BEGIN OF IT_VBAP OCCURS 0,
    VBELN LIKE VBAP-VBELN, "SALES DOCUMENT
    POSNR LIKE VBAP-POSNR, "SALES DOCUMENT ITEM
    MATNR LIKE VBAP-MATNR, "MATERIAL NUMBER
    END OF IT_VBAP.
    ****************TEMPORARY VARIABLES******************
    DATA : V_VBELN LIKE VBAP-VBELN."SALES DOCUMENT
    DATA : V_MTART LIKE MARA-MTART. "MATERIAL TYPE
    *****************FIELD CATALOG***********************
    DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    ****************LAYOUT*******************************
    DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
    ***************VARIANT*******************************
    DATA : G_VARIANT LIKE DISVARIANT.
    ****************SAVE*********************************
    DATA : G_SAVE(1) TYPE C.
    *****************EVENTS******************************
    DATA : XS_EVENTS TYPE SLIS_ALV_EVENT,
           G_EVENTS TYPE SLIS_T_EVENT.
    ******************PF STATUS**************************
    DATA : PF_STATUS TYPE SLIS_FORMNAME VALUE 'SET_PF_STATUS'.
    ******************USER COMMAND************************
    DATA : USER_COMMAND TYPE SLIS_FORMNAME VALUE 'SET_USER_COMMAND',
           R_UCOMM LIKE SY-UCOMM.
    ****************SELECTION SCREEN************************
    SELECT-OPTIONS : S_VBELN FOR VBAP-VBELN.
    ***************AT SELECTION SCREEN*********************
    AT SELECTION-SCREEN.
      PERFORM VALIDATE.
    **************START-OF-SELECTION**************************
    START-OF-SELECTION.
      PERFORM GET_DETAILS.
      PERFORM FIELDCAT.
      PERFORM LAYOUT.
      PERFORM VARIANT.
      PERFORM SAVE.
      PERFORM EVENTS.
      PERFORM ALV_DISPLAY.
    *********************FORMS*******************************************
    *&      Form  validate
          text
    -->  p1        text
    <--  p2        text
    FORM VALIDATE .
      SELECT SINGLE VBELN
                    FROM VBAP
                    INTO V_VBELN
                    WHERE VBELN IN S_VBELN.
      IF SY-SUBRC <> 0.
        MESSAGE E000 WITH 'enter valid vbeln'.
      ENDIF.
    ENDFORM.                    " validate
    *&      Form  get_details
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DETAILS .
      SELECT VBELN
             POSNR
             MATNR
             FROM VBAP
             INTO TABLE IT_VBAP
             WHERE VBELN IN S_VBELN.
      IF SY-SUBRC <> 0.
        MESSAGE E000 WITH 'no details found'.
      ENDIF.
    ENDFORM.                    " get_details
    *&      Form  fieldcat
          text
    -->  p1        text
    <--  p2        text
    FORM FIELDCAT .
      WA_FIELDCAT-TABNAME = 'IT_VBAP'.
      WA_FIELDCAT-FIELDNAME = 'VBELN'.
      WA_FIELDCAT-OUTPUTLEN = 10.
      WA_FIELDCAT-SELTEXT_L = 'SALES DOC'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAP'.
      WA_FIELDCAT-FIELDNAME = 'POSNR'.
      WA_FIELDCAT-OUTPUTLEN = 6.
      WA_FIELDCAT-SELTEXT_L = 'ITEM'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAP'.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-OUTPUTLEN = 18.
      WA_FIELDCAT-SELTEXT_L = 'MATERIAL NO'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    " fieldcat
    *&      Form  LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM LAYOUT .
      WA_LAYOUT-ZEBRA = 'X'.
    ENDFORM.                    " LAYOUT
    *&      Form  VARIANT
          text
    -->  p1        text
    <--  p2        text
    FORM VARIANT .
      CLEAR G_VARIANT.
      G_VARIANT-REPORT = SY-REPID.
    ENDFORM.                    " VARIANT
    *&      Form  SAVE
          text
    -->  p1        text
    <--  p2        text
    FORM SAVE .
      CLEAR G_SAVE.
      G_SAVE = 'A'.
    ENDFORM.                    " SAVE
    *&      Form  EVENTS
          text
    -->  p1        text
    <--  p2        text
    FORM EVENTS .
      CLEAR XS_EVENTS.
      XS_EVENTS-NAME = SLIS_EV_TOP_OF_PAGE.
      XS_EVENTS-FORM = 'TOP_OF_PAGE'.
      APPEND XS_EVENTS TO G_EVENTS.
    ENDFORM.                    " EVENTS
    *&      Form  TOP_OF_PAGE
          text
    FORM TOP_OF_PAGE.
      WRITE :/ ' INTELLI GROUP'.
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  ALV_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM ALV_DISPLAY .
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
         I_CALLBACK_PROGRAM             = SY-REPID
         I_CALLBACK_PF_STATUS_SET       = PF_STATUS
         I_CALLBACK_USER_COMMAND        = USER_COMMAND
      I_STRUCTURE_NAME               =
         IS_LAYOUT                      = WA_LAYOUT
         IT_FIELDCAT                    = IT_FIELDCAT
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
         I_SAVE                         = G_SAVE
         IS_VARIANT                     = G_VARIANT
         IT_EVENTS                      = G_EVENTS
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
        TABLES
          T_OUTTAB                       = IT_VBAP
       EXCEPTIONS
         PROGRAM_ERROR                  = 1
         OTHERS                         = 2
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " ALV_DISPLAY
    *&      Form  SET_PF_STATUS
          text
    FORM SET_PF_STATUS USING EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'Z50651_PFSTATUS' EXCLUDING EXTAB.
    ENDFORM.                    "SET_PF_STATUS
    *&      Form  SET_USER_COMMAND
          text
    FORM SET_USER_COMMAND USING R_UCOMM
                                RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN 'DC'.
          READ TABLE IT_VBAP INDEX RS_SELFIELD-TABINDEX.
          IF SY-SUBRC = 0.
            SELECT SINGLE MTART
                          FROM MARA
                          INTO V_MTART
                          WHERE MATNR = IT_VBAP-MATNR.
            IF SY-SUBRC <> 0.
       MESSAGE E000 WITH 'NO MATERIAL DESCRIPTION FOR SELECTED MATERIAL NO'.
            ELSE.
              WRITE :/ 'MATERIAL NO :',IT_VBAP-MATNR.
              WRITE :/ 'MATERIAL TYPE :' , V_MTART.
            ENDIF.
          ENDIF.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
        WHEN 'EXIT'.
          LEAVE TO SCREEN 0.
        WHEN 'CLOSE'.
          CALL TRANSACTION 'SE38'.
      ENDCASE.
    REPORT  Z_ALV_INTERACTIVE  MESSAGE-ID ZMSG_50651
                                    LINE-SIZE 100
                                    LINE-COUNT 60
                                    NO STANDARD PAGE HEADING.
    ******************TABLES DECLARATION*****************
    TABLES : VBAP,MARA.
    *****************TYPE POOLS**************************
    TYPE-POOLS : SLIS.
    ****************INTERNAL TABLES**********************
    DATA : BEGIN OF IT_VBAP OCCURS 0,
    VBELN LIKE VBAP-VBELN, "SALES DOCUMENT
    POSNR LIKE VBAP-POSNR, "SALES DOCUMENT ITEM
    MATNR LIKE VBAP-MATNR, "MATERIAL NUMBER
    END OF IT_VBAP.
    ****************TEMPORARY VARIABLES******************
    DATA : V_VBELN LIKE VBAP-VBELN."SALES DOCUMENT
    DATA : V_MTART LIKE MARA-MTART. "MATERIAL TYPE
    *****************FIELD CATALOG***********************
    DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    ****************LAYOUT*******************************
    DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
    ***************VARIANT*******************************
    DATA : G_VARIANT LIKE DISVARIANT.
    ****************SAVE*********************************
    DATA : G_SAVE(1) TYPE C.
    *****************EVENTS******************************
    DATA : XS_EVENTS TYPE SLIS_ALV_EVENT,
           G_EVENTS TYPE SLIS_T_EVENT.
    ******************PF STATUS**************************
    DATA : PF_STATUS TYPE SLIS_FORMNAME VALUE 'SET_PF_STATUS'.
    ******************USER COMMAND************************
    DATA : USER_COMMAND TYPE SLIS_FORMNAME VALUE 'SET_USER_COMMAND',
           R_UCOMM LIKE SY-UCOMM.
    ****************SELECTION SCREEN************************
    SELECT-OPTIONS : S_VBELN FOR VBAP-VBELN.
    ***************AT SELECTION SCREEN*********************
    AT SELECTION-SCREEN.
      PERFORM VALIDATE.
    **************START-OF-SELECTION**************************
    START-OF-SELECTION.
      PERFORM GET_DETAILS.
      PERFORM FIELDCAT.
      PERFORM LAYOUT.
      PERFORM VARIANT.
      PERFORM SAVE.
      PERFORM EVENTS.
      PERFORM ALV_DISPLAY.
    *********************FORMS*******************************************
    *&      Form  validate
          text
    -->  p1        text
    <--  p2        text
    FORM VALIDATE .
      SELECT SINGLE VBELN
                    FROM VBAP
                    INTO V_VBELN
                    WHERE VBELN IN S_VBELN.
      IF SY-SUBRC <> 0.
        MESSAGE E000 WITH 'enter valid vbeln'.
      ENDIF.
    ENDFORM.                    " validate
    *&      Form  get_details
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DETAILS .
      SELECT VBELN
             POSNR
             MATNR
             FROM VBAP
             INTO TABLE IT_VBAP
             WHERE VBELN IN S_VBELN.
      IF SY-SUBRC <> 0.
        MESSAGE E000 WITH 'no details found'.
      ENDIF.
    ENDFORM.                    " get_details
    *&      Form  fieldcat
          text
    -->  p1        text
    <--  p2        text
    FORM FIELDCAT .
      WA_FIELDCAT-TABNAME = 'IT_VBAP'.
      WA_FIELDCAT-FIELDNAME = 'VBELN'.
      WA_FIELDCAT-OUTPUTLEN = 10.
      WA_FIELDCAT-SELTEXT_L = 'SALES DOC'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAP'.
      WA_FIELDCAT-FIELDNAME = 'POSNR'.
      WA_FIELDCAT-OUTPUTLEN = 6.
      WA_FIELDCAT-SELTEXT_L = 'ITEM'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_VBAP'.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-OUTPUTLEN = 18.
      WA_FIELDCAT-SELTEXT_L = 'MATERIAL NO'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    " fieldcat
    *&      Form  LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM LAYOUT .
      WA_LAYOUT-ZEBRA = 'X'.
    ENDFORM.                    " LAYOUT
    *&      Form  VARIANT
          text
    -->  p1        text
    <--  p2        text
    FORM VARIANT .
      CLEAR G_VARIANT.
      G_VARIANT-REPORT = SY-REPID.
    ENDFORM.                    " VARIANT
    *&      Form  SAVE
          text
    -->  p1        text
    <--  p2        text
    FORM SAVE .
      CLEAR G_SAVE.
      G_SAVE = 'A'.
    ENDFORM.                    " SAVE
    *&      Form  EVENTS
          text
    -->  p1        text
    <--  p2        text
    FORM EVENTS .
      CLEAR XS_EVENTS.
      XS_EVENTS-NAME = SLIS_EV_TOP_OF_PAGE.
      XS_EVENTS-FORM = 'TOP_OF_PAGE'.
      APPEND XS_EVENTS TO G_EVENTS.
    ENDFORM.                    " EVENTS
    *&      Form  TOP_OF_PAGE
          text
    FORM TOP_OF_PAGE.
      WRITE :/ ' INTELLI GROUP'.
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  ALV_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM ALV_DISPLAY .
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
         I_CALLBACK_PROGRAM             = SY-REPID
       I_CALLBACK_PF_STATUS_SET         = PF_STATUS
         I_CALLBACK_USER_COMMAND        = USER_COMMAND
      I_STRUCTURE_NAME               =
         IS_LAYOUT                      = WA_LAYOUT
         IT_FIELDCAT                    = IT_FIELDCAT
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
         I_SAVE                         = G_SAVE
        IS_VARIANT                      = G_VARIANT
         IT_EVENTS                      = G_EVENTS
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
        TABLES
          T_OUTTAB                       = IT_VBAP
       EXCEPTIONS
         PROGRAM_ERROR                  = 1
         OTHERS                         = 2
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " ALV_DISPLAY
    *&      Form  SET_PF_STATUS
          text
    FORM SET_PF_STATUS USING EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'STANDARD' EXCLUDING EXTAB.
    ENDFORM.                    "SET_PF_STATUS
    *&      Form  SET_USER_COMMAND
          text
    FORM SET_USER_COMMAND USING R_UCOMM
                                RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN 'DC'.
          READ TABLE IT_VBAP INDEX RS_SELFIELD-TABINDEX.
          IF SY-SUBRC = 0.
            SELECT SINGLE MTART
                          FROM MARA
                          INTO V_MTART
                          WHERE MATNR = IT_VBAP-MATNR.
            IF SY-SUBRC <> 0.
       MESSAGE E000 WITH 'NO MATERIAL DESCRIPTION FOR SELECTED MATERIAL NO'.
            ELSE.
              WRITE :/ 'MATERIAL NO :',IT_VBAP-MATNR.
              WRITE :/ 'MATERIAL TYPE :' , V_MTART.
      SUBMIT SLIS_DUMMY WITH P_MATNR EQ IT_VBAP-MATNR
                        WITH P_MTART EQ V_MTART.
            ENDIF.
          ENDIF.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
        WHEN 'EXIT'.
          LEAVE TO SCREEN 0.
        WHEN 'CLOSE'.
          CALL TRANSACTION 'SE38'.
      ENDCASE.
    plz reward if useful

  • Exception thrown by servlet Faces Servlet in WAS ND 6.1.0.13

    Hi,<br>
    I'm using WebSphere Application Server Network Deployment (WAS ND) v. 6.1.0.13.<br><br>
    I'm getting this error when I try to launch my application:<br><br>
    [1/24/08 11:41:44:100 WET] 0000003c ServletWrappe E SRVE0100E: Did not realize init() exception thrown by servlet Faces Servlet: java.lang.NullPointerException<br>
    at javax.faces.webapp.FacesServlet.init(FacesServlet.java:144)<br>
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:190)<br>
    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.init(ServletWrapper.java:317)<br>
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:346)<br>
    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)<br>
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3276)<br>
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)<br>
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)<br>
    at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)<br>
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113)<br>
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)<br>
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)<br>
    at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)<br>
    at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1818)<br>
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:556)<br>
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:606)<br>
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:979)<br>
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1064)<br>
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)<br>
    <br><br><br>
    After doing a search I tried this following steps:<br>
    � Delete the entry in web.xml:<br>
    <listener><br>
    <listener-class><br>
    com.sun.faces.config.ConfigureListener<br>
    </listener-class><br>
    </listener><br><br>
    � Update my log4j version<br><br>
    � Delete the commons-logging.jar from WEB-INF directory<br>
    These are the jar files included in WEB-INF directory:<br>
    commons-beanutils.jar<br>
    commons-collections.jar<br>
    commons-digester.jar<br>
    commons-javaflow-20060411.jar<br>
    commons-logging.jar<br>
    FglConnectorClient.jar<br>
    itext-1.4.2.jar<br>
    jasperreports-1.2.3.jar<br>
    jcommon-1.0.0.jar<br>
    jfreechart-1.0.1.jar<br>
    jsf-api.jar<br>
    jsf-ibm.jar<br>
    jsf-impl.jar<br>
    jstl.jar<br>
    log4j-1.2.14.jar<br>
    standard.jar<br>
    struts.jar<br>
    <br><br>
    <br>
    None of the suggestions worked.<br><br>
    Then I tried to deploy my application in another WAS ND 6.1.0.13 and it worked!!! <br>
    What can I do so solve this problem in my WAS ND 6.1.0.13? What could be the problem?<br><br>
    Thanks,<br>
    Nuno

    Did you find a solution to this problem
    please help
    Thanks & Regards
    Nasir

  • Help needed:Printing HTML file using javax.print

    Hi
    I am using the following code which i got form the forum for rpinting an HTML file.
    The folllowing code is working fine, but the problem is the content of HTML file is not getting printed. I am geeting a blank page with no content. What is the change that is required in the code? ALso is there any simpler way to implement this. Help needed ASAP.
    public boolean printHTMLFile(String filename) {
              try {
                   JEditorPane editorPane = new JEditorPane();
                   editorPane.setEditorKit(new HTMLEditorKit());
                   //editorPane.setContentType("text/html");
                   editorPane.setSize(500,500);
                   String text = getFileContents(filename);
                   if (text != null) {
                        editorPane.setText(text);                    
                   } else {
                        return false;
                   printEditorPane(editorPane);
                   return true;
              } catch (Exception tce) {
                   tce.printStackTrace();
              return false;
         public String getFileContents(String filename) {
              try {
                   File file = new File(filename);
                   BufferedReader br = new BufferedReader(new FileReader(file));
                   String line;
                   StringBuffer sb = new StringBuffer();
                   while ((line = br.readLine()) != null) {
                        sb.append(line);
                   br.close();
                   return sb.toString();
              } catch (Exception tce) {
                   tce.printStackTrace();
              return null;
         public void printEditorPane(JEditorPane editorPane) {
                   try {
                        HTMLPrinter htmlPrinter = new HTMLPrinter();
                        htmlPrinter.printJEditorPane(editorPane, htmlPrinter.showPrintDialog());
                   } catch (Exception tce) {
                        tce.printStackTrace();
         * Sets up to easily print HTML documents. It is not necessary to call any of the setter
         * methods as they all have default values, they are provided should you wish to change
         * any of the default values.
         public class HTMLPrinter {
         public int DEFAULT_DPI = 72;
         public float DEFAULT_PAGE_WIDTH_INCH = 8.5f;
         public float DEFAULT_PAGE_HEIGHT_INCH = 11f;
         int x = 100;
         int y = 80;
         GraphicsConfiguration gc;
         PrintService[] services;
         PrintService defaultService;
         DocFlavor flavor;
         PrintRequestAttributeSet attributes;
         Vector pjlListeners = new Vector();
         Vector pjalListeners = new Vector();
         Vector psalListeners = new Vector();
         public HTMLPrinter() {
              gc = null;
              attributes = new HashPrintRequestAttributeSet();
              flavor = null;
              defaultService = PrintServiceLookup.lookupDefaultPrintService();
              services = PrintServiceLookup.lookupPrintServices(flavor, attributes);
              // do something with the supported docflavors
              DocFlavor[] df = defaultService.getSupportedDocFlavors();
              for (int i = 0; i < df.length; i++)
              System.out.println(df.getMimeType() + " " + df[i].getRepresentationClassName());
              // if there is a default service, but no other services
              if (defaultService != null && (services == null || services.length == 0)) {
              services = new PrintService[1];
              services[0] = defaultService;
         * Set the GraphicsConfiguration to display the print dialog on.
         * @param gc a GraphicsConfiguration object
         public void setGraphicsConfiguration(GraphicsConfiguration gc) {
              this.gc = gc;
         public void setServices(PrintService[] services) {
              this.services = services;
         public void setDefaultService(PrintService service) {
              this.defaultService = service;
         public void setDocFlavor(DocFlavor flavor) {
              this.flavor = flavor;
         public void setPrintRequestAttributes(PrintRequestAttributeSet attributes) {
              this.attributes = attributes;
         public void setPrintDialogLocation(int x, int y) {
              this.x = x;
              this.y = y;
         public void addPrintJobListener(PrintJobListener pjl) {
              pjlListeners.addElement(pjl);
         public void removePrintJobListener(PrintJobListener pjl) {
              pjlListeners.removeElement(pjl);
         public void addPrintServiceAttributeListener(PrintServiceAttributeListener psal) {
              psalListeners.addElement(psal);
         public void removePrintServiceAttributeListener(PrintServiceAttributeListener psal) {
              psalListeners.removeElement(psal);
         public boolean printJEditorPane(JEditorPane jep, PrintService ps) {
                   if (ps == null || jep == null) {
                        System.out.println("printJEditorPane: jep or ps is NULL, aborting...");
                        return false;
                   // get the root view of the preview pane
                   View rv = jep.getUI().getRootView(jep);
                   // get the size of the view (hopefully the total size of the page to be printed
                   int x = (int) rv.getPreferredSpan(View.X_AXIS);
                   int y = (int) rv.getPreferredSpan(View.Y_AXIS);
                   // find out if the print has been set to colour mode
                   DocPrintJob dpj = ps.createPrintJob();
                   PrintJobAttributeSet pjas = dpj.getAttributes();
                   // get the DPI and printable area of the page. use default values if not available
                   // use this to get the maximum number of pixels on the vertical axis
                   PrinterResolution pr = (PrinterResolution) pjas.get(PrinterResolution.class);
                   int dpi;
                   float pageX, pageY;
                   if (pr != null)
                        dpi = pr.getFeedResolution(PrinterResolution.DPI);
                   else
                        dpi = DEFAULT_DPI;
                   MediaPrintableArea mpa = (MediaPrintableArea) pjas.get(MediaPrintableArea.class);
                   if (mpa != null) {
                        pageX = mpa.getX(MediaPrintableArea.INCH);
                        pageY = mpa.getX(MediaPrintableArea.INCH);
                   } else {
                        pageX = DEFAULT_PAGE_WIDTH_INCH;
                        pageY = DEFAULT_PAGE_HEIGHT_INCH;
                   int pixelsPerPageY = (int) (dpi * pageY);
                   int pixelsPerPageX = (int) (dpi * pageX);
                   int minY = Math.max(pixelsPerPageY, y);
                   // make colour true if the user has selected colour, and the PrintService can support colour
                   boolean colour = pjas.containsValue(Chromaticity.COLOR);
                   colour = colour & (ps.getAttribute(ColorSupported.class) == ColorSupported.SUPPORTED);
                   // create a BufferedImage to draw on
                   int imgMode;
                   if (colour)
                        imgMode = BufferedImage.TYPE_3BYTE_BGR;
                   else
                        imgMode = BufferedImage.TYPE_BYTE_GRAY;
                   BufferedImage img = new BufferedImage(pixelsPerPageX, minY, imgMode);
                   Graphics myGraphics = img.getGraphics();
                   myGraphics.setClip(0, 0, pixelsPerPageX, minY);
                   myGraphics.setColor(Color.WHITE);
                   myGraphics.fillRect(0, 0, pixelsPerPageX, minY);
                        java.awt.Rectangle rectangle=new java.awt.Rectangle(0,0,pixelsPerPageX, minY);
                   // call rootView.paint( myGraphics, rect ) to paint the whole image on myGraphics
                   rv.paint(myGraphics, rectangle);
                   try {
                        // write the image as a JPEG to the ByteArray so it can be printed
                        Iterator writers = ImageIO.getImageWritersByFormatName("jpeg");
                        ImageWriter writer = (ImageWriter) writers.next();
                                       // mod: Added the iwparam to create the highest quality image possible
                        ImageWriteParam iwparam = writer.getDefaultWriteParam();
                        iwparam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT) ;
                        iwparam.setCompressionQuality(1.0f); // highest quality
                        ByteArrayOutputStream out = new ByteArrayOutputStream();
                        ImageOutputStream ios = ImageIO.createImageOutputStream(out);
                        writer.setOutput(ios);
                        // get the number of pages we need to print this image
                        int imageHeight = img.getHeight();
                        int numberOfPages = (int) Math.ceil(minY / (double) pixelsPerPageY);
                        // print each page
                        for (int i = 0; i < numberOfPages; i++) {
                             int startY = i * pixelsPerPageY;
                             // get a subimage which is exactly the size of one page
                             BufferedImage subImg = img.getSubimage(0, startY, pixelsPerPageX, Math.min(y - startY, pixelsPerPageY));
                                                 // mod: different .write() method to use the iwparam parameter with highest quality compression
                             writer.write(null, new IIOImage(subImg, null, null), iwparam);
                             SimpleDoc sd = new SimpleDoc(out.toByteArray(), DocFlavor.BYTE_ARRAY.JPEG, null);
                             printDocument(sd, ps);
                             // reset the ByteArray so we can start the next page
                             out.reset();
                   } catch (PrintException e) {
                        System.out.println("Error printing document.");
                        e.printStackTrace();
                        return false;
                   } catch (IOException e) {
                        System.out.println("Error creating ImageOutputStream or writing to it.");
                        e.printStackTrace();
                        return false;
                   // uncomment this code and comment out the 'try-catch' block above
                   // to print to a JFrame instead of to the printer
                   /*          JFrame jf = new JFrame();
                             PaintableJPanel jp = new PaintableJPanel();
                             jp.setImage( img );
                             JScrollPane jsp = new JScrollPane( jp );
                             jf.getContentPane().add( jsp );
                             Insets i = jf.getInsets();
                             jf.setBounds( 0, 0, newX, y );
                             jf.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
                             jf.setVisible( true );*/
                   return true;
              * Print the document to the specified PrintService.
              * This method cannot tell if the printing was successful. You must register
              * a PrintJobListener
              * @return false if no PrintService is selected in the dialog, true otherwise
              public boolean printDocument(Doc doc, PrintService ps) throws PrintException {
                   if (ps == null)
                   return false;
                   addAllPrintServiceAttributeListeners(ps);
                   DocPrintJob dpj = ps.createPrintJob();
                   addAllPrintJobListeners(dpj);
                   dpj.print(doc, attributes);
                   return true;
              public PrintService showPrintDialog() {
                   return ServiceUI.printDialog(gc, x, y, services, defaultService, flavor, attributes);
              private void addAllPrintServiceAttributeListeners(PrintService ps) {
                   // add all listeners that are currently added to this object
                   for (int i = 0; i < psalListeners.size(); i++) {
                   PrintServiceAttributeListener p = (PrintServiceAttributeListener) psalListeners.get(i);
                   ps.addPrintServiceAttributeListener(p);
              private void addAllPrintJobListeners(DocPrintJob dpj) {
                   // add all listeners that are currently added to this object
                   for (int i = 0; i < pjlListeners.size(); i++) {
                   PrintJobListener p = (PrintJobListener) pjlListeners.get(i);
                   dpj.addPrintJobListener(p);
              // uncomment this also to print to a JFrame instead of a printer
              /* protected class PaintableJPanel extends JPanel {
                   Image img;
                   protected PaintableJPanel() {
                        super();
                   public void setImage( Image i ) {
                        img = i;
                   public void paint( Graphics g ) {
                        g.drawImage( img, 0, 0, this );
    Thanks
    Ram

    Ram,
    I have had printing problems too a year and a half ago. I used all printing apis of java and I still find that it is something java lacks. Now basically you can try autosense. To check whether your printer is capable of printing the docflavor use this PrintServiceLookup.lookupPrintServices(flavor, aset); . If it lists the printer then he can print the document otherwise he can't. I guess that is why you get the error.
    Regards,
    Kevin

  • Urgent export help needed

    Extremely urgent help needed! I'm on a tight deadline. I'm working on a sequence, with all my settings set to DV. My client needs an AVI file as an output. After exporting using conversion, the file looks and plays fine, except for any transitions. At the start of each transition, there is 1 frame that is unrendered. I have rendered the entire sequence, and tried the export many times now, and I can't figure out what's wrong. I'm working on v5.1.4. Can someone please help?????

    Thank you, kind sir! < </div>
    Careful who you're callin' names around here, buddy!
    Thank you for the kind words, that's why we're here. Hrdly anyone ever closes their threads on a positive note, I thank you for that, too.
    Good luck with your future projects and those squeaky deadlines.
    bogiesan

  • Finder Files/Folder arrangements: Help Needed!

    Hi,
    I'm relatively new to Mac and I would like to know how you can set Finder to automatically view all files / folders in order of name? without having to change the view of each individual folder
    Any help would be appreciated!
    Regards,
    Ollie

    I think I can answer your question. I just upgraded from Leopard to Snow Leopard and encountered a similar problem. I think I've found a solution.
    After upgrading to Snow Leopard, I noticed that when I used "Icon View" in Finder (which is how I've always used Finder), the icons were completely scrambled and were dispersed randomly all over the window, like a deck of cards strewn on the floor. Some icons were even overlapping other icons. The solution I finally found was to open a finder window, then navigate to any folder in my user account, then right click in a blank area inside the window, then select "Show View Options" from the dropdown menu. This brings up a small preferences pane. Then go to the "Arrange By" dropdown menu in the pane. Then select "Name" from that menu. Then click on the "Use as Defaults" button at the bottom of the pane. Then close the pane. That seemed to work for finder windows. For the Desktop, I got the same results by right-clicking on an empty space on the Desktop and following the same procedure, except that you won't need to click the "Use as Defaults" button at the bottom of the preferences pane for the Desktop, because there is no such button. These simple steps seemed to do the trick. If you have multiple user accounts on your Mac, you may need to repeat these steps for each user account.
    Incidentally, I should mention that before I discovered this solution I called AppleCare support and they told me the only thing I could do was to navigate to each individual folder on my Mac and right-click inside the Finder window for that folder and select "Arrange by Name". The guy who was helping me talked to someone above him in the AppleCare hierarchy who said exactly the same thing. Both of these people said that there was no way to universally change the Finder settings for icon arrangement. They said I had to do it folder-by-folder, for all the thousands of folders on my Mac. I was ready to revert to Leopard, but decided to experiment for a few minutes to see whether I could find a solution. That's how I came up with the solution outlined above.

  • Configuring Exception pages thru servlets for tomcat5

    Hi,
    I am trying to configure exception pages for servlets. But cannot get it done. I have one servlet ServletMapping.java. I am defining in web.xml, that any error should go to the servlet ErrorDisplay.java, which in turn handles the error. I have written for javax.servlet.ServletException.
    But the control does not go to the error page servlet ErrorDisplay.java
    thanx in advance
    -biyat
    Here is my web.xml
    <?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/j2ee/dtds/web-app_2_3.dtd">
    <web-app>
    <display-name>Biyat Testing System for web development</display-name>
    <description>
    Used to write Jsp/ Servlets
    </description>
    <servlet>
    <servlet-name>ServletMapping</servlet-name>
    <servlet-class>code.ServletMapping</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ServletMapping</servlet-name>
    <url-pattern>/code/ServletMapping</url-pattern>
    </servlet-mapping>
    <servlet>
    <servlet-name>ErrorDisplay</servlet-name>
    <servlet-class>code.ErrorDisplay</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ErrorDisplay</servlet-name>
    <url-pattern>/code/ErrorDisplay</url-pattern>
    </servlet-mapping>
    <error-page>
    <exception-type>javax.servlet.ServletException</exception-type>
    <location>/code/ErrorDisplay</location>
    </error-page>
    </web-app>
    Here is my servlets
    in webexp/WEB-INF/classes
    code/ErrorDisplay.java
    package code;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ErrorDisplay extends HttpServlet
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String code=null, message=null, type=null;
    Object codeObj, messageObj, typeObj;
    codeObj = request.getAttribute("javax.servlet.error.status_code");
    messageObj = request.getAttribute("javax.servlet.error.message");
    typeObj = request.getAttribute("javax.servlet.error.exception_type");
    if(codeObj != null)
    code = codeObj.toString();
    if(messageObj!=null)
    message = messageObj.toString();
    if(typeObj != null)
    type = typeObj.toString();
    String reason = (code!=null ? code : type);
    out.println("<html>");
    out.println("<head><title>"+reason+":- "+message+"</title></head>");
    out.println("<body>");
    out.println("<h1>"+reason+"</h1>");
    out.println("<h1>"+message+"</h1>");
    out.println("<hr>");
    out.println("<i>Error accessing "+request.getRequestURI()+"</i>");
    out.println("</body></html>");
    Here is the page where there is error.
    in webexp/WEB-INF/classes
    code/ServletMapping.java
    package code;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ServletMapping extends HttpServlet
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    String var1 = "logging starts";
    String str = request.getParameter("hello");
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    FileInputStream fis = new FileInputStream("hello.gif");
    out.println("<html><body><font color=red><b>Hello Biyat</b></font></body></html>");

    Hi, Biyat,
    The first thing I can see would help is to also define an error page for java.io.IOException - you can even re-use the same error page by adding the following to web.xml:
    <error-page>
    <exception-type>java.io.IOException</exception-type>
    <location>/code/ErrorDisplay</location>
    </error-page>
    djiao

  • Some J2ME midlets doubts!! help needed urgently!!!

    Hi,
    I am currently working in a company where it does wireless technology like WAP and I am assigned a task of creating a screensaver midlet. I have some doubts on the midlets.
    1) How do i use a midlet suites? From what I heard from my colleagues & friends, a servlet is needed for midlets to interact with one another. is it true?
    2) How do I get the startin midlet to take note the phone is idling so that the screen saver midlet can be called?
    Help needed urgently... if there is any source codes for me to refer to would be better... Thanks...
    Leonard

    indicates that MIDlet suites are isolated (on purpose) from each other, so you can't write over another one's address space.
    Also, I believe (at least on cell phones) that you have to specifically enter the Java Apps mode; unless you do the app won't execute. If you are in Java apps mode and a call comes in, the cell's OS puts the Java app currently executing on "Pause" mode and switches back to phone mode.
    Not sure if you will be able to have a Java app do that automatically.
    BTW why do you need a screensaver on an LCD display? Is it really intended to show an advertisement?
    Download and real all the docs you can from Sun, once you get over the generic Java deficiencies MIDlet's aren't that hard.

  • I cannot configure yahoo small business after upgrading to Mavericks Help needed

    Hi Guys,
    it is as simple as that:
    I cannot configure yahoo small business after upgrading to Mavericks Help needed
    Thanks

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, or by corruption of certain system caches. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled on some models, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and  Wi-Fi on certain models. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Troubleshoting help needed:  My iMac keeps crashing and restarting with a report detail: "spinlock application timed out"  What can I do to fix this?timed out"

    Troubleshooting help needed:  My iMac keeps crashing and restarting with a notice: "Spinlock application timed out"  What can I do?

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the page that opens.
    Select the most recent panic log under System Diagnostic Reports. Post the contents — the text, please, not a screenshot. In the interest of privacy, I suggest you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header and body of the report, if it’s present (it may not be.) Please don't post shutdownStall, spin, or hang reports.

Maybe you are looking for