MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
edross
Post subject: Very simple example  PostPosted: May 02, 2012 - 12:09 PM
Registered Member
Registered Member


Joined: Oct 24, 2004
Posts: 77

Create a new project
create a simple class

Code:
package com.junk.model;

import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Queue;
import javax.jms.QueueBrowser;
import javax.jms.Session;
import javax.jms.TextMessage;
public class MyClass {
   
   ConnectionFactory cf;
   JMSException ex;
   Message msg;
   Queue q;
   QueueBrowser qb;
   Session ses;
   TextMessage tm;
   

}




create a simple pom.xml

Code:

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>TestClasspath</groupId>
  <artifactId>TestClasspath</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>
  <name></name>
  <description></description>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencies>
 
  <dependency>
            <groupId>com.bea.weblogic</groupId>
            <artifactId>weblogic</artifactId>
            <version>10.3</version>
            <scope>system</scope>
            <systemPath>C:/development/software/bea/bea10.3.2/wlserver_10.3/server/lib/weblogic.jar</systemPath>
         </dependency>
   
  </dependencies>
  <build>
    <sourceDirectory>${basedir}/src</sourceDirectory>
    <outputDirectory>${basedir}/target/classes</outputDirectory>
    <resources>
      <resource>
        <directory>${basedir}/src</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
   
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>



From eclipse - will not work
from command line will work

Now - from the command line mvn eclipse:eclipse

look at the classpath

from eclipse - update project configuration

look at the classpath
 
 View user's profile Send private message  
Reply with quote Back to top
support-tony
Post subject:   PostPosted: May 03, 2012 - 11:02 AM



Joined: Mar 09, 2011
Posts: 915

Ed,

Thanks for your patience. I've now managed to replicate this second error.

The confusion for me was that maven was not actually adding those extra jar files (in weblogic.jar's manifest classpath) to its classpath. However, it is the java compiler which is actually making use of the manifest classpath implicitly.

What is happening is that "mvn eclipse:eclipse" is creating a .classpath file entry for weblogic.jar directly. This gets picked up properly by the eclipse java validator, so you can see all of the related jars in the Package Explorer, under "Referenced Libraries". I couldn't actually see these extra jars in the project's build path, so I assume that your screenshot showing those jars in the build path was from an earlier release of eclipse, with later releases now changing that.

When "Update Project Configuration" is run, this remakes the project's classpath and replaces the previous weblogic.jar (and probably other jars for other dependencies) with a special container that checks the maven dependencies, with the aim of automatically picking up any dependency changes in the pom.

Unfortunately, that type of container in the classpath does not seem to behave in the same way as jar files, with respect to the eclipse Java validator, and so classes that aren't directly in weblogic.jar aren't seen. This is the same with the latest m2eclipse plug-in for regular eclipse.

I have raised a bug report for this and we may get a fix into the next release (10.5) but that can't be guaranteed as we don't know, yet, how difficult this is to fix.

I notice that this bug (and the previous Overlay bug) doesn't affect the maven build, which can be run from MyEclipse.

Sorry for the inconvenience.

_________________
Tony
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
edross
Post subject: maven builds  PostPosted: May 03, 2012 - 11:57 AM
Registered Member
Registered Member


Joined: Oct 24, 2004
Posts: 77

you are correct - you can run the build, both from maven and the command line. however It is somewhat useless as eclipse show hundreds of errors in our environment, context assist will not work, and projects will not build from within eclipse.

We had used the nexus eclipse plugin before (version 8.6) but that does not seem to be available any longer.

At this time, the bug is keeping us from upgrading to 10.1. Seems ironic that a tool that was to save time has taken so much of it and become the limiting item in development.

BTW - editorial comment about maven. I have tried to upgrade our build system to gradle. However, it suffers from the same classpath issues. I will be moving OFF maven if/when gradle matures. Maven has been a huge problem in our organization causing more problems than it fixed. We have spent weeks working around the ridged structure maven imposes.
 
 View user's profile Send private message  
Reply with quote Back to top
support-tony
Post subject:   PostPosted: May 03, 2012 - 12:07 PM



Joined: Mar 09, 2011
Posts: 915

Ed,

Sorry about the problems. You're right, they are greater than I thought. I will try to ensure that the issue is addressed ASAP and see if development have any suggestions, in the meantime.

_________________
Tony
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
edross
Post subject: has there been any word on this?  PostPosted: May 15, 2012 - 01:55 PM
Registered Member
Registered Member


Joined: Oct 24, 2004
Posts: 77

you were going to ask the developers if there was any work-arounds. Are there any fixes, or changes that I can make to try and build our project?
 
 View user's profile Send private message  
Reply with quote Back to top
support-tony
Post subject:   PostPosted: May 16, 2012 - 04:36 AM



Joined: Mar 09, 2011
Posts: 915

Ed,

Yes, I had a long discussion with the lead developer and there doesn't seem to be a satisfactory workaround. The bug has a high priority for fixing in the next update which may be only a few weeks away (that's a very rough estimate). However, without a fix, it's difficult to see a way round it that is fairly painless. The mvn eclipse:myeclipse command effectively adds each dependency to the classpath directly and you should not see any java errors. So the workaround is to effectively add all the dependencies to the classpath and remove the maven dependency container (via mvn eclipse:myeclipse or manually) but you'd have to avoid running the update project configuration function. If you don't change maven dependencies then this is an option for you.

Unfortunately, you can't just add weblogic.jar to the classpath because the maven dependency container is always searched first, so the extra weblogic.jar file will never be seen.

_________________
Tony
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
support-tony
Post subject:   PostPosted: Jun 04, 2012 - 11:01 AM



Joined: Mar 09, 2011
Posts: 915

Ed,

Just to let you know that both of the problems you reported here will be fixed in the 10.5 release which is due out within a couple of weeks. The use of the manifest will be controlled by a MyEclipse workspace preference.

_________________
Tony
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits