How to use kernal in ServiceStack version="4.0.36" - servicestack

I want to use StandardKernel object in my IOC container for that I downloaded “ServiceStack.ContainerAdapter.Ninject”. this Ninject is dependency with ServiceStack.Common (≤ 3.9.59) but I AM using the latest version of ServiceStack version="4.0.36".
Can anyone suggest me how to use kernel in ServiceStack version="4.0.36".
IKernel kernel = new StandardKernel

According to the package's nuGet page , this package has a dependency on ServiceStack 3.9.59 and below. It doesn't appear to currently support the 4.x version of ServiceStack.
Looks like the code is hosted on github. You could contact the author and ask him about supporting 4.x or you could fork it, make it compatible with 4.x and then submit a pull request.

Related

Frontend users with Bolt 4

I moved to Bolt 4 (from Bolt 3.7) and would like to implement front-end user to give them access to private contents of the website. Previously, I used the extension BoltAuth/Auth, which worked like a charm.
Now in Bolt 4, there is no easy way like in Bolt 3.x to install an extension from the back-end page. I found out I could use composer to do so, but I run in the following problem:
> composer require "boltauth/auth:3.0.1"
[InvalidArgumentException]
Could not find a matching version of package boltauth/auth. Check the package
spelling, your version constraint and that the package is available in a stability
which matches your minimum-stability (stable).
Either I do something wrong, or the extension is not compatible with Bolt 4.1.
Could someone tell me if there is a way to make this extension work? Or alternatives for front-end user management?
EDIT: I'm now using the bolt/users extension as it can be used to add a ROLE_MEMBERS and let users login for the frontend.
Yes, unfortunately the architecture for plugins (mainly driven by the move from Silex to Symfony) changed completely between 3.x and 4.x and it's not really feasible to release new 4.x compatible versions.
So for now there won't likely be updates to BoltAuth. It may be worth joining the Slack community and seeing if any other developers are working on 4.x compatible solutions to the client login scenarios.

Get the latest version of a node package in Nexus

We are working on a Node and Angular 5 project in which we are using Nexus as a repository of our application. This application is transpiled, packaged and uploaded to the Nexus repository. Then we have created a pipe in Jenkins that downloads the latest version of the application from Nexus and executes it. But now we are having a problem. There is no call to the Nexus API to return the path to the latest version of a node package (generated by npm publish).
The call we are making is the following:
http://HOST-NEXUS/service/rest/v1/search?repository=my-repository&name=my-node-project
But it has a problem: this call only returns the first 50 versions. If you already have more than 50 versions of the application in the repository, it does not return the last ones.
So I was wondering would you know any way to extend this limit of 50 versions? Or better yet, do you know how to get the latest version directly? Something like this (this example doesn't work in Node, but it does work in Maven):
http://HOST-NEXUS/service/rest/v1/search?repository=my-repository&name=my-node-project&version=LATEST
Thanks and best regards.
Support for "latest" download via REST was added to NXRM3 in version 3.16.0. See the JIRA ticket for more information.
An example of provided on the release blog but probably will depend on your repository, format and what you're trying to fetch. There is also a Swagger UI provided for REST in NXRM3 that can be used to form your own statements. It can be accessed in the administration section under System -> API. Sonatype's REST documentation may also help.
Api document: {nexus_url}/service/rest/swagger.json
GET {nexus_url}/service/rest/v1/search?name=project-name&sort=version

Hazelcast exception with hazelcast-hibernate5

I am using Hibernate OGM 5.1.0.Final and hazelcast-hibernate5 1.1.3 ( even checked with 1.2 ). The OGM compatible hibernate ORM dependency is 5.1.5 , which is present in POM.
Caused by: java.lang.IncompatibleClassChangeError: Expected static method org.hibernate.cache.internal.DefaultCacheKeysFactory.createEntityKey(Ljava/lang/Object;Lorg/hibernate/persister/entity/EntityPersister;Lorg/hibernate/engine/spi/SessionFactoryIm
at com.hazelcast.hibernate.region.EntityRegionAccessStrategyAdapter.generateCacheKey(EntityRegionAccessStrategyAdapter.java:66)
at org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:198)
at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:125)
at org.hibernate.ogm.loader.impl.OgmLoader.initializeEntitiesAndCollections(OgmLoader.java:807)
at org.hibernate.ogm.loader.impl.OgmLoader.doQuery(OgmLoader.java:393)
at org.hibernate.ogm.loader.impl.OgmLoader.doQueryAndInitializeNonLazyCollections(OgmLoader.java:283)
at org.hibernate.ogm.loader.impl.OgmLoader.loadEntity(OgmLoader.java:201)
at org.hibernate.ogm.loader.impl.OgmLoader.loadEntitiesFromTuples(OgmLoader.java:220)
at org.hibernate.ogm.loader.entity.impl.DynamicBatchingEntityLoaderBuilder$DynamicBatchingEntityLoader.loadEntitiesFromTuples(DynamicBatchingEntityLoaderBuilder.java:127)
at org.hibernate.ogm.query.impl.OgmQueryLoader.listOfEntities(OgmQueryLoader.java:92)
at org.hibernate.ogm.query.impl.OgmQueryLoader.list(OgmQueryLoader.java:78)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:501)
at org.hibernate.ogm.query.impl.OgmQueryTranslator.list(OgmQueryTranslator.java:129)
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1339)
at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87)
at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606)
at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:483)
at com.olp.jpa.common.AbstractRepositoryImpl.findAll(AbstractRepositoryImpl.java:137)
The issue looked similar to the one reported here - https://github.com/hazelcast/hazelcast-hibernate5/issues/13 , however I cannot upgrade ORM to 5.2, since it is not supported by OGM yet. Please suggest if there is a solution/workaround for the issue.
Version 1.1.3 and 1.2 of hazelcast-hibernate5 depend on Hibernate version 5.0.9.Final. You might need to exclude that in your Maven configuration and declare Hibernate dependency with version 5.1.5 yourself.
Update
It seems hazelcast-hibernate5 doesn't support Hibernate 5.1.5. So I have modified hazelcast-hibernate5 code to support Hibernate 5.1.5 and released a custom version which can be found here. Note that this is not available on Maven central and it's not an official release of the plugin, just a quick change to support Hibernate 5.1.5 for your use case. It means that you have to install it to your local Maven repository first (or embed the JAR directly to your project). You can see the changes I have made in this branch to examine the code, or build from the source yourself.

Servicestack - run built-in clients on the .net client profile framework

Is it possible to run servicestack's built-in clients on the .net client profile framework?
When i change the target framework property in the project settings to ".Net Framework Client Profile" and try to compile i get the following message: the namespace ServiceClient does not exist in the namespace servicestack.
We use servicestack services to send exception reports. We use the JsonServiceClient and feel really comfortable with it. We could change the target framework - but then we have to check all installations for the availability of the full .net framework.
Any idea how to solve this?
Thanks.
From the package contents of the latest ServiceStack.Common package there seems to be no -client version included (See Common Framework and Profile Targeting Examples under NuGet - Creating and Publishing a Package).
You should either change the target framework the full profile or pull the code from ServiceStack's GitHub Repo and try to build it for client profile yourself. The downside of this is that you will loose Nuget's awesome update features...
You could off course file an issue at GitHub for the guys maintaining ServiceStack to add a client profile version of the framework, but I guess that there's a good reason for why it's not there already.

Where is ServiceStack.Data.SqlMapper.QueryMultiple and ServiceStack.Data.DynamicParameters

I recently upgraded ServiceStack related libraries (specially ServiceStack 2.9.25), and with previous releases we had ServiceStack.Data namespace and we were using ServiceStack.Data.DynamicParameter class and IDbConnection extension methods such as Execute and QueryMultiple. But in latest version we don't have this namespace so as the above classes and methods. Are these moved to somewhere else and any alternative classes/methods to use?
SqlMapper / Dapper has now moved to ServiceStack.Razor.Dapper namespace which is in the ServiceStack.Razor project.

Resources