Question

java.lang.InternalError: erroneous handlers when using itext.jar,poi.jar for converting MS word to PDF in weblogic8.1

Asked by: chsrinivas123

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

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;
}
 
}

                                  
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:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2007-12-14 at 00:36:46ID23023116
Tags

erroneous

,

handlers

Topics

Java Application Servers

,

BEA WebLogic Application Server

Participating Experts
1
Points
250
Comments
20

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. weblogic   Vs   websphere
    what is the difference between weblogic and websphere?
  2. Erroneous files in the data directory
    This is in regards to erroneous files that continue to appear in a users lotus notes Data directory (using Mac OS 9.1 running lotus client 5.0.8). That directory continues to fill up with the same files and with time he gets over a 1000 files with names like ~bi 14 or ~cli ...
  3. J2EE for Newbies
    Can someone just give me a general rundown of the J2EE world. I see all these terms, JBoss, JUnit, EJB, Hibernate. What are all these things? Where is the best place to start learning? A book reccomendation would be great!!! But, I would like someone to give me a breif e...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: sompol_kiatkamolchaiPosted on 2007-12-16 at 20:12:47ID: 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.

 

by: chsrinivas123Posted on 2007-12-18 at 06:10:43ID: 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.

 

by: sompol_kiatkamolchaiPosted on 2007-12-18 at 06:34:14ID: 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

 

by: chsrinivas123Posted on 2007-12-18 at 07:44:38ID: 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)

 

by: sompol_kiatkamolchaiPosted on 2007-12-18 at 07:55:53ID: 20493025

Is there any other messages print out before or after this message?

 

by: chsrinivas123Posted on 2007-12-18 at 08:18:55ID: 20493236

sorry it doesn't give any other informational messages before and after.

 

by: sompol_kiatkamolchaiPosted on 2007-12-18 at 08:23:24ID: 20493277

What about AdminDocumentAssemblyAction.java at line 1053?
Could you post this source?

 

by: chsrinivas123Posted on 2007-12-19 at 00:12:01ID: 20498155

1053 line corresponds to the call to
String pdfpath = WordReader.getPdfDocument(path);
I attached the code snippet for the method.

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); 		
        }
    }

                                              
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:

Select allOpen in new window

 

by: sompol_kiatkamolchaiPosted on 2007-12-19 at 00:20:44ID: 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

 

by: chsrinivas123Posted on 2007-12-19 at 02:36:51ID: 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.

 

by: chsrinivas123Posted on 2007-12-19 at 02:44:20ID: 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

 

by: chsrinivas123Posted on 2007-12-19 at 04:56:55ID: 20499139

Any more ideas Sompol to avoid this exception without having to put ithe JARS in server/LIB directory of weblogic

 

by: sompol_kiatkamolchaiPosted on 2007-12-19 at 06:59:17ID: 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

 

by: sompol_kiatkamolchaiPosted on 2007-12-19 at 07:12:47ID: 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

 

by: chsrinivas123Posted on 2007-12-19 at 07:52:27ID: 20500387

Sorry it was typo kept it in APP-INF/LIB only.

 

by: chsrinivas123Posted on 2007-12-19 at 07:54:04ID: 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.

 

by: sompol_kiatkamolchaiPosted on 2007-12-19 at 08:06:01ID: 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

 

by: sompol_kiatkamolchaiPosted on 2007-12-19 at 08:19:49ID: 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

 

by: chsrinivas123Posted on 2007-12-28 at 02:06:46ID: 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.

 

by: chsrinivas123Posted on 2007-12-28 at 02:15:00ID: 31414967

Thanks Sompol.I found that adding the jar paths in the MANIFEST.MF file will work even for production environment.Then i don't need to put those jar files in server/lib of weblogic.Crediting the points for your help.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...