You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Amir Gheibi <ag...@fmep.ag.gov.bc.ca> on 2012/07/11 19:38:16 UTC

Dependency entry changes runtime

Hi,

I have a project in which a module, say "A",  has a runtime dependency (not required during compile) to another module ("B").
Without explicitly adding the dependency to A's POM file it compiles (everything is passed to A as "object"). But during runtime it won't find "B". Even though it exists. But if I add the dependency tag to A's POM file (with "provided" scope) and compile again, it'll find "B" during runtime.

Runtime environment is a "Weblogic 10.3.3" in which "B" is registered as an Optional Package (Library) and there is an extension entry in A's MANIFEST that refers to it (that's how A finds B in runtime).

I compared A's JAR file in both scenarios and I don't see any difference whatsoever except the POM file within the Maven directory, which as far as I understand, doesn't have any effect on runtime.

Why would the dependency entry change runtime behavior?

Thanks,
Amir

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Dependency entry changes runtime

Posted by Ron Wheeler <rw...@artifact-software.com>.
I would check to make sure that the version used at run time matches (or 
is more recent) than the version used at compile time.
It looks like somebody is calling somebody with an argument of a type 
that the called method does not expect and can not map to anything that 
it knows.
Perhaps the version provided at run-time is older than the one used at 
compile time.

I could be wrong but that is something that can happen with provided 
libraries.

Ron


On 12/07/2012 8:37 AM, Pimentel, Robert wrote:
> Just out of curiosity, why are you using provided, or optional, and not runtime scope?
>
> -----Original Message-----
> From: Amir Gheibi [mailto:agheibi@fmep.ag.gov.bc.ca]
> Sent: Wednesday, July 11, 2012 5:04 PM
> To: Maven Users List
> Subject: RE: Dependency entry changes runtime
>
> Thanks mate. Still Identical MANIFEST(!) and when I compared the JARs with a tool (BeyondCompare) I could only see one difference which is maven directory under META-INF directory.
>
> Now that I think again, the problem is not that the class is not found. The error says "java.lang.IllegalArgumentException: Object: com.xxx.entities.XyzEntity@3a18c1 is not a known entity type" which is coming from EclipseLink in WebLogic.
>
> But I wonder why  making a trivial change (as it seems) in POM file should make this behave differently. I gotta be an issue in JPA. So out of this list's scope.
>
>
>
> -----Original Message-----
> From: Wayne Fay [mailto:waynefay@gmail.com]
> Sent: July-11-12 12:33 PM
> To: Maven Users List
> Subject: Re: Dependency entry changes runtime
>
> OK so back up.
>
> First, leave the dependency out of A and run "mvn clean package". Set that jar file aside (rename it and move it out of target or clean will remove it.)
>
> Now add the dependency and run "mvn clean package". Set that jar file aside like you did before.
>
> Now use some tool to unzip both and compare the contents. Surely there is a difference you simply have not accounted for yet.
>
> Wayne
>
> On Wed, Jul 11, 2012 at 1:34 PM, Amir Gheibi <ag...@fmep.ag.gov.bc.ca> wrote:
>> Here is A's Manifest entry which as I mentioned, is identical in both scenarios.
>>
>> Manifest-Version: 1.0
>> Built-By: bm03043
>> Build-Jdk: 1.6.0_18
>> Created-By: Apache Maven 3.0.4
>> Archiver-Version: Plexus Archiver
>> Extension-List: entities
>> entities-Extension-Name: com.xxx.entities
>>
>> -----Original Message-----
>> From: Wayne Fay [mailto:waynefay@gmail.com]
>> Sent: July-11-12 11:13 AM
>> To: Maven Users List
>> Subject: Re: Dependency entry changes runtime
>>
>>> Runtime environment is a "Weblogic 10.3.3" in which "B" is registered as an Optional Package (Library) and there is an extension entry in A's MANIFEST that refers to it (that's how A finds B in runtime).
>>>
>>> I compared A's JAR file in both scenarios and I don't see any difference whatsoever except the POM file within the Maven directory, which as far as I understand, doesn't have any effect on runtime.
>>>
>>> Why would the dependency entry change runtime behavior?
>> Didn't you already answer your own question? The answer is the
>> MANIFEST entry. If you check, the MANIFEST entry will (should) only
>> appear when the dependency is added with runtime scope.
>>
>> Wayne
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> B�KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB��[��X��ܚX�KK[XZ[
> �\�\��][��X��ܚX�PX]�[��\X�K�ܙ�B��܈Y][ۘ[��[X[��K[XZ[
> �\�\��Z[X]�[��\X�K�ܙ�B
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Dependency entry changes runtime

Posted by "Pimentel, Robert" <Ro...@tgslc.org>.
Just out of curiosity, why are you using provided, or optional, and not runtime scope?

-----Original Message-----
From: Amir Gheibi [mailto:agheibi@fmep.ag.gov.bc.ca] 
Sent: Wednesday, July 11, 2012 5:04 PM
To: Maven Users List
Subject: RE: Dependency entry changes runtime

Thanks mate. Still Identical MANIFEST(!) and when I compared the JARs with a tool (BeyondCompare) I could only see one difference which is maven directory under META-INF directory.

Now that I think again, the problem is not that the class is not found. The error says "java.lang.IllegalArgumentException: Object: com.xxx.entities.XyzEntity@3a18c1 is not a known entity type" which is coming from EclipseLink in WebLogic.

But I wonder why  making a trivial change (as it seems) in POM file should make this behave differently. I gotta be an issue in JPA. So out of this list's scope.



-----Original Message-----
From: Wayne Fay [mailto:waynefay@gmail.com]
Sent: July-11-12 12:33 PM
To: Maven Users List
Subject: Re: Dependency entry changes runtime

OK so back up.

First, leave the dependency out of A and run "mvn clean package". Set that jar file aside (rename it and move it out of target or clean will remove it.)

Now add the dependency and run "mvn clean package". Set that jar file aside like you did before.

Now use some tool to unzip both and compare the contents. Surely there is a difference you simply have not accounted for yet.

Wayne

On Wed, Jul 11, 2012 at 1:34 PM, Amir Gheibi <ag...@fmep.ag.gov.bc.ca> wrote:
> Here is A's Manifest entry which as I mentioned, is identical in both scenarios.
>
> Manifest-Version: 1.0
> Built-By: bm03043
> Build-Jdk: 1.6.0_18
> Created-By: Apache Maven 3.0.4
> Archiver-Version: Plexus Archiver
> Extension-List: entities
> entities-Extension-Name: com.xxx.entities
>
> -----Original Message-----
> From: Wayne Fay [mailto:waynefay@gmail.com]
> Sent: July-11-12 11:13 AM
> To: Maven Users List
> Subject: Re: Dependency entry changes runtime
>
>> Runtime environment is a "Weblogic 10.3.3" in which "B" is registered as an Optional Package (Library) and there is an extension entry in A's MANIFEST that refers to it (that's how A finds B in runtime).
>>
>> I compared A's JAR file in both scenarios and I don't see any difference whatsoever except the POM file within the Maven directory, which as far as I understand, doesn't have any effect on runtime.
>>
>> Why would the dependency entry change runtime behavior?
>
> Didn't you already answer your own question? The answer is the
> MANIFEST entry. If you check, the MANIFEST entry will (should) only
> appear when the dependency is added with runtime scope.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
B�KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB��[��X��ܚX�KK[XZ[
�\�\��][��X��ܚX�PX]�[��\X�K�ܙ�B��܈Y][ۘ[��[X[��K[XZ[
�\�\��Z[X]�[��\X�K�ܙ�B

RE: Dependency entry changes runtime

Posted by Amir Gheibi <ag...@fmep.ag.gov.bc.ca>.
I posted this in Weblogic's forum and waited. But nothing useful came out of it.

If I restart WLS (without having the dependency tag in POM file), the problem goes away...

This is the post in Weblogic's forum:
https://forums.oracle.com/forums/thread.jspa?threadID=2413507&tstart=0


-----Original Message-----
From: Wayne Fay [mailto:waynefay@gmail.com]
Sent: July-11-12 3:14 PM
To: Maven Users List
Subject: Re: Dependency entry changes runtime

> Now that I think again, the problem is not that the class is not
> found. The error says "java.lang.IllegalArgumentException: Object:
> com.xxx.entities.XyzEntity@3a18c1 is not a known entity type" which is
> coming from EclipseLink in WebLogic.
>
> But I wonder why  making a trivial change (as it seems) in POM file
> should make this behave differently. I gotta be an issue in JPA. So out of this list's scope.

I think there must be some additional difference(s) between the "working" and "not working" state that you have simply not found -- but not necessarily in the Jar files you are producing now, perhaps in some other piece/component.

If you sort it out, come back and give us more details, if for no reason other than to benefit future Google searchers who run into similar problems with EclipseLink.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org

Re: Dependency entry changes runtime

Posted by Wayne Fay <wa...@gmail.com>.
> Now that I think again, the problem is not that the class is not found. The
> error says "java.lang.IllegalArgumentException: Object:
> com.xxx.entities.XyzEntity@3a18c1 is not a known entity type" which is
> coming from EclipseLink in WebLogic.
>
> But I wonder why  making a trivial change (as it seems) in POM file should
> make this behave differently. I gotta be an issue in JPA. So out of this list's scope.

I think there must be some additional difference(s) between the
"working" and "not working" state that you have simply not found --
but not necessarily in the Jar files you are producing now, perhaps in
some other piece/component.

If you sort it out, come back and give us more details, if for no
reason other than to benefit future Google searchers who run into
similar problems with EclipseLink.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Dependency entry changes runtime

Posted by Amir Gheibi <ag...@fmep.ag.gov.bc.ca>.
Thanks mate. Still Identical MANIFEST(!) and when I compared the JARs with a tool (BeyondCompare) I could only see one difference which is maven directory under META-INF directory.

Now that I think again, the problem is not that the class is not found. The error says "java.lang.IllegalArgumentException: Object: com.xxx.entities.XyzEntity@3a18c1 is not a known entity type" which is coming from EclipseLink in WebLogic.

But I wonder why  making a trivial change (as it seems) in POM file should make this behave differently. I gotta be an issue in JPA. So out of this list's scope.



-----Original Message-----
From: Wayne Fay [mailto:waynefay@gmail.com]
Sent: July-11-12 12:33 PM
To: Maven Users List
Subject: Re: Dependency entry changes runtime

OK so back up.

First, leave the dependency out of A and run "mvn clean package". Set that jar file aside (rename it and move it out of target or clean will remove it.)

Now add the dependency and run "mvn clean package". Set that jar file aside like you did before.

Now use some tool to unzip both and compare the contents. Surely there is a difference you simply have not accounted for yet.

Wayne

On Wed, Jul 11, 2012 at 1:34 PM, Amir Gheibi <ag...@fmep.ag.gov.bc.ca> wrote:
> Here is A's Manifest entry which as I mentioned, is identical in both scenarios.
>
> Manifest-Version: 1.0
> Built-By: bm03043
> Build-Jdk: 1.6.0_18
> Created-By: Apache Maven 3.0.4
> Archiver-Version: Plexus Archiver
> Extension-List: entities
> entities-Extension-Name: com.xxx.entities
>
> -----Original Message-----
> From: Wayne Fay [mailto:waynefay@gmail.com]
> Sent: July-11-12 11:13 AM
> To: Maven Users List
> Subject: Re: Dependency entry changes runtime
>
>> Runtime environment is a "Weblogic 10.3.3" in which "B" is registered as an Optional Package (Library) and there is an extension entry in A's MANIFEST that refers to it (that's how A finds B in runtime).
>>
>> I compared A's JAR file in both scenarios and I don't see any difference whatsoever except the POM file within the Maven directory, which as far as I understand, doesn't have any effect on runtime.
>>
>> Why would the dependency entry change runtime behavior?
>
> Didn't you already answer your own question? The answer is the
> MANIFEST entry. If you check, the MANIFEST entry will (should) only
> appear when the dependency is added with runtime scope.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org

Re: Dependency entry changes runtime

Posted by Wayne Fay <wa...@gmail.com>.
OK so back up.

First, leave the dependency out of A and run "mvn clean package". Set
that jar file aside (rename it and move it out of target or clean will
remove it.)

Now add the dependency and run "mvn clean package". Set that jar file
aside like you did before.

Now use some tool to unzip both and compare the contents. Surely there
is a difference you simply have not accounted for yet.

Wayne

On Wed, Jul 11, 2012 at 1:34 PM, Amir Gheibi <ag...@fmep.ag.gov.bc.ca> wrote:
> Here is A's Manifest entry which as I mentioned, is identical in both scenarios.
>
> Manifest-Version: 1.0
> Built-By: bm03043
> Build-Jdk: 1.6.0_18
> Created-By: Apache Maven 3.0.4
> Archiver-Version: Plexus Archiver
> Extension-List: entities
> entities-Extension-Name: com.xxx.entities
>
> -----Original Message-----
> From: Wayne Fay [mailto:waynefay@gmail.com]
> Sent: July-11-12 11:13 AM
> To: Maven Users List
> Subject: Re: Dependency entry changes runtime
>
>> Runtime environment is a "Weblogic 10.3.3" in which "B" is registered as an Optional Package (Library) and there is an extension entry in A's MANIFEST that refers to it (that's how A finds B in runtime).
>>
>> I compared A's JAR file in both scenarios and I don't see any difference whatsoever except the POM file within the Maven directory, which as far as I understand, doesn't have any effect on runtime.
>>
>> Why would the dependency entry change runtime behavior?
>
> Didn't you already answer your own question? The answer is the
> MANIFEST entry. If you check, the MANIFEST entry will (should) only
> appear when the dependency is added with runtime scope.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Dependency entry changes runtime

Posted by Amir Gheibi <ag...@fmep.ag.gov.bc.ca>.
Here is A's Manifest entry which as I mentioned, is identical in both scenarios.

Manifest-Version: 1.0
Built-By: bm03043
Build-Jdk: 1.6.0_18
Created-By: Apache Maven 3.0.4
Archiver-Version: Plexus Archiver
Extension-List: entities
entities-Extension-Name: com.xxx.entities

-----Original Message-----
From: Wayne Fay [mailto:waynefay@gmail.com]
Sent: July-11-12 11:13 AM
To: Maven Users List
Subject: Re: Dependency entry changes runtime

> Runtime environment is a "Weblogic 10.3.3" in which "B" is registered as an Optional Package (Library) and there is an extension entry in A's MANIFEST that refers to it (that's how A finds B in runtime).
>
> I compared A's JAR file in both scenarios and I don't see any difference whatsoever except the POM file within the Maven directory, which as far as I understand, doesn't have any effect on runtime.
>
> Why would the dependency entry change runtime behavior?

Didn't you already answer your own question? The answer is the
MANIFEST entry. If you check, the MANIFEST entry will (should) only
appear when the dependency is added with runtime scope.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org

RE: Dependency entry changes runtime

Posted by Amir Gheibi <ag...@fmep.ag.gov.bc.ca>.
The dependency is added with "provided" scope and MANIFEST is identical in both scenarios. That MANIFEST entry that I mentioned is required for weblogic to make the connection between A and B.

-----Original Message-----
From: Wayne Fay
Sent: July-11-12 11:13 AM
To: Maven Users List
Subject: Re: Dependency entry changes runtime

> Runtime environment is a "Weblogic 10.3.3" in which "B" is registered as an Optional Package (Library) and there is an extension entry in A's MANIFEST that refers to it (that's how A finds B in runtime).
>
> I compared A's JAR file in both scenarios and I don't see any difference whatsoever except the POM file within the Maven directory, which as far as I understand, doesn't have any effect on runtime.
>
> Why would the dependency entry change runtime behavior?

Didn't you already answer your own question? The answer is the MANIFEST entry. If you check, the MANIFEST entry will (should) only appear when the dependency is added with runtime scope.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org

Re: Dependency entry changes runtime

Posted by Wayne Fay <wa...@gmail.com>.
> Runtime environment is a "Weblogic 10.3.3" in which "B" is registered as an Optional Package (Library) and there is an extension entry in A's MANIFEST that refers to it (that's how A finds B in runtime).
>
> I compared A's JAR file in both scenarios and I don't see any difference whatsoever except the POM file within the Maven directory, which as far as I understand, doesn't have any effect on runtime.
>
> Why would the dependency entry change runtime behavior?

Didn't you already answer your own question? The answer is the
MANIFEST entry. If you check, the MANIFEST entry will (should) only
appear when the dependency is added with runtime scope.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org