Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Error upon using UserAgent

Hi,
I am encountering an error upon creating user defined function for TMAP.
It says,
Exception in thread "main" java.lang.Error: java.lang.NoClassDefFoundError: eu/bitwalker/useragentutils/UserAgent

This is my function:
package routines;
import eu.bitwalker.useragentutils.UserAgent;
public class getUserAgent {
/**
* getBrowser returns browser used for the specified userAgentString
*
*
* {talendTypes} String
*
* {Category} User Defined
*
* {param} string("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)") input: The string need to be printed.
*
* {example} helloExemple("world") # hello world !.
*/
public static String getBrowser(String userAgentString) {
UserAgent agent = UserAgent.parseUserAgentString(userAgentString);
String browser = String.valueOf(agent.getBrowser());
return browser;
}
}
Labels (3)
3 Replies
Anonymous
Not applicable
Author

Hi
The error indicates the external jar used in this routine is missing, right click on the routine and select 'Edit routine dependencies' option import your external jar.
Shong
Anonymous
Not applicable
Author

i already did that, but still that error appears
Anonymous
Not applicable
Author

Hi
Which version are you using? Not sure it was a bug, do you mind to email your jar to me for a quick testing on my side?
Shong