0

I have an issue while running my application in weblogic server. I have same classes in two different jars under differnt package. Will it raise any issue at runtime?

Note : I am not facing any build issue.

Sorry. if I confused you all.

Advance Thanks

Karthikeyan Sukkoor
  • 968
  • 2
  • 6
  • 24

3 Answers3

1

If the fully classified class name (aka package + class name) is different, then there can be no problem at all. Java distinguishes classes by complete name that includes package (aka FQCN). If two jars contain identical FQCN, then it depends on classloader order settings. When you deploy new ear (war) in app server, you can specify the order. More information for weblogic: http://docs.oracle.com/cd/E11035_01/wls100/programming/classloading.html

Leos Literak
  • 8,805
  • 19
  • 81
  • 156
1

There can't be a direct problem related to class - loading when using different full - qualified - classnames. There can be issues, though, with CDI. Remember that Inject can be applied to many Resources, and the injection target can have the type of an interface rather then having the type of the implementing class. When determinating on which object is to be instanciated, the application server /CDI container could run into problems when suddenly there may be more implementations of that interface available after a deployment then before, e.g. both annotated with the same or default qualifier, though a exception is expected here rather then a random injecting of one class or the other.

Peter
  • 1,769
  • 1
  • 14
  • 18
0

As long as they are within different namespaces there will be no problems raised from having the same classes in different annything since they will have the name : package.class. If i where you i would look for a different cause for runtime errors.

And might i ask what makes you think this is the problem? do you have anny log or error refering to these specific classes?

SomeRandomName
  • 593
  • 1
  • 8
  • 23
  • I am using those jars in Jar-B. while invoking jar-B's class, I am getting class not found exception at run time. – Karthikeyan Sukkoor Jan 07 '14 at 16:08
  • How did you package your application? You might miss B.jar or placed it on incorrect location. – Leos Literak Jan 07 '14 at 16:10
  • it is running code(B.jar).. newly I am calling two webservice stub call using those jars. since both wsdl from same backend system. it has same class(under different pkg) object while creating stub(jar). – Karthikeyan Sukkoor Jan 07 '14 at 16:15