Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
java.lang.NoClassDefFoundError: org/w3c/tidy/Tidy in Linux box
sgeovar
Hi
I'm using BIRT 2.5.2 and created the report using eclipse.
When I deploy and run in Windows m/c , it is working fine.
But the same code was deployed in Linux m/c.
When I run the report I get the error
In windows it is working well.
java.lang.NoClassDefFoundError: org/w3c/tidy/Tidy
at org.eclipse.birt.report.engine.parser.HTMLTextParser.<init>(HTMLTextParser.java:55)
at org.eclipse.birt.report.engine.parser.TextParser.parse(TextParser.java:110)
at org.eclipse.birt.report.engine.layout.pdf.util.HTML2Content.processForeignData(HTML2Content.java:437)
at org.eclipse.birt.report.engine.layout.pdf.util.HTML2Content.html2Content(HTML2Content.java:418)
at org.eclipse.birt.report.engine.nLayout.LayoutEngine.startForeign(LayoutEngine.java:668)
at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:77)
Please help to fix this issue
Find more posts tagged with
Comments
JasonW
Are you using the viewer?
Jason
sgeovar
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="70786" data-time="1291008639" data-date="28 November 2010 - 10:30 PM"><p>
Are you using the viewer?<br />
<br />
Jason<br /></p></blockquote>
<br />
No , I'm not using Viewer.
sgeovar
Hi<br />
<br />
org/w3c/tidy/Tidy is available in Tiny.jar. I exclusively set the classpath for Tiny.jar<br />
<br />
/local/apps/gpb/domains/TMAdmin3/deployed_apps/tmadmin-SNAPSHOT/WEB-INF/platform/configuration/org.eclipse.osgi/bundles/60/1/.cp/lib/Tidy.jar<br />
<br />
It didn't work.<br />
<br />
Then I copied the Tiny.jar and put it in some other directory and set the classpath <br />
<br />
/local/apps/3rdparty/birt/Tidy.jar<br />
<br />
It didn't work.<br />
<br />
Why even after setting the classpath exclusively for Tiny.jar, the exception is thrown ???<br />
<br />
<strong class='bbc'>java.lang.NoClassDefFoundError: org/w3c/tidy/Tidy</strong><br />
at org.eclipse.birt.report.engine.parser.HTMLTextParser.<init>(HTMLTextParser.java:55)<br />
at org.eclipse.birt.report.engine.parser.TextParser.parse(TextParser.java:110)<br />
at org.eclipse.birt.report.engine.layout.pdf.util.HTML2Content.processForeignData(HTML2Content.java:437)<br />
<br />
As I have alredy mentioned, it works well in Windows Weblogic. <br />
Fails in Linux Weblogic ? I just copied and pasted the WEB-INF directory and subfolders from windows to Linux.<br />
<br />
Any reason why it behaves like this ???
JasonW
The tidy jar is already available as part of the report engine plugins.
Specifically in org.eclipse.birt.report.engine. If you add it again it will most likely fail. In your setup to have all the jars from the ReportEngine/lib in your classpath? Do you have all the plugins in your birt home directory?
Jason
sgeovar
All the ReportEngine/lib are in classpath.(WEB-INF/lib) directory.
Still getting error.
Should I change anything in WEB-INF/platforms/plugins/configuration/config.ini ??
config.ini has following entries
#Product Runtime Configuration File
eclipse.product=org.eclipse.birt.report.engine.ReportEngineSDK
osgi.bundles=org.eclipse.equinox.common@2:start, org.eclipse.update.configurator@3:start, org.eclipse.birt.core@start
osgi.framework.extensions=org.eclipse.birt.api
osgi.bundles.defaultStartLevel=4
JasonW
How are you setting your BIRT home?
Jason
sgeovar
I didn't set the BIRT HOME because in Windows it worked well without setting BIRT HOME.
Code follows
EngineConfig config = new EngineConfig();
if (configProps != null) {
String logLevel = configProps.getProperty("logLevel");
Level level = Level.OFF;
if ("SEVERE".equalsIgnoreCase(logLevel)) {
level = Level.SEVERE;
} else if ("WARNING".equalsIgnoreCase(logLevel)) {
level = Level.WARNING;
} else if ("INFO".equalsIgnoreCase(logLevel)) {
level = Level.INFO;
} else if ("CONFIG".equalsIgnoreCase(logLevel)) {
level = Level.CONFIG;
} else if ("FINE".equalsIgnoreCase(logLevel)) {
level = Level.FINE;
} else if ("FINER".equalsIgnoreCase(logLevel)) {
level = Level.FINER;
} else if ("FINEST".equalsIgnoreCase(logLevel)) {
level = Level.FINEST;
} else if ("OFF".equalsIgnoreCase(logLevel)) {
level = Level.OFF;
}
config.setLogConfig(configProps.getProperty("logDirectory"),
level);
}
config.setEngineHome("");
IPlatformContext context = new PlatformServletContext(sc);
config.setPlatformContext(context);
try {
Platform.startup(config);
} catch (BirtException e) {
e.printStackTrace();
}
JasonW
did you write your own servlet?
Jason
sgeovar
Yes, I write my own servlet.
It calls the BirtEngine
BirtEngine Code
if (birtEngine == null) {
EngineConfig config = new EngineConfig();
if (configProps != null) {
String logLevel = configProps.getProperty("logLevel");
Level level = Level.OFF;
if ("SEVERE".equalsIgnoreCase(logLevel)) {
level = Level.SEVERE;
} else if ("WARNING".equalsIgnoreCase(logLevel)) {
level = Level.WARNING;
} else if ("INFO".equalsIgnoreCase(logLevel)) {
level = Level.INFO;
} else if ("CONFIG".equalsIgnoreCase(logLevel)) {
level = Level.CONFIG;
} else if ("FINE".equalsIgnoreCase(logLevel)) {
level = Level.FINE;
} else if ("FINER".equalsIgnoreCase(logLevel)) {
level = Level.FINER;
} else if ("FINEST".equalsIgnoreCase(logLevel)) {
level = Level.FINEST;
} else if ("OFF".equalsIgnoreCase(logLevel)) {
level = Level.OFF;
}
config.setLogConfig(configProps.getProperty("logDirectory"),
level);
}
config.setEngineHome("");
IPlatformContext context = new PlatformServletContext(sc);
config.setPlatformContext(context);
try {
Platform.startup(config);
} catch (BirtException e) {
e.printStackTrace();
}
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
birtEngine = factory.createReportEngine(config);
}
return birtEngine;
JasonW
I understand now. the line setEngineHome("") sets the birt home variable. I noticed in your post you had WEB-INF/platforms/plugins/configuration/ as a directory structure. Is it in the platforms directory or platform directory? You use a PlatformServletContext which requires the plugins to be in the platform/plugins directory. Also verify that when you start your servlet for the first time in your environment that the configuration directory only contains a config.ini. Additional files will be created in this directory which is ok, just make sure it only contains a config.ini the first time you run it.
JAson
sgeovar
It is in the platform/plugins directory. Sorry for the typo.
I removed all the files except config.ini from /WEB-INF/platform/configuration directory and stopped the weblogic server and started again.
I get the same error again.
The directory /WEB-INF/platform/configuration has only config.ini file after running the engine. No additional files are created.
is any refresh required ??
JasonW
Is there write permission on the configuration directory?
Jason
sgeovar
Hi Jason
configuration dir. doesn't have the write permission.
I changed it and the new files and directories are created.
Report is working well and I got the report.
Thank you very much for your help.
This is a web report (PDF) . When I hit the URL from the browser I get the dialog window first.
It asks me to save or cancel. I close the dialog window and again fire the URL. I get the report on the browser.
All the subsequent requests are working well.
But the when hit the servlet first time , I get the dialog box .
How to avoid this ? I want my report directly display on the brower in the first attempt itself.
Once again Thank you very much for you to fix the NoClassDefinitionFound error.
Thanks
sgeovar
Hi
I forget to mention one more thing.
This dialog box appears in Weblogic only.
If I run the same application in Tomcat, I don't get this error.
Thanks
JasonW
I believe that is a browser setting for the mime type.
Jason