did you define -Djava.awt.headless=true as a jvm parameter? Martijn
On Tue, Dec 20, 2011 at 12:52 PM, Reiche, Andreas <[email protected]> wrote: > Hi, > has anyone already recognized this behaviour. > I have a Wicket (1.4.18) project build from the Wicket archetype. I'm > developing in Eclipse on a Win XP machine. > Up to now everything worked fine, but now i have the following problem: > I need to inherit a dynamic Image in a wicket page. I use the AWT toolkit for > that purpose. > As Wicket Model i use a RenderedDynamicImageResource which gives me a > Graphics2D object to draw on. > If i try to debug or run the code in the embedded jetty which i use in my IDE > then the JVM 'hangs' and the image is not rendered. > > If i deploy the app to a standalone jetty or a standalone tomcat everything > goes fine. > This is exactly the problem which is described here: > http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&pattern=&thread=1290008946#N1290102636 > > First i thought of a security issue, like mentioned in above thread, but even > after i gave the embedded jetty a java.security.AllPermission > the prob still exits. > > Here is the code which creates and starts the jetty server. > > ... > public static void main(String[] args) throws Exception { > try { > Server server = startJettyServer(8080); > System.in.read(); > System.out.println(">>> STOPPING EMBEDDED JETTY > SERVER"); > // while (System.in.available() == 0) { > // Thread.sleep(5000); > // } > server.stop(); > server.join(); > } catch (Exception e) { > e.printStackTrace(); > System.exit(100); > } > } > > public static Server startJettyServer(int port) throws Exception { > Server server = new Server(); > SocketConnector connector = new SocketConnector(); > // Set some timeout options to make debugging easier. > connector.setMaxIdleTime(1000 * 60 * 60); > connector.setSoLingerTime(-1); > connector.setPort(port); > server.setConnectors(new Connector[] { connector }); > > WebAppContext bb = new WebAppContext(); > bb.setServer(server); > bb.setContextPath("/"); > bb.setWar("src/main/webapp"); > bb.setAttribute("serveIcon", false); > > Permission perm = new AllPermission(); > PermissionCollection permissions = > perm.newPermissionCollection(); > permissions.add(perm); > > bb.setPermissions(permissions); > // START JMX SERVER > // MBeanServer mBeanServer = > // ManagementFactory.getPlatformMBeanServer(); > // MBeanContainer mBeanContainer = new > MBeanContainer(mBeanServer); > // server.getContainer().addEventListener(mBeanContainer); > // mBeanContainer.start(); > > server.addHandler(bb); > > System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS > ANY KEY TO STOP"); > server.start(); > return server; > } > ... > > > I alreasy searched the jetty doc, but could not found any hints. > Appreciate any input on that. > > Mit freundlichen Grüßen > Andreas Reiche > > Landesamt für Geoinformation und Landentwicklung Niedersachsen (LGLN) > - Landesvermessung und Geobasisinformation - > Fachgebiet 423 - Wertermittlungsinformation, Geschäftsnachweise, KLR > Podbielskistraße 331, 30659 Hannover > Tel.: 0511 64609-443 > Fax: 0511 64609-128 > mailto:[email protected] > www.lgln.niedersachsen.de > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > -- Become a Wicket expert, learn from the best: http://wicketinaction.com --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
