unable to resolve class org.apache.commons.net.ftp in grails - grails

I am developing a module in which some file need to be uploaded on a ftp server for that I have added the "commons-net-3.3.jar" in my grails app & while using it
import org.apache.commons.net.ftp.FTP
import org.apache.commons.net.ftp.FTPClient
import org.apache.commons.net.ftp.FTPClientConfig
import org.apache.commons.net.ftp.FTPFile
import org.apache.commons.net.ftp.FTPReply
It is throwing the error unable
to resolve class org.apache.commons.net.ftp.FTPReply.
In ggts I am able to see all the classes of this package but it throw the error at runtime. What can be the possible solution for this?

In Grails you rarely add jar files to the project, you normally add dependencies. In your case you should add this line to the BuildConfig.groovy (section grails.project.dependency.resolution.plugins)
compile 'commons-net:commons-net:3.3'

Related

How to import package 'Storage' in to Swift project?

I'm currently studying the source code of Firefox-iOS app by creating my own Swift project and typing the code line by line.
In one of the source code files, it imported a packaged named Storage
But I don't think the package Storage is part of the apple API and I don't really know how I can import it.
Edit
Multiple podfiles are present in the project folder
In Swift you dont import other Swift files as they are readily available to use directly.
But you need to import another module. It looks like Storage here is a module inside the firefox-ios app workspace and hence you need to import it before using it.
I looked at the sourcecode at Github and it does contain a package named Storage.
You can read this to understand more about Modules and import statement.

Ionic 2 import ionic-plugin-keyboard not working

I'm creating an Ionic (iOS) app and having troubles importing the kayboard-plugin.
It comes from here: https://github.com/driftyco/ionic-plugin-keyboard
Why not the native keyboard plugin, because I want to use the HideKeyboardAccessoryBar functionality.
So I ran "cordova plugin add ionic-plugin-keyboard"
It was added perfectly inside the plugins folder.
Then in my app.ts file I cannot use the plugin.
I already used the following import statements:
import {Keyboard} from 'ionic-plugin-keyboard';
import {Keyboard} from 'ionic-plugin-keyboard/ionic-plugin-keyboard';
import {Keyboard} from '../plugins/ionic-plugin-keyboard/ionic-plugin-keyboard';
Then in my code I set
Keyboard.hideKeyboardAccessoryBar(false);
window.cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false);
But neither is working. always the same-like error
Error TS2307: Cannot find module 'ionic-plugin-keyboard'.
Does anybody have any experience with this one?
Adding it as a provider was added and it was ok
Check the ionic forum

grails jasypt-encryption: cannot resolve import GormEncryptedStringType

I have installed jasypt-encryption, as i believe correctly:
in my BuildConfig.groovy plugins closure:
compile ":jasypt-encryption:1.3.1"
runtime ":hibernate4:4.3.5.5"
So i have the correct jasypt version for the corresponding hibernate version.
in my Config.groovy:
jasypt {
algorithm = "PBEWITHSHA256AND256BITAES-CBC-BC"
providerName = "BC"
password = "test"
keyObtentionIterations = 1000
}
And in one of my domain classes that i need the encryption for, there is an Groovy:unable to resolve class com.bloomhealthco.jasypt.GormEncryptedStringType error:
import com.bloomhealthco.jasypt.* //ok
import com.bloomhealthco.jasypt.GormEncryptedStringType //error
So, the jasypt is imported ok, because the first import line works ok, but appears that where grails is importing from, there is no such class as GormEncryptedStringType. Is that so?
I am totally lost, i asked for help at grails irc channel, also i contacted the person to whom the official wiki pointed - dtanner.
Following his advice i downloaded the source from github and ran grails test-app in the test-jasypt folder, and all the tests passed, so, as he says, the problem should be in my project. Also in that test project the GormEncryptedStringType import works okay. Both projects are on grails 2.4.3.
A couple more ideas:
1. do a grails clean-all on your project and then try compiling/running again. This will clean out more resources than just a clean does, and re-fetch the dependencies. If this works, then there were some stale classes in your target directory.
2. I created a sample project that references the jasypt-encryption plugin like a normal project would (it's not a relative path like the test project in the plugin source is). The project is located here: https://github.com/dtanner/sample-jasypt-1-3-1-project
The changes I made to the project are:
- added the plugin reference in BuildConfig.groovy
- added the encryption configuration in Config.groovy
- added the com.foo.Bar class
- added the com.foo.BarTests integration test
If the BarTest works ok for this project, then compare this with the code that's not working and see if you can spot the difference.

Struts2 configuration failed - import failed

While doing Struts with annotations i have this problem.
The import org.apache.struts2.config.Result cannot be resolved
I can't find which library it belongs to so that i can download it.
To use annotations for declarative architecture in your Struts2 web application, you should import struts2-convention-plugin-xxx.jar which contains all the annotations available.

Jena package does not exist

Hi all I have a java program inside it I have imported these classes.
import com.hp.hpl.mesa.rdf.jena.mem.ModelMem;
import com.hp.hpl.mesa.rdf.jena.model.*;
import com.hp.hpl.mesa.rdf.jena.common.PropertyImpl;
when I'm trying to compile the program it shows 3 errors which are:
package com.hp.hpl.mesa.rdf.jena.mem does not exist import
com.hp.hpl.mesa.rdf.jena.mem.ModelMem;
package com.hp.hpl.mesa.rdf.jena.model does not exist import
com.hp.hpl.mesa.rdf.jena.model.*;
package com.hp.hpl.mesa.rdf.jena.common does not exist import
com.hp.hpl.mesa.rdf.jena.common.PropertyImpl;
I have tried to search for the jar files but I couldn't, is anyone has the link to download the jar file of those packages.
The Jena packages are under com.hp.hpl.jena.rdf…. I don't know where you got this com.hp.hpl.mesa.rdf.jena… package name from, but it's definitely wrong. Maybe you're using an obsolete example from an ancient Jena version?
There shouldn't be any reason to import ModelMem or PropertyImpl directly. If you need a ModelMem, use ModelFactory.createDefaultModel(). If you need a property instance, use model.createProperty().
You can download the Jena jars from the Jena download site.

Resources