Threading - Iterator.nextEntry(Unknown Source) - ValueIterator.next(Unknown

Hi,
I have a swing application, in which I am using two threads. One thread, is the "main", and the other, takes care of every update to the UI. My program works fine for a few seconds, but then I get a weird error which breaks my UI update thread. The error itself is:
Exception in thread "Thread-2" java.util.ConcurrentModificationException
     at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
     at java.util.HashMap$ValueIterator.next(Unknown Source)
     at DrawFrame$allthread.run(DrawFrame.java:400)
     at java.lang.Thread.run(Unknown Source)
Which leads me to believe that the two threads are messing each other up. Lets take a look at some code.
This is the class which is created about 3 times a second, based upon when the user wants it to be.
class shooting { // this class is inside of the "allthread" class which implements Runnable
          private Point p;
          private Dimension size;
          private int deltaY;
          private int wtr;
          private boolean destroy = false;
          Rectangle recs = new Rectangle(); // This may have a factor
          private shooting(Point p, Dimension size, Color color, int deltaY) {
               this.wtr = 0 - size.height;
               this.p = p;
               this.size = size;
               this.deltaY = deltaY;
               recs.x = p.x;
               recs.y = p.y;
               recs.width = size.width;
               recs.height = size.height;
               rectangles.put(shotnumber, recs); // This may have a big factor as well (this goes into a hashmap)
               shotnumber++;
          public void paint(Graphics g) { // this part has a factor I believe
               if (g.getColor() != Color.red){
               g.setColor(Color.red);
               g.fillRect(recs.x, recs.y, recs.width, recs.height);
          So how I display this class on the UI, is like this:
          public void painters(Graphics g){
          for (allthread.shooting shot : shots) {
               shot.paint(g);
          }The painters method is called from my "public void paintComponent(Graphics g) {}", which I think updates when the computer thinks it needs to.
So I'm not exactly sure why its breaking, perhaps someone can tell from the error which I have listed at the top. I think one thread is trying to do something, which another thread is trying to do something at the same time to the same part of the code. That might not be it, but thats the best I have come up with in a week of confused droning about over this crazy madness.
Thanks for reading,
Nate
P.S. Thanks for the help, all questions will be answered in under 3 minutes - I'm right here watching this post until it is answered. Please ask any questions that you might have in order for me to provide you with information that I may have left out.

[Check this out.|http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collections.html#synchronizedMap(java.util.Map)]
I don't know if you'd consider throwing an exception as breaking... but check this out too.

Similar Messages

  • Replace Unknown Source in EcmaError (JSR223) with actual file name

    Hopefully someone here knows how to do this:
    In my code, all of the scripts are contained in .js files. Whenever one of the scripts contains an error, I get this:
    javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "nonexistant" is not defined. (<Unknown source>#5) in <Unknown source> at line number 5
    What bugs me is the <Unknown Source>. Multiple files are in one ScriptContext, and it can be hard to track down an error. It also looks horrible.
    Is there a way to replace <Unknown Source> with the actual file name? None of the methods I see support passing a File object, so I'm really confused here.
    Cross posted (and unanswered) at:
    http://stackoverflow.com/questions/2885120/replace-unknown-source-in-java-rhino-jsr223-with-actual-file-name
    http://www.javaprogrammingforums.com/exceptions/4465-replace-unknown-source-ecmaerror-jsr223-actual-file-name.html
    http://groups.google.com/group/mozilla.dev.tech.js-engine.rhino
    http://mozilla-xp.com/mozilla.dev.tech.js-engine.rhino/Replace-Unknown-Source-with-Script-file-name

    You may need to set compile debug option set to true.
    I am not sure if my tip is useful for you, anyway good luck.

  • At sun.plugin2.applet.Plugin2Manager.findAppletJDKLevel(Unknown Source)??

    i Signed applet as
    keytool -genkey -keyalg rsa -alias TradeCast
    keytool -export -alias TradeCast -file TradeCastCert.crt
    jarsigner "CatalystDockingApplet.jar" TradeCast lib*but got some exception
    java.lang.NullPointerException
         at sun.plugin2.applet.Plugin2Manager.findAppletJDKLevel(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.NullPointerException
    where am i wrong?

    You are likely missing a class file that in your jar file.
    I had a similar situation and found that the new "next-generation" java plugin does not report NoClassDefFoundError, but instead reports findAppletJDKLevel.
    To see if you are missing class files, do the following:
    1) Close all browsers, ensuring that there are no plugin coffee cup icons in the Windows taskbar.
    2) Open the Java Control panel (Start->Control Panel->Java).
    2.5) On the General tab, clear cache by clicking Settings..., Delete Files..., OK.
    3) Open the Advanced tab.
    4) Expand the Java Plug-in tree option.
    5) Ensure that the "Enable the next-generation Java Plug-in" option is NOT checked and click OK.
    6) Visit your page again.
    7) View the java console stacktrace. It should include NoClassDefFoundError error message.
    8) Add the missing classes to your jar file.

  • JDBC Error - Unknown Source

    guys,
    plz.........can anyone tell me what this crazy unknown source error is.....
    came in try block 1
    sql error occured
    java.sql.SQLException: Failed to start database 'c:/Java DB/javadb/demo/databases/slicr', see the next exception for details.
         at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
         at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
         at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
         at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
         at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
         at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
         at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown Source)
         at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
         at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at com.ibm.examples.server.ToppingServiceImpl.getAllToppings(ToppingServiceImpl.java:30)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:281)
         at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:167)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:248)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Unknown Source)
    thankyou in advance

    this is the only exception it keeps throwing......below is my code for connecting to Derby DB
    package com.ibm.examples.server;
    import java.sql.*;
    import java.util.ArrayList;
    import java.util.List;
    import com.google.gwt.user.server.rpc.RemoteServiceServlet;
    import com.ibm.examples.client.Topping;
    import com.ibm.examples.client.ToppingService;
    public class ToppingServiceImpl extends RemoteServiceServlet
    implements ToppingService {
         public static final String DRIVER ="org.apache.derby.jdbc.EmbeddedDriver";
         public static final String PROTOCOL = "jdbc:derby:c:/Java DB/javadb/demo/databases/slicr";
         public List getAllToppings() {
              try {
                   System.out.println("came in try block 1");
                   Class.forName(DRIVER).newInstance();
                   Connection con = DriverManager.getConnection(PROTOCOL);
                   System.out.println("came in try block 2");
                   Statement s = con.createStatement();
                   ResultSet rs = s.executeQuery("SELECT * FROM app.toppings ORDER BY name");
                   System.out.println(rs);
                   return ObjectFactory.convertToObjects(rs, Topping.class);
              } catch (Exception e) {
                   e.printStackTrace();
                   return new ArrayList();
              } finally {
         try {
         DriverManager.getConnection("jdbc:derby:;shutdown=true");
         } catch (SQLException ignore) {}
    }

  • Getting Unknown Source Error While Deploying the Planning Application

    Hi,
    Getting following error while trying to Deploy Planning Application from BPMA
    Started Time : Tuesday, January 08, 2008 5:43:40 PM
    Submitted Time : Tuesday, January 08, 2008 5:43:40 PM
    Last Updated Time : Tuesday, January 08, 2008 5:44:32 PM
    User Name : hpadmin
    Process Name :
    Thread : 0
    Server : DimServer
    Detail : App Creation failed with Exceptionjava.lang.RuntimeException: Exception occurred while creating the application. Check log for details     at com.hyperion.planning.appdeploy.HspAppDefinition.deployAppFromXML(Unknown Source)     at com.hyperion.planning.appdeploy.HspAppDefinition.access$000(Unknown Source)     at com.hyperion.planning.appdeploy.HspAppDefinition$1.run(Unknown Source)

    Hi,
    I am getting the same error:-
    Started Time : Tuesday, February 26, 2008 4:14:31 PM
    Submitted Time : Tuesday, February 26, 2008 4:14:31 PM
    Last Updated Time : Tuesday, February 26, 2008 4:15:39 PM
    User Name : hpadmin
    Process Name :
    Thread : 0
    Server : DimServer
    Detail : App Creation failed with Exceptionjava.lang.RuntimeException: Exception occurred while creating the application. Check log for details     at com.hyperion.planning.appdeploy.HspAppDefinition.deployAppFromXML(Unknown Source)     at com.hyperion.planning.appdeploy.HspAppDefinition.access$000(Unknown Source)     at com.hyperion.planning.appdeploy.HspAppDefinition$1.run(Unknown Source)
    1---Have created new user for new App as well datasource
    2-Bounced the EPMA as well planning server but no avail.
    how I can I get detail log ? or if is it possible to tell me which directory to look into
    thanks in advance
    Sanjay

  • RMI: Unknown source problem with connection & security

    When I try to run the RMI server code, after I have granted all permissions in my policy, after compiling through RMIC generating my stub and skeleton classes, and finally after running the RMI registry, I receive an error. The error that I have been getting is pasted below. I have searched through several java forums trying to find an answer and have not found one. If you recognized this error, please let me know if you have suggestions. Thanks.
    TestRmiServer exception: access denied (java.net.SocketPermission 192.168.0.152:
    1099 connect,resolve) //note: I'm using the default RMI port
    java.security.AccessControlException: access denied (java.net.SocketPermission 1
    92.168.0.152:1099 connect,resolve)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkConnect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
    ource)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
    ource)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
    at sun.rmi.server.UnicastRef.newCall(Unknown Source)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Unknown Source)
    at irad.nmi.services.util.testRmi.TestRmiServer.main(TestRmiServer.java:
    64)
    Anyway, a response would be welcome. Thanks.

    look at thread :
    http://forum.java.sun.com/thread.jspa?threadID=597299&tstart=0
    most likely you did not specify the -Djava.security.policy property properly.

  • Getting a java.awt.Window.pack(unknown source) error

    Hello,
    This is the exact error stack:
    ERROR: 10:48:21,503 - TcLogger$IC_PrintStream.println:?
    java.lang.NullPointerException
    java.lang.NullPointerException
         at com.teamcenter.rac.util.PropertyLayout.askRowPreferredSize(Unknown Source)
         at com.teamcenter.rac.util.PropertyLayout.preferredLayoutSize(Unknown Source)
         at com.teamcenter.rac.util.PropertyLayout.layoutContainer(Unknown Source)
         at java.awt.Container.layout(Unknown Source)
         at java.awt.Container.doLayout(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validate(Unknown Source)
         at java.awt.Window.pack(Unknown Source)
         at com.honda.ergo.pergo.ProcErgoJDialog.createProcErgoDialog(ProcErgoJDialog.java:789)
         at com.honda.ergo.pergo.ProcErgoJDialog.<init>(ProcErgoJDialog.java:328)
         at com.honda.cme.actions.ErgoAssessmentAppAction.run(ErgoAssessmentAppAction.java:139)
         at java.lang.Thread.run(Unknown Source)
    I'm sure it has something to do with the PropertyLayout (Layout Manager) that I'm using but I don't know what. It works fine on one system but does not work or another.
    Thanks,

    dumas9 wrote:
         at java.awt.Window.pack(Unknown Source)
         at com.honda.ergo.pergo.ProcErgoJDialog.createProcErgoDialog(ProcErgoJDialog.java:789)
         at com.honda.ergo.pergo.ProcErgoJDialog.<init>(ProcErgoJDialog.java:328)
         at com.honda.cme.actions.ErgoAssessmentAppAction.run(ErgoAssessmentAppAction.java:139)
         at java.lang.Thread.run(Unknown Source)It looks like you're not running the Swing GUI on the EDT and since your problem is intermittent it's a likely cause of the problem. Search on "java swing concurrency tutorial" for more information.

  • Sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

    Hi Avi,
    Refer the earlier message below::
    Now I have OC4J version 9.0.2.
    The JDK version is Java(TM) 2 SDK, Standard Edition Version 1.3.1
    OS : Solaris
    I am trying to deploy the "How-To" example from the otn sample examples for JSP. It's a implementation of simple iterator tag. When I try to access the JSp page which has the taglib, it gives me the following error.
    Can u tell me what this error is ????
    500 Internal Server Error
    OracleJSP:
    JSP Error:
    Request URI:/iterate/iterateSample.jsp
    Exception:
    java.lang.NullPointerException
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at oracle.jsp.parse.JspUtils.loadClassJDK(JspUtils.java:219)
         at oracle.jsp.parse.JspUtils.loadClass(JspUtils.java:209)
         at oracle.jsp.parse.JspRTTag.(JspRTTag.java:102)
         at oracle.jsp.parse.JspParseState.createTagParser(JspParseState.java:410)
         at oracle.jsp.parse.JspParseTag.parseNextTag(JspParseTag.java:538)
         at oracle.jsp.parse.JspParseTagFile.parse(JspParseTagFile.java:160)
         at oracle.jsp.parse.OracleJsp2Java.transform(OracleJsp2Java.java:40)
         at oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:295)
         at oracle.jsp.runtimev2.JspPageCompiler.compilePage(JspPageCompiler.java:181)
         at oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:338)
         at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:481)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:255)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:696)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:281)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
         at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    Hi,
    I developed a component using struts framework and deployed it in TOMCAT. It works fine. Now I am trying to deploy it in OC4J. I get the following error when I try to access the JSP. Can anybody tell me what this error is and how to resolve it?
    java.lang.NullPointerException
    at java.lang.String.startsWith(Compiled Code)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.TagLibraryStorage.getTagLibContext(Compiled Code)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.HttpServer.getTagLibContext(Compiled Code)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.HttpApplication.getTagLibContext(Compiled Code)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.JSPPageCompilation.addTagLibTag(Compiled Code)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.JSPPageCompilation.compile(Compiled Code)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.JSPPage.compile(Compiled Code)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.HttpApplication.getJSP(Compiled Code)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.HttpApplication.serviceJSP(Compiled Code)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.JSPServlet.service(Compiled Code)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(Compiled Code)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(Compiled Code)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.HttpRequestHandler.processRequest(Compiled Code)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.HttpRequestHandler.run(Compiled Code)
    at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].util.ThreadPoolThread.run(Compiled Code)
    With Regards
    Amit Kapoor
    Title : re:OC4J Null Pointer Exception O/S : Solaris POST: REPLY (W/QUOTE)
    Author : Amit Kapoor Type : Statement
    Date : Jul 25, 2002 03:26 PT
    The version of the OC4J is 1.0.2.2.1
    Title : re:OC4J Null Pointer Exception O/S : Solaris POST: REPLY (W/QUOTE)
    Author : Avi Abrami Type : Question
    Date : Jul 25, 2002 03:31 PT
    Hi Amit,
    For starters, you are using an old version (1.0.2.2.1) of OC4J.
    You can download newer versions from this web page:
    http://technet.oracle.com/tech/java/oc4j/content.html
    That page also has links to documentation, "how-to" documents and
    sample code. Note that you also need to use compatible versions
    of java.
    Personally, I am using OC4J version 9.0.2.0.0 on SUN Solaris 7
    with JDK 1.3.1 (also from SUN).
    Also, (and if you don't already know about them) the following web
    sites may also be useful to you:
    http://www.orionserver.com
    http://www.orionsupport.com
    http://www.atlassian.com
    http://www.elephantwalker.com
    Good Luck,
    Avi.

    Sorry Amit,
    I have absolutely no idea. However, have you tried these other two
    forums:
    Technologies > Java > Java Server Pages (JSP)
    http://forums.oracle.com/forums/forum.jsp?id=399160
    Technologies > Other > Sample Code
    http://forums.oracle.com/forums/forum.jsp?id=428078
    Hope it helps.
    Good Luck,
    Avi.

  • Help w..TransformerFactoryConfigurationError:  newInstance(Unknown Source)

    When I tried this servlet example apache-tomcat-5.5.17 using java version "1.5.0_07"
    javax.servlet.ServletException: Servlet execution threw an exception
    root cause
    javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
         javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
         XML2HTMLServlet.openFile(XML2HTMLServlet.java:31)
         XML2HTMLServlet.doGet(XML2HTMLServlet.java:19)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    // XML2HTMLServlet.java
    //http://forum.java.sun.com/thread.jspa?forumID=34&threadID=260273
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    public class XML2HTMLServlet extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException {
    response.setContentType("text/html");
    PrintWriter writer = response.getWriter();
    try {
    openFile("file:/apps/tomcat/apache-tomcat-5.5.17/webapps/xml/financials.xml", "file:/apps/tomcat/apache-tomcat-5.5.17/webapps/xml/financials.xsl", writer);
    } catch (Exception e) {
    e.printStackTrace(writer);
    private void openFile(String xmlPath, String xslPath, PrintWriter writer)
    throws IOException, ParserConfigurationException, SAXException,
    TransformerConfigurationException, TransformerException {
    File xmlFile = new File(xmlPath);
    File xslFile = new File(xslPath);
    TransformerFactory tFact = TransformerFactory.newInstance();
    DocumentBuilderFactory dbFact = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = dbFact.newDocumentBuilder();
    Document xmlDoc = builder.parse(xmlFile);
    Document xslDoc = builder.parse(xslFile);
    Node xmlDocNode = (Node)xmlDoc;
    Node xslDocNode = (Node)xslDoc;
    DOMSource xmlSrc = new DOMSource(xmlDocNode);
    DOMSource xslSrc = new DOMSource(xslDocNode);
    DOMResult htmlResult = new DOMResult();
    Transformer transformer = tFact.newTransformer(xslSrc); // the exception occurs here!
    }

    Setting the proerty work now , I get no display, just a
    When I tried this servlet example
    apache-tomcat-5.5.17 using java version "1.5.0_07"
    javax.servlet.ServletException: Servlet execution
    threw an exception
    root cause
    javax.xml.transform.TransformerFactoryConfigurationErr
    or: Provider
    org.apache.xalan.processor.TransformerFactoryImpl not
    found
         javax.xml.transform.TransformerFactory.newInstance(Un
    known Source)
         XML2HTMLServlet.openFile(XML2HTMLServlet.java:31)
         XML2HTMLServlet.doGet(XML2HTMLServlet.java:19)
         javax.servlet.http.HttpServlet.service(HttpServlet.ja
    va:689)
         javax.servlet.http.HttpServlet.service(HttpServlet.ja
    va:802)
    // XML2HTMLServlet.java
    //http://forum.java.sun.com/thread.jspa?forumID=34&thr
    eadID=260273
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    public class XML2HTMLServlet extends HttpServlet {
    System.setProperty("javax.xml.transform.TransformerFactory", "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl");
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException {
    response.setContentType("text/html");
    PrintWriter writer = response.getWriter();
    try {
    penFile("file:/apps/tomcat/apache-tomcat-5.5.17/webapp
    s/xml/financials.xml",
    "file:/apps/tomcat/apache-tomcat-5.5.17/webapps/xml/fi
    nancials.xsl", writer);
    } catch (Exception e) {
    e.printStackTrace(writer);
    private void openFile(String xmlPath, String
    xslPath, PrintWriter writer)
    throws IOException,
    ParserConfigurationException, SAXException,
    TransformerConfigurationException,
    TransformerException {
    File xmlFile = new File(xmlPath);
    File xslFile = new File(xslPath);
    TransformerFactory tFact =
    TransformerFactory.newInstance();
    DocumentBuilderFactory dbFact =
    DocumentBuilderFactory.newInstance();
    DocumentBuilder builder =
    dbFact.newDocumentBuilder();
    Document xmlDoc =
    builder.parse(xmlFile);
    Document xslDoc =
    builder.parse(xslFile);
    Node xmlDocNode = (Node)xmlDoc;
    Node xslDocNode = (Node)xslDoc;
    DOMSource xmlSrc = new
    DOMSource(xmlDocNode);
    DOMSource xslSrc = new
    DOMSource(xslDocNode);
    DOMResult htmlResult = new
    DOMResult();
    Transformer transformer =
    tFact.newTransformer(xslSrc); // the exception
    occurs here!

  • Cannot connect to oracle db with - ensureMemberAccess(Unknown Source) error

    Hi there!
    i'm trying to run a simple applet to check connection with the oracle db:
    import java.sql.*;
    import oracle.jdbc.driver.*;
    class JDBCVersion
    public static void main (String args [])
    throws SQLException
    // Load the Oracle JDBC driver
    DriverManager.registerDriver
    (new oracle.jdbc.driver.OracleDriver());
    System.out.println("registered!");
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@host:1521:sid","user","pass");
    // Create Oracle DatabaseMetaData object
    DatabaseMetaData meta = conn.getMetaData ();
    // gets driver info:
    System.out.println("JDBC driver version is " + meta.getDriverVersion());
    I'm not getting any errors during the compilation and my CLASSPATH is ok pointing to the ojdbc14.jar file, i'm running j2sdk1.2.4_12 and the error
    when I'm trying to load applet is:
    java.lang.IllegalAccessException: Class com.opera.PluginPanel can not access a member of class JDBCVersion with modifiers ""
         at sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at com.opera.PluginPanel.run(PluginPanel.java:406)
         at java.lang.Thread.run(Unknown Source)
    What is wrong???
    Any help would be very appreciable...
    Thanx.

    thank you for your valuable reply, but could you add
    some more additional information?Since I don't write applets and don't know anything additional, no.
    You might try posting your question in a forum that deals with applets and/or the Java security model. Or maybe if you wait long enough, someone who knows both JDBC and applet security will happen along and decide to answer your question.

  • Delta_avi_delta ......unknown source problem...

    When i try to put in the lines that you posted on the forum, i manage to compile but when i actually read from the serial port, error occurs....The error is
    java.lang.NullPointerException
    at java.io.ByteArrayOutputStream.writeto(Unknown source)
    at Read.serialEvent(Read.java:99)
    import javax.comm.*;
    import java.io.*;
    import java.util.*;
    public class Read implements Runnable, SerialPortEventListener {
         // Attributes for Serial Communication
         static Enumeration portList;
         static CommPortIdentifier portId;
         SerialPort serialPort;
         static OutputStream outputStream;
         InputStream inputStream;
         Thread readThread;
         ByteArrayOutputStream buffer;
         public static void main(String s[])
         portList=CommPortIdentifier.getPortIdentifiers();
         while(portList.hasMoreElements())
              portId=(CommPortIdentifier)portList.nextElement();
              if(portId.getPortType()==CommPortIdentifier.PORT_SERIAL)
                   if(portId.getName().equals("COM1"))
                        System.out.println( portId.getName());
                        Read ss=new Read();
              }     // end of while
    }          // end of main
    public Read()     {
    try{
              serialPort=(SerialPort)portId.open("Read", 2000);
    catch(PortInUseException e)     {}
         try{
              inputStream=serialPort.getInputStream();
              System.out.println(inputStream);
    catch(IOException e)     {}
         try{
              serialPort.addEventListener(this);
    catch(Exception e)     {}
              serialPort.notifyOnDataAvailable(true);
         try{
              serialPort.setSerialPortParams(9600,
              SerialPort.DATABITS_8,
              SerialPort.STOPBITS_1,
              SerialPort.PARITY_NONE);
              }catch(UnsupportedCommOperationException e)     {}
              readThread=new Thread(this);
              readThread.start();
         }//end of constructor
         public void run()
              try     {
                   Thread.sleep(200);
              }catch(InterruptedException e)     {}
         public void serialEvent(SerialPortEvent event)
         {buffer=new ByteArrayOutputStream();
           int i;
               switch(event.getEventType())
                    case SerialPortEvent.BI:
                    case SerialPortEvent.OE:
                    case SerialPortEvent.FE:
                    case SerialPortEvent.PE:
                    case SerialPortEvent.CD:
                    case SerialPortEvent.CTS:
                    case SerialPortEvent.DSR:
                    case SerialPortEvent.RI:
                    case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
                    break;
                    case SerialPortEvent.DATA_AVAILABLE:
                    byte[]readBuffer=new byte[8];
                   try{
                        while((i=inputStream.available())>0)
                             inputStream.read(readBuffer, 0, i);
                             buffer.write(readBuffer, 0, i);
                             buffer.writeTo(outputStream);
                             buffer.reset();
                        }catch(IOException e)     {}
                   break;
                   }     // end of switch
                   try     {
                        inputStream.close();
                        }catch(Exception e5)     {}
         }          // end of serialEvent

    Hey I_ws,
    glad I could be some help!
    Other poster is right, you need some particular outputstream to output to, say you're outputting to a text file, (I can't remember your original post, but other outputs are similar)
    you'd do something like:
    DataOutputStream out;
    //initialise with constructor...
             try{
                  out = new DataOutputStream(
                      new FileOutputStream("log.txt"));
             }catch (FileNotFoundException e) {}
    // creating a new data output stream to
    //write data to the specified underlying FileOutputStream...
    //output part:
    inputStream.read(readBuffer, 0, i);   
    buffer.write(readBuffer, 0, i);
    buffer.writeTo(out);
    buffer.reset();
    [\code]
    hope that helps (and hope it runs!)  I'm reading over my pathetic resume to counteract the ego boost of seeing my handle as a thread subject!
    take care :)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • "Unknown Source" errors

    The application behind this code is generating a bunch of "Unknown Source" errors at runtime:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at Polygon#MouseHandler.mousePressed(Polygons.java:95)
    at java.awt.Component.processMouseEvent(Unknown Source), and so on...
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class Polygons extends JPanel {
            protected static boolean shiftIsDown;
            public static void main(String[] args) {
                    JFrame window = new JFrame("Polygons");
                    Polygons content = new Polygons();
                    content.addKeyListener( new KeyAdapter() {
                                            public void KeyPressed(KeyEvent evt) {
                                                    int key = evt.getKeyCode();
                                                    if(key == KeyEvent.VK_SHIFT)
                                                            shiftIsDown = true;
                    window.setContentPane(content);
                    window.pack();
                    window.setLocation(100, 100);
                    window.setResizable(false);
                    window.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
                    window.setVisible(true);
            } // End main()
            private static class PolygonData {
                    int[] x;
                    int[] y;
            public Polygons() {
            // Constructor.
                    setBackground(Color.WHITE);
                    MouseHandler listener = new MouseHandler();
                    setPreferredSize(new Dimension(350, 350) );
                    addMouseListener(listener);
                    addMouseMotionListener(listener);
            private class MouseHandler implements MouseListener,
                    MouseMotionListener {
                    PolygonData polygon;
                    private boolean dragging = false;
                    private int vertices;
                    private int x1, y1;   // First vertex point.
                    private int x2, y2;   // Second vertex point.
                    private boolean newPolygon = false; // Is the user drawing
                                                        // a new polygon?
                           public void mousePressed(MouseEvent evt) {
                                    // If the user is within two pixels of the
                                    // starting point, draw the polygon.
                                    // Graphics g = getGraphics();
                                    int tolerence = 2;
                                    if(shiftIsDown);
                                    x1 = evt.getX();
                                    y1 = evt.getY();
                                    vertices++;
                                    if(newPolygon) {
                                            polygon = new PolygonData();
                                            x2 = x1;
                                            y2 = y1;
                                            polygon.x = new int[1024];
                                            polygon.y = new int[1024];
                                    if(vertices == 1){
                                            polygon.x = new int[1024];
                                            polygon.y = new int[1024];
                                    polygon.x[vertices] = x1;
                                    polygon.y[vertices] = y1;
                                    g.setColor(Color.BLACK);
                                    g.drawPolygon(polygon.x, polygon.y, vertices);
                                    // Did the user click near the starting point?
                                    if( (polygon.x[0] - x1 <= tolerence)
                                            && (polygon.y[0] - y1 <= tolerence) ) {
                                                    g.setColor(Color.RED);
                                                    g.fillPolygon(polygon.x, polygon.y, vertices);                                }                                               
                           public void mouseMoved(MouseEvent evt) {
                                    // Grab the graphics context.
                                    Graphics g = getGraphics();
                                    x2 = evt.getX();
                                    y2 = evt.getY();
                                    g.drawLine(x1, y1, x2, y2);
                                    repaint();
                           // Required by the interfaces....
                           public void mouseReleased(MouseEvent evt) { }
                           public void mouseClicked(MouseEvent evt) { }
                           public void mouseEntered(MouseEvent evt) { }
                           public void mouseExited(MouseEvent evt) { }
                           public void mouseDragged(MouseEvent evt) { }
            } // End nested class Mousehandler
    } // End class PolygonsSame goes for mouseMoved().... What's the fix?

    flounder wrote:
    if(newPolygon) {
    polygon = new PolygonData();This is the probable cause. Since newPolygon is initially false, it will not execute the if statement and polygon will not be initialised. So later in your code when you attempt to use polygon it is null.That did it.
    Thanks!

  • How Solve this iaik.pkcs.pkcs1.b.b(Unknown Source) Error.

    Hi Experts
    I am trying to decrypt the user login credentials while logging to SAP portal.  Bellow code is used.
      PrivateKey privKey = bean.getRandomKey();
      Cipher cipher = Cipher.getInstance("RSA");
      cipher.init(Cipher.DECRYPT_MODE,privKey);
      cipherData = cipher.doFinal(new BASE64Decoder().decodeBuffer(enPwd));
    But I am getting the error specified below, May I kindly request you please give me some approach to resolve this problem if you have come across the same issue earlier.
    iaik.pkcs.pkcs1.b.b(Unknown Source)
    iaik.pkcs.pkcs1.RSACipher.a(Unknown Source)
    iaik.pkcs.pkcs1.RSACipher.engineDoFinal(UnknownSource)
    javax.crypto.Cipher.doFinal(DashoA12275)
    We use SAP Portal version 7.01 SP12 and JDK 1.4.2_19.
    Configtool to set the path  of the cookie and domain of the cookie are Changed.
    "cluster-data" -> "Global Server Configuration" -> "services" -> "servlet_jsp"
    Please find the attached image.
    But Default setting are there that time it's working,But some security region that settings customized.the following way
    JSESSIONID.CookieDomain = SERVER (Default value)
    SESSIONID.CookiePath = APPLICATION(Custom values)
    SAPLB.CookiePath = APPLICATION(Custom values)
    SAPLB.CookieDomain = SERVER(Custom values)
    This below settings is there that time working fine.
    SESSIONID.CookiePath = / (Default values)
    SAPLB.CookiePath = / (Default values)
    SAPLB.CookieDomain = NONE(Default values)
    Please give your suggestion and Help...Solution is Required.
    Thank you && Regards,
    Durga Rao

    Dear Experts This is My Enter Error
    iaik.pkcs.pkcs1.b.b(Unknown Source)iaik.pkcs.pkcs1.RSACipher.a(Unknown Source)iaik.pkcs.pkcs1.RSACipher.engineDoFinal(Unknown Source)javax.crypto.Cipher.doFinal(DashoA12275)sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)java.lang.reflect.Method.invoke(Method.java:331)com.sapportals.htmlb.page.DynPage.doProcessCurrentEvent(DynPage.java:173)com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:119)com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)com.sapportals.portal.ume.component.logon.SAPMLogonCertComponent.doContent(SAPMLogonCertComponent.java:33)com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:645)com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:235)com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:557)java.security.AccessController.doPrivileged(Native Method)com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:430)javax.servlet.http.HttpServlet.service(HttpServlet.java:853)com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1060)com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)java.security.AccessController.doPrivileged(Native Method)com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)

  • Windows cannot verify the digital signature for the drivers required for this device. A recent hardware or software change might have installed a file that is signed incorrectly or damaged, or that might be malicious software from an unknown source. (Code

    I get this message when I check the Device manager for my Ipod
    Windows cannot verify the digital signature for the drivers required for this device. A recent hardware or software change might have installed a file that is signed incorrectly or damaged, or that might be malicious software from an unknown source. (Code 52)
    How do I resolve this I have reinstalled iTunes but it still doesn't recognise my ipod

    I reinstalled Itunes a couple of times.  I unistalled all programs that I never use, I updated all of my drivers, Windows swept my computer and found no problems.  I have a yellow causion lite when I look at the USB-port with the phone connected.  All other devices work without a problem.

  • In the middle of my last update it stopped updating in the because of an unknown source, and now my screen on my iphone is frozen with the apple logo and a loading bar. Help??

    in the middle of my last update it stopped updating in the because of an unknown source, and now my screen on my iphone is frozen with the apple logo and a loading bar. Help??

    Unknown "source"?  Do you mean unknown "error" followed by a number?
    http://support.apple.com/kb/TS3221
    Follow the instructions in the article.  When you connect your phone again, you may have to press both the home and sleep/wake buttons until the Apple logo reappears, then continue pressing the home button until iTunes detects the phone in recovery mode.

Maybe you are looking for

  • Can not open a report in XLTX format

    I have created several BPC reports and save them in XLTX format,  one of them can not be opened with the following message "Excel cannot open file because the file  format or extension is not valid," anybody has this kind experience and know hot to f

  • Difference between RSA5 and AWB-- Business Content tab?

    Hi all, RSA5 is for installing the business content datasources. AdministratorWorkBench--> BusinessContent is also used for installing the Business Content Datasources. So what is the difference between these two options? Thanks.

  • Is mail service down?

    I know it was down 2 weeks ago with the 5, is it down again?

  • Syncing contacts across devices

    Hi I'm having issues with trying to get one set of contacts to display across all my devices. Whereabouts do I create my master set of contacts and how do I then get that to be the same on my iPhone/laptop/iCloud/iPad? Currently after much frustratio

  • IPod 5 generation version 1,2

    Hello, i just updated my ipod to version 1.2 and everything worked fine... until i found out that i cannot add new songs to my ipod... can somebody help me out?