Hi all,

I have set up a project in Eclipse 3.1 and am using java 5.0 compiler.

Here's my folder structure in Eclipse

DFS\RemoteClient\TestClient.java

DFS is the project in Eclipse

and this is how it looks my java class

package RemoteClient;

import java.util.*;
// other imports
public class TestClient {
    public static void main(String [] args) throws ServiceInvocationException {
        // business logic here ....
    }
}

So, basically, my java class is just a simple class with a main function.

Now when I build my project, using Project->Clean...

Then I get this as an error at the very first line where i specify the package

package RemoteClient;

This is the error:

The type Class is not generic; it cannot be parameterized with arguments <T>

Can someone please comment on this, as what's this error and why am I getting this.

Thanks.

We will need more than this. Perhaps your code.

Infact there's nothing wrong with the code. I can compile/run this program from OS command prompt. But I wanted to set up a project in Eclipse. and this is where I am getting this error.

package RemoteClient;

import java.util.*;
import com.emc.documentum.fs.datamodel.core.*;
import com.emc.documentum.fs.datamodel.core.properties.*;
import com.emc.documentum.fs.datamodel.core.context.*;
import com.emc.documentum.fs.rt.ServiceInvocationException;
import com.emc.documentum.fs.rt.context.ContextFactory;
import com.emc.documentum.fs.rt.context.IServiceContext;
import com.emc.documentum.fs.rt.context.ServiceFactory;
import com.emc.documentum.fs.services.core.client.IObjectService;
import com.emc.documentum.fs.datamodel.core.content.*;
import com.emc.documentum.fs.datamodel.core.profiles.*;
import com.emc.documentum.fs.rt.context.*;
import com.emc.documentum.fs.*;


public class TestClient {


	public static void main(String [] args) throws ServiceInvocationException {

		// Set important variables
		String repositoryName = "lapdog6";
		String userName = "super_user";
		String userPassword = "pAssworD";	
		 
        try {
        	// Get a ContextFactory so that we can
        	// create a ServiceContext
    		System.out.println("Creating ContextFactory");
    		ContextFactory contextFactory = ContextFactory.getInstance();
    		
    		// Use the ContextFactory to create
    		// a ServiceContext for a service 
    		System.out.println("Creating ServiceContext");
    		IServiceContext serviceContext = contextFactory.newContext();
    		
            
    		// Create a RepositoryIdentity to store the
    		// repository credentials on the ServiceContext
    		System.out.println("Creating RepositoryIdentity");
    		RepositoryIdentity repoId = new RepositoryIdentity();
    		
    		// Populate the repository credentials
    		System.out.println("Populating RepositoryIdentity");
    		repoId.setRepositoryName(repositoryName);
    		repoId.setUserName(userName);
    		repoId.setPassword(userPassword);
    		
    		// Add the populated RepositoryIdentity to the ServiceContext
    		System.out.println("Adding RepositoryIdentity to ServiceContext");
    		serviceContext.addIdentity(repoId);
		
		// Get an ObjectService from the ServiceFactory
		IObjectService objectService = ServiceFactory.getInstance().getRemoteService(IObjectService.class, serviceContext, "core", "http://localhost:9080/services");
		  
        	// Query the repository for objects matching our criteria
		// Build object qualifications using the criteria expressed in DQL syntax
        	Qualification qualification1 = new Qualification("dm_document where object_name = 'Form_Template.xls'");
        	Qualification qualification2 = new Qualification("dm_document where object_name = 'DCTM_Environment.xls'");
        	
        	// Create ObjectIdentity objects with our DQL qualifications and repository name
        	ObjectIdentity targetObjectIdentity1 = new ObjectIdentity(qualification1, repositoryName);
        	ObjectIdentity targetObjectIdentity2 = new ObjectIdentity(qualification2, repositoryName);
        	
        	// Create an ObjectIdentitySet that contains the ObjectIdentity objects
        	ObjectIdentitySet objIdSet = new ObjectIdentitySet();
        	objIdSet.addIdentity(targetObjectIdentity1);
        	objIdSet.addIdentity(targetObjectIdentity2);
        	       	
        	// Create an empty OperationOptions object
        	OperationOptions opts = new OperationOptions();
        	
        	// Create an empty DataPackage to hold the resulting objects
        	DataPackage dataPackage = new DataPackage();
        	
        	// Create an empty PropertySet to hold the resulting object properties
        	PropertySet properties = new PropertySet();


			PropertyProfile propertyProfile = new PropertyProfile();
			propertyProfile.setFilterMode(PropertyFilterMode.SPECIFIED_BY_INCLUDE);
			ArrayList<String> includeProperties = new ArrayList<String>();
			includeProperties.add("title");
			includeProperties.add("object_name");
			includeProperties.add("r_creation_date");
			propertyProfile.setIncludeProperties(includeProperties);

			opts.setPropertyProfile(propertyProfile);


        	
        	// Execute ObjectService.get() which hopefully
        	// returns a populated DataPackage
        	dataPackage = objectService.get(objIdSet, opts);
        	
        	// Iterate through the DataObject objects in the result DataPackage
        	Iterator iterator = dataPackage.getDataObjects().iterator();   
        	
        	while(iterator.hasNext()){
        		System.out.println("######## GETTING OBJECT PROPERTIES #########");
        		DataObject thisDataObject = (DataObject) iterator.next();
        		// Write out some properties for this DataObject
        		properties = thisDataObject.getProperties();
        		System.out.println("Object Name: " + properties.get("object_name").getValueAsString());
        		System.out.println("Title: " + properties.get("title").getValueAsString());
				System.out.println("Creation Date: " + properties.get("r_creation_date").getValueAsString());
	        }
	        	
        }
        catch (Exception e)
        {
            e.printStackTrace();
            throw new RuntimeException(e);
        }	
    }	
}

the problem is with your class, it won't compile.
If you say it will compile with the Sun compiler and not the Eclipse compiler that problem is either caused by an error in the Sun compiler (extremely unlikely), an error in the Eclipse compiler (more likely), or an error in the way you've configured Eclipse (most likely of all).

Just providing us with random bits and pieces of other code isn't going to do any good in either case.

>> Just providing us with random bits and pieces of other code isn't going to do any good in either case.

Not sure what you mean by this.

>> an error in the way you've configured Eclipse (most likely of all).

That's what I am thinking. and because of that, I provided the structure of my project in eclipse in my original post. Maybe I am not using the package and folder structure properly...

Just create a new project in eclipse, create the package, and then put the file inside that folder.
Then select your project, right click on it, select properties, Java build path, select the Source tab. There Remove the source folder on build path, and then press Add Folder. Then you choose the folder where your packages will be (the classpath).
You might want to set the Default Output Folder. It will determine where your classes will be created

Thanks Addict,

I will try that, and will update this thread accordingly.

Thanks.

When I compile the program with -Xlint option, then I get the following warnings:

C:\Project>javac -Xlint custom\RemoteClient\TestClient.java
warning: [path] bad path element "C:\Program Files\Documentum\Shared\jsr173_1.0_api.jar": no such file or directory
warning: [path] bad path element "C:\Program Files\Documentum\Shared\jaxb1-impl.jar": no such file or directory
warning: [path] bad path element "C:\Program Files\Documentum\Shared\xml-apis.jar": no such file or directory
warning: [path] bad path element "C:\Program Files\Documentum\Shared\xml-apis.jar": no such file or directory
warning: [path] bad path element "C:\Program Files\Documentum\Shared\tar.jar": no such file or directory
warning: [path] bad path element "C:\Program Files\Documentum\Shared\dam_services.jar": no such file or directory
warning: [path] bad path element "C:\Program Files\Documentum\Shared\xforms.jar": no such file or directory
warning: [path] bad path element "C:\Program Files\Documentum\Shared\subscription.jar": no such file or directory
warning: [path] bad path element "C:\Program Files\Documentum\Shared\ci.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\jaxws\jsr173_1.0_api.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\jaxws\jaxb1-impl.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\jaxws\jsr173_1.0_api.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\jaxws\jaxp-api.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\jaxws\jax-qname.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\jaxws\servlet.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\jaxws\stax-utils.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\dfc\All-MB.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\dfc\activation.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\dfc\aspectjrt.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\dfc\jaxb-api.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\dfc\jaxb-impl.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\dfc\jsr173_api.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\dfc\log4j.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\dfc\serializer.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\dfc\xalan.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\dfc\xercesImpl.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\dfc\xtrim-api.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\dfc\xtrim-server.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\dfc\castor-1.1.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\dfc\xalan.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\dfc\commons-jxpath-1.2.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\dfc\bpmutil.jar": no such file or directory
warning: [path] bad path element "C:\emc-dfs-sdk-6.0\lib\java\common": no such file or directory
custom\SClient\SimpleClient.java:60: warning: [unchecked] unchecked call to Qualification(T) as a member of the raw type com.emc.documentum.fs.datamodel.core.Qualification
                Qualification qualification1 = new Qualification("dm_document where object_name = 'Form_Template.xls'");
                                               ^
custom\SClient\SimpleClient.java:61: warning: [unchecked] unchecked call to Qualification(T) as a member of the raw type com.emc.documentum.fs.datamodel.core.Qualification
                Qualification qualification2 = new Qualification("dm_document where object_name = 'DCTM_Environment.xls'");
                                               ^
custom\SClient\SimpleClient.java:64: warning: [unchecked] unchecked call to ObjectIdentity(T,java.lang.String) as a member of the raw type com.emc.documentum.fs.datamodel.core.ObjectIdentity
                ObjectIdentity targetObjectIdentity1 = new ObjectIdentity(qualification1, repositoryName);
                                                       ^
custom\SClient\SimpleClient.java:65: warning: [unchecked] unchecked call to ObjectIdentity(T,java.lang.String) as a member of the raw type com.emc.documentum.fs.datamodel.core.ObjectIdentity
                ObjectIdentity targetObjectIdentity2 = new ObjectIdentity(qualification2, repositoryName);
                                                       ^
37 warnings

C:\Project>

Make sure Eclipse "Window/Preferences/Java/Compiler/Compiler compliance settings" is set for 6.0 and reload Eclipse.
--Vic

Make sure Eclipse "Window/Preferences/Java/Compiler/Compiler compliance settings" is set for 6.0 and reload Eclipse.
--Vic

You are more than 1 year late when the problem has been solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.