Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Bhavik Kama
build failed package can't be resolved to type Error while Service build?
1 marzo 2013 23.38
Risposta

Bhavik Kama

Punteggio: Junior Member

Messaggi: 55

Data di Iscrizione: 23 settembre 2012

Messaggi recenti

i am using custom portlet in liferay 6.1 now my problem is i have created one custom class as follows...

 1import java.util.List;
 2
 3import  com.liferay.portal.model.Organization;
 4import com.liferay.portal.service.OrganizationLocalServiceUtil;
 5public class OrganizationDetails {
 6    private int  organizationinfoId;
 7    public int getOrganizationinfoId() {
 8        return organizationinfoId;
 9    }
10    public void setOrganizationinfoId(int organizationinfoId) {
11        this.organizationinfoId = organizationinfoId;
12    }
13    public String getLicense() {
14        return license;
15    }
16    public void setLicense(String license) {
17        this.license = license;
18    }
19    public Organization getOrganizationData() {
20        return organizationData;
21    }
22    public void setOrganizationData(Organization organization) {
23        this.organizationData.setOrganizationId(organization.getOrganizationId());
24        this.organizationData.setParentOrganizationId(organization.getParentOrganizationId());
25       
26    }
27    private String license;
28    public Organization organizationData ;
29   
30
31}


Now i had wrote one function to my LicenseLocalServiceImpl class which returns the object of above OrganizationDetails Class
write now just for test i have just defined the method in LicenseLocalServiceImpl which just return null

1public OrganizationDetails  getAllDataFromOrganizationDetails(){
2return null;
3}



now while building the service with the servicebuilder...i got following error..

 1\LicenseLocalService.java (at line 250)
 2    [javac]     public com.test.organization.OrganizationDetails getAllDataFromOrganizationDetails();
 3    [javac]            ^^^^^^^^
 4    [javac] com.test cannot be resolved to a type
 5    [javac] ----------
 6    [javac] ----------
 7    [javac] 2. ERROR in D:\Anupa\liferay-plugins-sdk-6.1.1\portlets\eMenuLMS-portlet\docroot\WEB-INF\service\com\eMenuLMS\service\LicenseLocalServiceClp.java (at line 778)
 8    [javac]     public com.test.organization.OrganizationDetails getAllDataFromOrganizationDetails() {
 9    [javac]            ^^^^^^^^
10    [javac] com.test cannot be resolved to a type
11    [javac] ----------
12    [javac] 3. ERROR in D:\Anupa\liferay-plugins-sdk-6.1.1\portlets\eMenuLMS-portlet\docroot\WEB-INF\service\com\eMenuLMS\service\LicenseLocalServiceClp.java (at line 797)
13    [javac]     return (com.test.organization.OrganizationDetails)ClpSerializer.translateOutput(returnObj);
14    [javac]             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15    [javac] com.test.organization.OrganizationDetails cannot be resolved to a type
16    [javac] ----------
17    [javac] ----------
18    [javac] 4. ERROR in D:\Anupa\liferay-plugins-sdk-6.1.1\portlets\eMenuLMS-portlet\docroot\WEB-INF\service\com\eMenuLMS\service\LicenseLocalServiceUtil.java (at line 280)
19    [javac]     public static com.test.organization.OrganizationDetails getAllDataFromOrganizationDetails() {
20    [javac]                   ^^^^^^^^
21    [javac] com.test cannot be resolved to a type
22    [javac] ----------
23    [javac] 5. ERROR in D:\Anupa\liferay-plugins-sdk-6.1.1\portlets\eMenuLMS-portlet\docroot\WEB-INF\service\com\eMenuLMS\service\LicenseLocalServiceUtil.java (at line 281)
24    [javac]     return getService().getAllDataFromOrganizationDetails();
25    [javac]                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26    [javac] The method getAllDataFromOrganizationDetails() from the type LicenseLocalService refers to the missing type OrganizationDetails
27    [javac] ----------
28    [javac] ----------
29    [javac] 6. ERROR in D:\Anupa\liferay-plugins-sdk-6.1.1\portlets\eMenuLMS-portlet\docroot\WEB-INF\service\com\eMenuLMS\service\LicenseLocalServiceWrapper.java (at line 272)
30    [javac]     public com.test.organization.OrganizationDetails getAllDataFromOrganizationDetails() {
31    [javac]            ^^^^^^^^
32    [javac] com.test cannot be resolved to a type
33    [javac] ----------
34    [javac] 7. ERROR in D:\Anupa\liferay-plugins-sdk-6.1.1\portlets\eMenuLMS-portlet\docroot\WEB-INF\service\com\eMenuLMS\service\LicenseLocalServiceWrapper.java (at line 273)
35    [javac]     return _licenseLocalService.getAllDataFromOrganizationDetails();
36    [javac]                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37    [javac] The method getAllDataFromOrganizationDetails() from the type LicenseLocalService refers to the missing type OrganizationDetails
38    [javac] ----------
39    [javac] 7 problems (7 errors)


Can Anyone please Help me that How can i Resolve this Error..???
David H Nebinger
RE: build failed package can't be resolved to type Error while Service buil
4 marzo 2013 5.59
Risposta

David H Nebinger

Community Moderator

Punteggio: Liferay Legend

Messaggi: 11793

Data di Iscrizione: 1 settembre 2006

Messaggi recenti

SB can only return primitives (and their object siblings), vanilla collections, and entities. Or as an extreme case, any type that is available from the global class path.

Your class, OrganizationalDetails, is none of these and therefore you cannot instantiate, pass, or use this class in SB code.

My recommendation? Define OrganizationalDetails as an entity that is not bound to the database, as in the posting here: http://www.liferay.com/community/forums/-/message_boards/message/12095602
Bhavik Kama
RE: build failed package can't be resolved to type Error while Service buil
5 marzo 2013 5.36
Risposta

Bhavik Kama

Punteggio: Junior Member

Messaggi: 55

Data di Iscrizione: 23 settembre 2012

Messaggi recenti

David H Nebinger:
SB can only return primitives (and their object siblings), vanilla collections, and entities. Or as an extreme case, any type that is available from the global class path.

Your class, OrganizationalDetails, is none of these and therefore you cannot instantiate, pass, or use this class in SB code.

My recommendation? Define OrganizationalDetails as an entity that is not bound to the database, as in the posting here: http://www.liferay.com/community/forums/-/message_boards/message/12095602



Thanks...i got your point..i have same thing in my mind..but was not sure..thanks for your answer...
Miguel Pereira
RE: build failed package can't be resolved to type Error while Service buil
14 marzo 2014 13.05
Risposta

Miguel Pereira

Punteggio: New Member

Messaggi: 4

Data di Iscrizione: 14 gennaio 2014

Messaggi recenti

David H Nebinger:
SB can only return primitives (and their object siblings), vanilla collections, and entities. Or as an extreme case, any type that is available from the global class path.

Your class, OrganizationalDetails, is none of these and therefore you cannot instantiate, pass, or use this class in SB code.


Is it also not possible to pass parameters that are not primatives or on the global class path? My goal is to consolidate the common query code that is currently duplicated across many Impl classes.
David H Nebinger
RE: build failed package can't be resolved to type Error while Service buil
14 marzo 2014 15.51
Risposta

David H Nebinger

Community Moderator

Punteggio: Liferay Legend

Messaggi: 11793

Data di Iscrizione: 1 settembre 2006

Messaggi recenti

Same restrictions, primitives (their object counterparts), entities, or collections of the previous. Anything on the global classpath is also okay, although these are a pain because updating the jars requires an app container restart.