Das Notes Forum

Lotus Notes / Domino Sonstiges => Java und .NET mit Notes/Domino => Thema gestartet von: bend0r am 18.02.08 - 11:01:30

Titel: Pie Chart mit JFree Chart und Notes 6.5
Beitrag von: bend0r am 18.02.08 - 11:01:30
Hallo, ...

ich habe in anderen Projekten (reines Java) schon mit Jfree Chart rumgehampelt; allerdings ist das schon ein wenig her  ;)
Nun habe ich mir gedachtd as man das ja auch in Notes einbetten könnte; mit iText hat es ja schliesslich auch schonmal gut geklappt.
Nun habe ich ein "beispiel" gebastelt um zu testen ob das überhaupt funktioniert:

Code
import lotus.domino.*;
import org.jfree.chart.*;
import org.jfree.data.*;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartFrame;
import org.jfree.chart.JFreeChart;
import org.jfree.data.general.DefaultPieDataset;

public class JavaAgent extends AgentBase {

	public void NotesMain() {

		try {
			Session session = getSession();
			AgentContext agentContext = session.getAgentContext();

			DefaultPieDataset data = new DefaultPieDataset();
			data.setValue("Category 1", 43.2);
			data.setValue("Category 2", 27.9);
			data.setValue("Category 3", 79.5);

			JFreeChart chart = ChartFactory.createPieChart3D("3d Chart", data, true, true, false);
		
			ChartFrame frame = new ChartFrame("First", chart);
		
			frame.pack();
			frame.setVisible(true);

		} catch(Exception e) {
			e.printStackTrace();
		}
	}
}

Agent läuft auch, leider bleibt das Fenster / Frame leer.
Habe ich jetzt mit Notes 6.5.4 und Notes 7.0.2 getestet.
Beidesmal leider gleich.
Agent wird von mir gestartet mit vollen Rechten.

jemand ne idee?

grüße rene
Titel: Re: Pie Chart mit JFree Chart und Notes 6.5
Beitrag von: Ralf_M_Petter am 18.02.08 - 12:48:36
Poste doch mal den Inhalt des java Debugger Fenster in Notes. Unter Datei Extras Java Debug Konsole.

Grüße

Ralf

P.S. Eine Vermutung wäre, dass die von dir verwendete JFree Version nicht mehr mit Java 1.3.1 kompatibel ist.
Titel: Re: Pie Chart mit JFree Chart und Notes 6.5
Beitrag von: bend0r am 18.02.08 - 13:03:12
debugger:

Code
Exception occurred during event dispatching:

java.lang.ExceptionInInitializerError: java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)

	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:286)

	at java.security.AccessController.checkPermission(AccessController.java:413)

	at java.lang.SecurityManager.checkPermission(SecurityManager.java:565)

	at COM.ibm.JEmpower.applet.AppletSecurity.superDotCheckPermission(AppletSecurity.java:1371)

	at COM.ibm.JEmpower.applet.AppletSecurity.checkRuntimePermission(AppletSecurity.java:1244)

	at COM.ibm.JEmpower.applet.AppletSecurity.checkPermission(AppletSecurity.java:1448)

	at COM.ibm.JEmpower.applet.AppletSecurity.checkPermission(AppletSecurity.java:1386)

	at java.lang.Thread.getContextClassLoader(Thread.java:1139)

	at org.jfree.util.ObjectUtilities.getClassLoader(ObjectUtilities.java:268)

	at org.jfree.util.ObjectUtilities.isJDK14(ObjectUtilities.java:441)

	at org.jfree.text.TextUtilities.<clinit>(TextUtilities.java:102)

	at org.jfree.chart.title.TextTitle.arrangeRR(TextTitle.java:588)

	at org.jfree.chart.title.TextTitle.arrange(TextTitle.java:459)

	at org.jfree.chart.JFreeChart.drawTitle(JFreeChart.java:1308)

	at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1198)

	at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1354)

	at javax.swing.JComponent.paint(JComponent.java:718)

	at javax.swing.JComponent.paintChildren(JComponent.java:529)

	at javax.swing.JComponent.paint(JComponent.java:727)

	at javax.swing.JLayeredPane.paint(JLayeredPane.java:556)

	at javax.swing.JComponent.paintChildren(JComponent.java:529)

	at javax.swing.JComponent.paint(JComponent.java:700)

	at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:46)

	at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:68)

	at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:105)

	at java.awt.Container.paint(Container.java:998)

	at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:37)

	at sun.awt.RepaintArea.paint(RepaintArea.java:323)

	at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:210)

	at java.awt.Component.dispatchEventImpl(Component.java:2747)

	at java.awt.Container.dispatchEventImpl(Container.java:1252)

	at java.awt.Window.dispatchEventImpl(Window.java:964)

	at java.awt.Component.dispatchEvent(Component.java:2581)

	at java.awt.EventQueue.dispatchEvent(EventQueue.java:434)

	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)

	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:141)

	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:132)

	at java.awt.EventDispatchThread.run(EventDispatchThread.java:124)

Exception occurred during event dispatching:

java.lang.NoClassDefFoundError: org/jfree/text/TextUtilities

	at org.jfree.chart.title.TextTitle.arrangeRR(TextTitle.java:588)

	at org.jfree.chart.title.TextTitle.arrange(TextTitle.java:459)

	at org.jfree.chart.JFreeChart.drawTitle(JFreeChart.java:1308)

	at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1198)

	at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1354)

	at javax.swing.JComponent.paint(JComponent.java:718)

	at javax.swing.JComponent.paintChildren(JComponent.java:529)

	at javax.swing.JComponent.paint(JComponent.java:727)

	at javax.swing.JLayeredPane.paint(JLayeredPane.java:556)

	at javax.swing.JComponent.paintChildren(JComponent.java:529)

	at javax.swing.JComponent.paint(JComponent.java:700)

	at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:46)

	at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:68)

	at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:105)

	at java.awt.Container.paint(Container.java:998)

	at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:37)

	at sun.awt.RepaintArea.paint(RepaintArea.java:323)

	at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:210)

	at java.awt.Component.dispatchEventImpl(Component.java:2747)

	at java.awt.Container.dispatchEventImpl(Container.java:1252)

	at java.awt.Window.dispatchEventImpl(Window.java:964)

	at java.awt.Component.dispatchEvent(Component.java:2581)

	at java.awt.EventQueue.dispatchEvent(EventQueue.java:434)

	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)

	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:141)

	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:132)

	at java.awt.EventDispatchThread.run(EventDispatchThread.java:124)

Exception occurred during event dispatching:

java.lang.NullPointerException

	at lotus.domino.AgentLoader.loadClass(Unknown Source)

	at java.lang.ClassLoader.loadClass(ClassLoader.java:448)

	at java.lang.Class.forName1(Native Method)

	at java.lang.Class.forName(Class.java:142)

	at org.jfree.chart.ChartPanel.class$(ChartPanel.java:1711)

	at org.jfree.chart.ChartPanel.mouseMoved(ChartPanel.java:1746)

	at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:284)

	at java.awt.Component.processMouseMotionEvent(Component.java:3840)

	at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:2358)

	at java.awt.Component.processEvent(Component.java:3632)

	at java.awt.Container.processEvent(Container.java:1203)

	at java.awt.Component.dispatchEventImpl(Component.java:2678)

	at java.awt.Container.dispatchEventImpl(Container.java:1252)

	at java.awt.Component.dispatchEvent(Component.java:2581)

	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2498)

	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2291)

	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2172)

	at java.awt.Container.dispatchEventImpl(Container.java:1239)

	at java.awt.Window.dispatchEventImpl(Window.java:964)

	at java.awt.Component.dispatchEvent(Component.java:2581)

	at java.awt.EventQueue.dispatchEvent(EventQueue.java:434)

	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)

	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:141)

	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:132)

	at java.awt.EventDispatchThread.run(EventDispatchThread.java:124


laut hp von jfree sind die kompatibel.

komisch


grüße rene
Titel: Re: Pie Chart mit JFree Chart und Notes 6.5
Beitrag von: flaite am 18.02.08 - 13:24:40
Guck mal auf den 2. Reiter der Eigenschaftsbox des Agenten.
Dort gibt es ein Auswahlfeld: Set runtime Security Level.
Setz das hoch.
Titel: Re: Pie Chart mit JFree Chart und Notes 6.5
Beitrag von: bend0r am 18.02.08 - 13:30:38
hallo ....

das steht auf der höchsten stufe;3 ... "Beschränkte Operationen mit vollständigen Admin-Rechten zulassen".

grüße rene
Titel: Re: Pie Chart mit JFree Chart und Notes 6.5
Beitrag von: flaite am 18.02.08 - 14:05:08
Ich glaub das geht nur für Notes 7, aber dieses Beispiel von Julian Robichaux (inkluse Quellcode) benutzt JFreeChart (bindet das mit LS2J ein).
http://www.nsftools.com/blog/blog-02-2008.htm#02-06-08

Gruß Axel
Titel: Re: Pie Chart mit JFree Chart und Notes 6.5
Beitrag von: flaite am 18.02.08 - 14:23:09
andererseits kannst du wohl auch direkt die java.policy Datei editieren.
Notes6\jvm\lib\security\java.policy
Hier wird es ein wenig erklärt, wie man die policy ändert.
http://java.sun.com/docs/books/tutorial/security/tour1/step2.html
Vorsicht: Das ist eine globale Änderung, die dann für alle Agenten gilt.

Titel: Re: Pie Chart mit JFree Chart und Notes 6.5
Beitrag von: bend0r am 18.02.08 - 14:24:14
hmm ... ich schaue mir nachher mal beide varianten an;  ;D
mal schauen welche variante dann sinnvoller ist

grüße rene