No bean name is defined when run liferay portlet - exception

I am developing portlet, There are two portlet, one is manageorganization and another is employee. I am using service of employee on manageorganization and vice varsa. There is no problem while using methods of employee service using service.jar file of employee. But Now I am facing one problem is that Any method of manageorganization which are defined on localserviceimpl using localserviceutil.
Error: com.liferay.portal.kernel.bean.BeanLocatorException: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'com.lftechnology.serviceexampledemo.service.SmallBusinessLocalService' is defined
12:20:22,161 ERROR [ManageOrganizationController:46] Error while using method of serviceutil.
Code on my controller:
List<SmallBusiness> listOfSb = SmallBusinessLocalServiceUtil.getListofSB();
I went through a couple of blogs on google, but can't find the solution.
Thanks.

Related

TypeError at /edit-student/2/ Edit_Student.get() got an unexpected keyword argument '_id'

I have created a small crud based student management project in Django, I have successfully created add and delete functions. I have also created edit functions, but I am getting the above error when I click to edit those details.

How to use the ABAP namespace /ABC/ in the custom SAPUI5 application?

I am new to the SAPUi5 things. I am developing a custom Fiori application using using SAP Web IDE. I Manually deploy the application to the system using report /UI5/UI5_REPOSITORY_LOAD.
Initially I used the project name in the Web IDE with name 'ZAPP' and gave the same name while deploying the app to ABAP system. Everything worked fine.
Now, I have a requirement where I need to use the namespace in the project name e.g. '/ABC/APP'. How do I achieve this?
PS: I have tried deploying the ZAPP and replaced all the occurrences of 'ZAPP' with '/ABC/APP', but it gives me a following error:
Uncaught Error: The provided argument '/ABC/APP' may not start with a slash
at toUrl (ui5loader-dbg.js:1994:10)
at r.toUrl (ui5loader-dbg.js:1979:11)
at e._applyManifest (ComponentMetadata-dbg.js:173:13)
at e.getManifestObject (ComponentMetadata-dbg.js:315:5)
at e.init (ComponentMetadata-dbg.js:192:4)
at p._initCompositeSupport (Component-dbg.js:626:4)
at ManagedObject-dbg.js:534:11
at f.constructor (ManagedObject-dbg.js:558:4)
at f.constructor (Component-dbg.js:293:17)
at f.constructor (UIComponent-dbg.js:81:14)
Any help in this regard would be really appreated :-)

Repository uses N1QL

I'm getting the following exception:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'answerRepository': Invocation of init method failed; nested exception is org.springframework.data.couchbase.core.UnsupportedCouchbaseFeatureException: Repository uses N1QL
I'm using Spring 4.2.0.RELEASE with spring-data-couchbase 2.0.0.M1 against Couchbase 2.5.1 enterprise edition (build-1083)
I can't see any explanation in the doc for this error.
Here is the repository:
public interface AnswerRepository extends BaseRepository<Answer, String> {
final static String DESIGN_DOCUMENT = "answers";
#View(viewName = "answers_by_quizId_startTime", designDocument = DESIGN_DOCUMENT)
public List<Answer> findByQuizIdAndStartTime(String quizId, long startTime);
Answer findByUuid(String uuid);
}
#NoRepositoryBean
public interface BaseRepository<T, ID extends Serializable> extends CrudRepository<T, ID> {
}
Maybe my Couchbase server does not support this feature, whereas my repository expects it.
I might need to code my repository differently.
It's too bad it doesn't say which method is the invalid one here.
Or it is my using of the CrudRepository in the base class ?
I wonder how to find out which views it expects to find in my Couchbase server.
Repositories in Spring Data Couchbase 2.0 rely almost exclusively on Views and N1QL. A good chunk of the new features in this version are made possible by N1QL, which is now the default mechanism Spring Data uses for things like "query derivation" (implementing a repository method by producing some sort of query that is derived from the method name).
Couchbase Server 2.5.1 doesn't have access to N1QL (which came with Couchbase Server 4.0 and of course also in the brand new 4.1 version).
If you want Spring Data to implement findByUuid for you, you'll have to annotate that method with #View and create the appropriate view that emits uuids from your Answer documents.
View query derivations are heavily restricted and give you more work since you have to write the correct map function:
a repository method based on a view can only query with one criteria.
you have to create your view correctly, emitting the correct keys corresponding to the criteria you'll query with.
you have to create one view per entity class, restricting the view to only emit if the "_class" field in the JSON matches said entity (note: this field can be renamed in the configuration so make sure to use the relevant one).
So that means that your findByQuizIdAndStartTime cannot work either. You may have to implement this (and maybe findByUuid) in the BaseRepository, relying on the CouchbaseTemplate and using its findByView method (or even queryView as a last resort).
The UnsupportedCouchbaseFeatureException is mentioned in the M1 doc chapter 7 (on N1QL based querying).
See also the section on view query derivation further down the documentation.

To many EntityCollections in Entity raise "implement IConvertible" exception in RIA Services

I have a Entity object create with the Entity Framework and used in Silverlight with the RIA Services framework.
The Entity in question has two EntityCollections which are included in the IQueriable sent to the client.
The Entity looks like this:
public class Ad:Entity
{
[Include]
public EntityCollection<PublishingDates> PublishingDates {get;set;}
[Include]
public EntityCollection<Notice> Notice {get;set;}
}
The domain service method includes both collection using Include as this:
[Query]
public IQueryable<Ad> GetAds()
{
return this.ObjectContext.Ad.Include("PublishingDates").Include("Notice");
}
On the client side when the service is called and the result returned the following exception was raise : "The object must implement IConvertible".
If only one EntityCollection is included everything works fine. If both, the previously mentioned exception is raise.
[EDIT]
I use MySQL with MySQL Net Connector version 6.3.5. as the database.
I think its a bug in Net Connector, a very similar bug was reported here http://bugs.mysql.com/bug.php?id=55349
EDIT:
Im not sure this applies to your specific case but for me the latest community server (5.5.9) works a lot better. Note that this is the db not .net connector, which seems not to be involved in the errors I got.
I have the same problem now. The interesting thing is my query works excellent with linux-driven Mysql instance but doesn't work on Windows. May be you will succeed moving to Linux

Login failed for user 'username' - System.Data.SqlClient.SqlException with LINQ in external project / class library

This might seem obvious but I've had this error when trying to use LINQ to SQL with my business logic in a separate class library project.
I've created the DBML in a class library, with all my business logic and custom controls in this project. I'd referenced the class library from my web project and attempted to use it directly from the web project.
The error indicated the login failed for my user name. My user name and password were correct, but the fix was to copy my connection string to the correct location. I've learned the issue from another site and thought I would make a note here.
Error:
Login failed for user 'username'
System.Data.SqlClient.SqlException
The LINQ designer ads the connection string to the app.config of the class library, but the web site needed to see it in the web.config of the web project. Once copied across all was well.
you can pass in a connection or connection string to the data context as well.