Digital Developer Conference: a FREE half-day online conference focused on AI & Cloud – North America: Nov 2 – India: Nov 9 – Europe: Nov 14 – Asia Nov 23 Register now

Close outline
  • United States
IBM?
  • Site map
IBM?
  • Marketplace

  • Close
    Search
  • Sign in
    • Sign in
    • Register
  • IBM Navigation
IBM Developer Answers
  • Spaces
    • Blockchain
    • IBM Cloud platform
    • Internet of Things
    • Predictive Analytics
    • Watson
    • See all spaces
  • Tags
  • Users
  • Badges
  • FAQ
  • Help
Close

Name

Community

  • Learn
  • Develop
  • Connect

Discover IBM

  • ConnectMarketplace
  • Products
  • Services
  • Industries
  • Careers
  • Partners
  • Support
10.190.13.195

Refine your search by using the following advanced search options.

Criteria Usage
Questions with keyword1 or keyword2 keyword1 keyword2
Questions with a mandatory word, e.g. keyword2 keyword1 +keyword2
Questions excluding a word, e.g. keyword2 keyword1 -keyword2
Questions with keyword(s) and a specific tag keyword1 [tag1]
Questions with keyword(s) and either of two or more specific tags keyword1 [tag1] [tag2]
To search for all posts by a user or all posts with a specific tag, start typing and choose from the suggestion list. Do not use a plus or minus sign with a tag, e.g., +[tag1].
  • Ask a question

External jar for Java Native Functions

270007Q86Y gravatar image
Question by dev_47  (1) | Jan 11, 2015 at 12:27 PM streamsdevjarnativefunctions

Hi,

I can't launch my streams application: START NON-TRANSLATABLEjava.lang.NoClassDefFoundError: javax.mail.Authenticator The application is compiling without errors (jar included in build-path), copied into application-folder/ressources/impl/lib too - seems to be wrong way...

https://developer.ibm.com/answers/questions/4941/how-do-i-include-external-jars-for-a-java-native-function.html -> says to put jar into impl/lib what I actually did...

Thanks for help

People who like this

  0
Comment
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

3 answers

  • Sort: 
270004YJNG gravatar image

Answer by askene (167) | Jan 12, 2015 at 08:59 AM

Hello, I had to put my dependency jars in impl/lib AND reference the dependencies in the Class-Path in the MANIFEST.MF of the toolkit jar that has the annotated functions in it.

If you code is in foo.bar.jar make sure you have something like this in the META-INF/MANIFEST.MF Manifest-Version: 1.0 Class-Path: javax.mail.jar other.dependency.jar third.dependency.jar

Comment

People who like this

  0   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
270007Q86Y gravatar image

Answer by dev_47 (1) | Jan 12, 2015 at 01:47 PM

Why I have to change the MANIFEST.MF in the jar I just want to use? I downloaded it compiled - this is the only .jar I want to use, So why its not enough to add it in project-settings and copy it to impl/lib?

I really don't understand this...

Comment

People who like this

  0   Show 1   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
270004YJNG gravatar image askene (167)   Jan 13, 2015 at 11:27 AM 0
Share

Ah, I think I misunderstood how you are building/launching things. You do not need to change the javax.mail.jar at all. The jar that I added the MANIFEST.MF to was the jar with all of my custom java code in it. I usually compile my java code into a jar via 3rd party build tools (maven or gradle) instead of using StreamsStudio.

If you are using StreamsStudio and having it build .class files into impl/bin...then I do not know what else you would need to do other then add javax.mail.jar to the impl/lib directory

2700050N5R gravatar image

Answer by Bruce Glassford (912) | Mar 12, 2015 at 11:05 AM

Pulling this to the top to see if we can get to a complete answer:

  • If you're compiling your custom function to a .jar you have to add the MANIFEST.MF file

What do you need to do if you're just compiling to .class? Looks like you need to have a reference in the javafunction.xml but there's no way to do it.

Comment

People who like this

  0   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

Follow this question

20 people are following this question.

Answers

Answers & comments

Related questions

Adding Third party jars to Native Functions 1 Answer

Java Native Function portability and automated build/move process 2 Answers

Java Native Function external dependencies 2 Answers

Annotation Function does not support parameter type java.util.Map 1 Answer

Problem for retraining a HoltWinters2 model in Streams 4.2.1.1 1 Answer

  • Contact
  • Privacy
  • IBM Developer Terms of use
  • Accessibility
  • Report Abuse
  • Cookie Preferences

Powered by AnswerHub

Authentication check. Please ignore.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • API Connect
  • Analytic Hybrid Cloud Core
  • Application Performance Management
  • Appsecdev
  • BPM
  • Blockchain
  • Business Transaction Intelligence
  • CAPI
  • CAPI SNAP
  • CICS
  • Cloud Analytics
  • Cloud Automation
  • Cloud Object Storage
  • Cloud marketplace
  • Collaboration
  • Content Services (ECM)
  • Continuous Testing
  • Courses
  • Customer Experience Analytics
  • DB2 LUW
  • Data and AI
  • DataPower
  • Decision Optimization
  • DevOps Build
  • DevOps Services
  • Developers IBM MX
  • Digital Commerce
  • Digital Experience
  • Finance
  • Global Entrepreneur Program
  • Hadoop
  • Hybrid Cloud Core
  • Hyper Protect
  • IBM Cloud platform
  • IBM Design
  • IBM Forms Experience Builder
  • IBM Maximo Developer
  • IBM StoredIQ
  • IBM StoredIQ-Cartridges
  • IIDR
  • ITOA
  • InformationServer
  • Integration Bus
  • Internet of Things
  • Kenexa
  • Linux on Power
  • LinuxONE
  • MDM
  • Mainframe
  • Messaging
  • Node.js
  • ODM
  • Open
  • PartnerWorld Developer Support
  • PowerAI
  • PowerVC
  • Predictive Analytics
  • Product Insights
  • PureData for Analytics
  • Push
  • QRadar App Development
  • Run Book Automation
  • Search Insights
  • Security Core
  • Storage
  • Storage Core
  • Streamsdev
  • Supply Chain Business Network
  • Supply Chain Insights
  • Swift
  • UBX Capture
  • Universal Behavior Exchange
  • UrbanCode
  • WASdev
  • WSRR
  • Watson
  • Watson Campaign Automation
  • Watson Content Hub
  • Watson Marketing Insights
  • dW Answers Help
  • dW Premium
  • developerWorks Sandbox
  • developerWorks Team
  • Watson Health
  • More
  • Tags
  • Questions
  • Users
  • Badges