Building Scala with SBT having issues

ericnord
Posts: 4
Joined: Wed Dec 09, 2015 8:37 pm

Building Scala with SBT having issues

Postby ericnord » Thu Mar 16, 2017 4:16 pm

Hi,

I've been using an older version of the Java Jar in my Scala project without issues, but recently I've updated to the latest Java Jar and switched all my references from sourceforge and now I'm getting issues when building a fat jar with SBT. The error is:
2017-03-16 10:00:11,980 ERR GeneralWURFLEngine cannot initialize: java.lang.NullPointerException
java.lang.NullPointerException: null
at com.scientiamobile.wurfl.core.resource.XmlFileLoader.parseFile(XmlFileLoader.java:42)
at com.scientiamobile.wurfl.core.DefaultWURFLService.<init>(DefaultWURFLService.java:117)
at com.scientiamobile.wurfl.core.DefaultWURFLService.<init>(DefaultWURFLService.java:144)
at com.scientiamobile.wurfl.core.GeneralWURFLEngine.init(GeneralWURFLEngine.java:460)
at com.scientiamobile.wurfl.core.GeneralWURFLEngine.initIfNeeded(GeneralWURFLEngine.java:390)
at com.scientiamobile.wurfl.core.GeneralWURFLEngine.getDeviceForRequest(GeneralWURFLEngine.java:544)

SBT run has zero problems, but once I build the assembly it builds the jar fine, but then throws that error when I try to lookup a device. I'm a pretty big novice in scala so any help would be appreciated. Would switching to the scala specific build fix my issues? or is it a build.sbt issue?

Thanks!
Eric

aaronp
Posts: 236
Joined: Wed Dec 09, 2015 12:39 pm

Re: Building Scala with SBT having issues

Postby aaronp » Thu Mar 16, 2017 4:34 pm

Hi,

Thank you for providing the information. We will take a look into the issue and check back in with you as soon as there is an update. In the meantime, are you able to verify the date of your WURFL.xml?

Also, if it turns out that switching to the Scala OnSite API is the most optimal choice here, I will surely reach out to your account manager and get you in touch.

Thanks,

Aaron

ericnord
Posts: 4
Joined: Wed Dec 09, 2015 8:37 pm

Re: Building Scala with SBT having issues

Postby ericnord » Thu Mar 16, 2017 4:52 pm

Right now I'm using the wurfl file that ships with the jar file just for testing: for WURFL API 1.8.3.0 - evaluation, db.scientiamobile.com - 2017-01-24 10:12:02.

aaronp
Posts: 236
Joined: Wed Dec 09, 2015 12:39 pm

Re: Building Scala with SBT having issues

Postby aaronp » Thu Mar 16, 2017 5:05 pm

Hi Eric,

Thanks for the follow up. If you have access to your primary licensed account (davestewartcake), you can download the full licensed copy of the Java OnSite API (v1.8.3.2), along with the full WURFL.xml file. If you are able to test using the full fledged versions, please give it a try and let me know how it goes.

Regards,

Aaron

ericnord
Posts: 4
Joined: Wed Dec 09, 2015 8:37 pm

Re: Building Scala with SBT having issues

Postby ericnord » Fri Mar 17, 2017 5:24 pm

Thanks for your help and your speedy replies. I figured out the issue was the way my code was structured. Fixing it fixed my issues with the fat jar. Thanks again!

aaronp
Posts: 236
Joined: Wed Dec 09, 2015 12:39 pm

Re: Building Scala with SBT having issues

Postby aaronp » Fri Mar 17, 2017 5:31 pm

Glad to hear everything worked out! For future references, please feel free to reach out to us at support@scientiamobile.com

Thanks,

Aaron


Who is online

Users browsing this forum: No registered users and 1 guest