Unmarshalling error with Karaf 4.1.2

2018-04-04 Thread rasika.upasani
Hi,

I am getting below error with Karaf 4.1.2 for wsdl file whose tags are not
present in code
Caused by: javax.xml.bind.UnmarshalException: unexpected element 

However, for same wsdl file, on Karaf 4.1.1, this error is not coming.

Are there any configuration changes which I need to do in  Karaf 4.1.2 for
toggling the strict check of tags?




--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html


Re: Using a custom JAAS LoginModule with karaf

2018-04-04 Thread Martin Nielsen
I now tried changing the blueprint to this:


http://www.osgi.org/xmlns/blueprint/v1.0.0;
   xmlns:jaas="http://karaf.apache.org/xmlns/jaas/v1.0.0;
   
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0;>












That changes the realm list command to this


karaf@root()> jaas:realm-list
Index | Realm Name | Login Module Class Name
--++
1 | karaf  | dk.netdesign.common.security.karaf.ShiroJaasIntegration


But i can still log in with karaf/karaf, and my module is STILL not
called. I do not understand this. How can i still log in through the
property module when it is no longer listed?



On Tue, Apr 3, 2018 at 6:40 PM, Martin Nielsen  wrote:

> No you understood completely. I obviously didn't though. So if i want the
> loginmodule i made to be usable through the webconsole, I must place it in
> the karaf realm, is that correct?
>
> Second question: what if i want to disable one of the current modules, for
> example the properties module?
>
> On Tue, 3 Apr 2018, 18:18 Jean-Baptiste Onofré,  wrote:
>
>> Hi,
>>
>> Maybe I don't understand what you want to do.
>>
>> You added your login module in a new realm (ShiroBridge). So, it means
>> that it
>> will be used only for applications that will use this realm.
>>
>> It's not possible to remove the karaf realm easily today as core part of
>> Karaf
>> use it (shell, MBeanServer, ...).
>>
>> So:
>> 1. If you want to use your login module in the core Karaf part (like the
>> shell
>> or ssh), then, your login module as to be in the karaf realm
>> 2. No problem to create new realms and plug third party applications
>> using this
>> realm
>>
>> Regards
>> JB
>>
>> On 04/03/2018 05:42 PM, Martin Nielsen wrote:
>> > Hello everyone
>> >
>> > I am trying to create a new karaf JAAS module and preferably override
>> the
>> > current karaf JAAS domain.
>> >
>> > I have my login module which basically just delegates everything to
>> shiro, as
>> > well as a blueprint to add it to the JAAS config.
>> >
>> > My JAAS config xml from OSGI-INF\blueprint folder in the jar:
>> >
>> > 
>> > http://www.osgi.org/xmlns/blueprint/v1.0.0
>> > "
>> >xmlns:jaas="http://karaf.apache.org/xmlns/jaas/v1.0.0
>> > "
>> >
>> >  xmlns:ext="http://aries.apache.org/blueprint/xmlns/
>> blueprint-ext/v1.0.0
>> > ">
>> >
>> >
>> > > placeholder-suffix="]"/>
>> >
>> > 
>> > > >  flags="sufficient">
>> > 
>> > 
>> >
>> > 
>> >
>> > My LoginModule:
>> >
>> > public class ShiroJaasIntegration implements LoginModule {
>> >
>> > public static final Logger LOGGER =
>> > LoggerFactory.getLogger(ShiroJaasIntegration.class);
>> > private static final Class
>> > shiroSessionClass = org.apache.shiro.session.Session.class;
>> >
>> > protected Set principals = new HashSet<>();
>> > private Subject subject;
>> > private org.apache.shiro.session.Session shiroSession;
>> > private CallbackHandler callbackHandler;
>> > private Map sharedState;
>> > private Map options;
>> > private String user;
>> > protected BundleContext bundleContext;
>> > private boolean authenticated = false;
>> >
>> > @Override
>> > public void initialize(Subject subject, CallbackHandler
>> callbackHandler,
>> > Map sharedState, Map options) {
>> > LOGGER.info("initialize "+System.identityHashCode(this));
>> > this.subject = subject;
>> > this.callbackHandler = callbackHandler;
>> > this.sharedState = sharedState;
>> > this.options = options;
>> > this.bundleContext = ((BundleReference)
>> > this.getClass().getClassLoader()).getBundle().getBundleContext();
>> > }
>> >
>> > @Override
>> > public boolean login() throws LoginException {
>> > LOGGER.debug("login "+System.identityHashCode(this));
>> > if (callbackHandler == null) {
>> > throw new LoginException("No CallbackHandler found");
>> > }
>> >
>> > Callback[] callbacks = new Callback[2];
>> >
>> > callbacks[0] = new NameCallback("Username: ");
>> > callbacks[1] = new PasswordCallback("Password: ", false);
>> > if (callbackHandler != null) {
>> > try {
>> > callbackHandler.handle(callbacks);
>> > } catch (IOException ioe) {
>> > throw new LoginException(ioe.getMessage());
>> > } catch (UnsupportedCallbackException uce) {
>> > throw new LoginException(uce.getMessage() + " not
>> available to
>> > obtain information from user");
>> > }
>> > }
>> >
>> > // user callback get value