Advertisement

12.14.2007 at 12:36AM PST, ID: 23023116
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

java.lang.InternalError: erroneous handlers when using itext.jar,poi.jar for converting MS word to PDF in weblogic8.1
Tags: erroneous, handlers
I am getting "java.lang.InternalError: erroneous handlers" in weblogic console when i am converting MS word document to PDF using Itext.jar, POI.jar JAR files in weblogic8.1 server in our J2EE application.I am able to convert the PDF without any errors if i put the two jar files in SERVER / LIB of weblogic.But in our PRODUCTION environment we don't have access to change WEBLOGIC environment..So we need to do it somehow at APPLICATION Level.I am trying to put the JARS in class path in our project.properties file but no success.Please help me out.
Thanks
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
package com.uprr.app.cam.common.helpers;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
 
import org.apache.poi.hwpf.extractor.WordExtractor;
 
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfWriter;
 
public class WordReader
{
public static String getPdfDocument(String path)
{
	String pdfPath="G:/cam/bin/casdocs/";
	String pdfDocPath=null;
	try
	{
		InputStream is = new BufferedInputStream(new FileInputStream(path));
		WordExtractor wd = new WordExtractor(is);
		String text = wd.getText();
		System.out.println(text);
		Document document = new Document(); 
		PdfWriter.getInstance(document, new FileOutputStream(pdfPath+"viewDoc.pdf"));
		document.open();
		document.add(new Paragraph(text));
		document.close();
		pdfDocPath=pdfPath+"viewDoc.pdf";
		System.out.println("Pdf Doc Path"+pdfDocPath);
	}catch(FileNotFoundException e1)
	{
		System.out.println("File does not exist."); 
	}
	catch(IOException e2)
	{
		System.out.println("IO Exception");
	}catch (DocumentException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	return pdfDocPath;
}
 
}
Start your free trial to view this solution
Question Stats
Zone: Software
Question Asked By: chsrinivas123
Solution Provided By: sompol_kiatkamolchai
Participating Experts: 1
Solution Grade: B
Views: 49
Translate:
Loading Advertisement...
12.16.2007 at 08:12PM PST, ID: 20482891

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.18.2007 at 06:10AM PST, ID: 20492127

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.18.2007 at 06:34AM PST, ID: 20492298

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.18.2007 at 07:44AM PST, ID: 20492929

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.18.2007 at 07:55AM PST, ID: 20493025

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.18.2007 at 08:18AM PST, ID: 20493236

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.18.2007 at 08:23AM PST, ID: 20493277

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.19.2007 at 12:12AM PST, ID: 20498155

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.19.2007 at 12:20AM PST, ID: 20498169

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.19.2007 at 02:36AM PST, ID: 20498588

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.19.2007 at 02:44AM PST, ID: 20498607

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.19.2007 at 04:56AM PST, ID: 20499139

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.19.2007 at 06:59AM PST, ID: 20499938

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.19.2007 at 07:12AM PST, ID: 20500035

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.19.2007 at 07:52AM PST, ID: 20500387

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.19.2007 at 07:54AM PST, ID: 20500406

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.19.2007 at 08:06AM PST, ID: 20500500

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.19.2007 at 08:19AM PST, ID: 20500623

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
12.28.2007 at 02:06AM PST, ID: 20540752

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
12.16.2007 at 08:12PM PST, ID: 20482891
Hi,

After you get EAR or WAR file, please you check APP-INF/lib or WEB-INF/lib whether those two jar files is presented.

Sompol.
 
12.18.2007 at 06:10AM PST, ID: 20492127
Hi Sompol,
  I have tried putting the two jar files in APP_INF/lib and WEB_INF/lib but still i am getting the same "java.lang.InternalError: erroneous handlers" in my console.
 
12.18.2007 at 06:34AM PST, ID: 20492298
Hi,

The error message you're showing is very short.
Please you give me more error or exception stack trace message.
It's possible that you need to enable logging level in admin console to "info" level which the weblogic console will print more detail.

If you're not familiar with console, here is the place of setting.
your domain (left menu) --> your server (left menu)  --> logging (right pane) --> .... somewhere you can find it there ....

Sompol
 
12.18.2007 at 07:44AM PST, ID: 20492929
C:/work/wordpdf/wordtopdf/test1.doc
Hi,
 I changed the logging level to INFO but didn't have any change in the console after restarting my server.I am sending below the stack trace.

<Dec 18, 2007 7:36:40 AM PST> <Error> <HTTP> <BEA-101017> <[ServletContext(id=2169370,name=cam_admin,context-path=/cam_admin)] Root cause of ServletException.
java.lang.InternalError: erroneous handlers
        at com.uprr.app.cam.webapp.admin.action.AdminDocumentAssemblyAction.doProcesUpdateDocumentSectionContent(AdminDocumentAssemblyAction.java:1053)
        at com.uprr.app.cam.webapp.admin.action.AdminDocumentAssemblyAction.doProcess(AdminDocumentAssemblyAction.java:125)
 
12.18.2007 at 07:55AM PST, ID: 20493025
Is there any other messages print out before or after this message?
 
12.18.2007 at 08:18AM PST, ID: 20493236
sorry it doesn't give any other informational messages before and after.
 
12.18.2007 at 08:23AM PST, ID: 20493277
What about AdminDocumentAssemblyAction.java at line 1053?
Could you post this source?
 
12.19.2007 at 12:12AM PST, ID: 20498155
1053 line corresponds to the call to
String pdfpath = WordReader.getPdfDocument(path);
I attached the code snippet for the method.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
private void doProcesUpdateDocumentSectionContent(HttpServletRequest request, AdminGlobalForm form){
		if(request == null) {
			return;
		}
    	try{
    		DocumentSectionInfo documentInfo = new DocumentSectionInfo();
    		DocumentAssemblyMgrDelegate docDelegate = new DocumentAssemblyMgrDelegate();    		
    		DocumentSectionInfo docSctnInfo = this.getDocumentSctn(request);
    		String userid = this.getLoginUserId(request);    		
    		docSctnInfo.setLastChgUserID(userid);
    		String path = "C:/work/wordpdf/wordtopdf/test1.doc";
    		if(ActionConstants.VIEW_DOCUMENT_SECTION_CONTENT.equals(form.getCommand())){
    			
        		if(path !=null){
        			System.out.println(path);
        			String pdfpath = WordReader.getPdfDocument(path);
        			if(pdfpath!=null ){
        				request.setAttribute(FormConstants.PDF_LOCATION,pdfpath);
            			form.setForwardKey(ActionConstants.VIEW_DOCUMENT_SECTION_CONTENT);	
        			}        			
        		}
    		}else{    		
    		if(path !=null){
    			System.out.println(path);
    			request.setAttribute(FormConstants.PHYSICAL_LOCATION,path);
    			form.setForwardKey(ActionConstants.EDIT_DOCUMENT_SECTION_CONTENT);
    		}/*else if(documentSectionInfo.getValidUser()!=null)
    		{		
    				this.addInfo(request,new MessageInfo(documentSectionInfo.getValidUser()));    			
    				request.setAttribute(FormConstants.VALID_USER,documentSectionInfo.getValidUser());
    	    		form.setForwardKey(ActionConstants.EDIT_DOCUMENT_SECTION_CONTENT);	
    		}/*else
    			{
    				this.addInfo(request,new MessageInfo("Document doesnot exist"));    				
    	    		form.setForwardKey(ActionConstants.EDIT_DOCUMENT_SECTION_CONTENT);	
    			}*/    		
    	}
    	}catch(Exception e) {
    		form.setForwardKey(ActionConstants.GLOBAL_ERROR); 		
        }
    }
Open in New Window
 
12.19.2007 at 12:20AM PST, ID: 20498169
Are you using Unix platform in produciton? If so, I think it didn't work because of fixed path in the source code here.

Maybe String pdfPath="G:/cam/bin/casdocs/"; or
String path = "C:/work/wordpdf/wordtopdf/test1.doc";

Please check.

Hope this help,
Sompol
 
12.19.2007 at 02:36AM PST, ID: 20498588
I am doing it on my local weblogic server.I won't be sending it to production environment until i am able to do it on local environment.I tried changing the pdfpath from G: which is a network drive to C: which is local to my machine but with no effect.
 
12.19.2007 at 02:44AM PST, ID: 20498607
i think its all with JAR files only because i am able to achive the MS Word to PDF conversion if i put both the jar files in my local weblogic server/LIB directory
 
12.19.2007 at 04:56AM PST, ID: 20499139
Any more ideas Sompol to avoid this exception without having to put ithe JARS in server/LIB directory of weblogic
 
12.19.2007 at 06:59AM PST, ID: 20499938
How much access to production environment?
Can you change parameter like classpath in "Remote Start" menu?
If you can do so, you can do an adhoc solution by adding your jar there.

Hope this help,

I'm thinking about the root cause of problem but you can try above solution.

Sompol
 
12.19.2007 at 07:12AM PST, ID: 20500035
Hi,
I saw your comment "I have tried putting the two jar files in APP_INF/lib and WEB_INF/lib but still i am getting the same "java.lang.InternalError: erroneous handlers" in my console."

Is it APP_INF or APP-INF? It should be APP-INF.

Just a guess.
Sompol
 
12.19.2007 at 07:52AM PST, ID: 20500387
Sorry it was typo kept it in APP-INF/LIB only.
 
12.19.2007 at 07:54AM PST, ID: 20500406
And we don't have any access to production environment as some other applications will also be deployed along with our application on the same server.
 
12.19.2007 at 08:06AM PST, ID: 20500500
Ok. I think this is class loader problem. Try this.

After you get EAR file, Using jar tool to extract and remove Itext.jar and POI.jar in APP-INF/lib or WEB-INF/lib. Then pack it to EAR again.
Deploy and test your application the error should be like this "NoClassDefFoundException".
If not, and you get the same error like "java.lang.InternalError: erroneous handlers", that mean you have a duplicated library presented in a classpath in somewhere else. and it might be possible that it has a different version with yours.

Because server/lib is the first place that class loader will load class to memory, If you put your jar there, it's sure that your application will get that class. But if you put in APP-INF/lib or WEB-INF/lib, it's the last place that class loader will load.

If you check and sure that it has a duplicate, I have solution, how to force your application to use class from APP-INF first. (do it by modifying weblogic.xml)

Let's investigate first.

Sompol
Accepted Solution
 
12.19.2007 at 08:19AM PST, ID: 20500623
If those jar files in WEB-INF, try to modify weblogic.xml with this
<container-descriptor>
  <prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>

Your application will use lib in web-inf first.

Sompol
Assisted Solution
 
12.28.2007 at 02:06AM PST, ID: 20540752
Finally found the solution for this.I added the jar paths in MANIFEST.MF file for that module which contains the Wordreader java class and it worked on Production environment too.
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628