Expand my Community achievements bar.

NoClassDefFound error when using custom Java package in scripting QPAC

Avatar

Former Community Member
Hi,



I compiled a little Java-package (.jar), which contains a class that uses
com.adobe.workflow.datatype.form.FormDataTypeInstanceImpl.

I put my library in the lib folder of JBoss (...\server\all\lib).

Then I'm was trying to invoke my custom class in the scripting QPAC. But I'm constantly getting the error message
NoClassDefFound com\adobe\workflow\datatype\form\FormDataTypeInstanceImpl. I already put
adobe-wkf.jar (and various others) in the lib folder of JBoss. Without ever succeeding. Unfortunately.



I'm going mad about this.



Is there a way to address a custom package in the scripting QPAC, which uses
FormDataTypeInstanceImpl?



Steve
4 Replies

Avatar

Level 9
Hi



This usually means a mismatch in the version of a class, or a different classloader or something like that. You should probably not be putting any livecycle jar files in the lib directory - they are already in the livecycle.ear file. Try removing them and restarting JBoss.



What are you trying to achieve? It sounds like a custom QPAC rather than a Script QPAC may better suite your needs.



Howard

Avatar

Former Community Member
Removing the LiceCycle jars from the lib folder did not work. I still get the same error message.

What I wanted to do is provide some basic utilities, without having to spend a lot of time designing QPAC user interfaces.

My utility class contains methods like this one:








  
/**


   



   

@param 
pFormData


   

@return


   

@throws 
ParserConfigurationException


   

@throws 
SAXException


   

@throws 
IOException


   
*/


  

public static 

org.w3c.dom.Document formToXml
(
FormDataTypeInstanceImpl pFormData
)


        

throws 

ParserConfigurationException, SAXException, IOException 
{


    

byte

[] 
data = pFormData.getXFAData
()
;


    
InputStream objXMLInputStream = 

new 

ByteArrayInputStream
(
data
)
;


    


    
// create new Document object


    
DocumentBuilderFactory objFactory = DocumentBuilderFactory.newInstance
()
;


    
DocumentBuilder objBuilder = objFactory.newDocumentBuilder
()
;


    
org.w3c.dom.Document objDocument = objBuilder.parse
(
objXMLInputStream
)
;


    


    

return 

objDocument;


  
}



Even without ever invoking the aforementioned method, I get the error
NoClassDefFound: FormDataTypeInstanceImpl. Which is pretty weird.



Do I have to write my own classloader?



Steve

Avatar

Level 9
Hi Steve



Sorry, can't help you with this one, other than offering to turn this into a custom QPAC for you. (I'm not a fan of the Script QPAC, and never use it.)



Alternately, you can achieve the same thing by using a simple Xpath Expression:

serialize(/process_data/formVar/form-data/data/*,false)



I know that doesn't solve the real problem, but it may be a workaround.



Good luck...

Howard

PS Just a thought. I assume the exception is occurring on the server, not the client.

Avatar

Former Community Member
Yes! I always knew, there's a sexier way of transforming form data to XML. :-)

Thank you, Howard!

It does not solve my problem, because the method I posted is only a simple example-method. Nevertheless, I really appreciate your kind help!

I figure, I'll have to write my own uber QPAC. :-) *sigh



Steve



PS: Yes, the exception is occurring on the server. I never tried it on the client via 'preview' in scripting QPAC!