aspose file tools*
The moose likes JBoss/WildFly and the fly likes Annoying error_java.lang.NoSuchMethodError: org.apache.bcel.generic.InstructionFactory.createNewArra Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Annoying error_java.lang.NoSuchMethodError: org.apache.bcel.generic.InstructionFactory.createNewArra" Watch "Annoying error_java.lang.NoSuchMethodError: org.apache.bcel.generic.InstructionFactory.createNewArra" New topic
Author

Annoying error_java.lang.NoSuchMethodError: org.apache.bcel.generic.InstructionFactory.createNewArra

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2

Hi All,

After undergoing through many hardships and removing many compiling, spec violation and datasource configuration errors , finally I was glad that I'm going to run my first CMP beans in JBoss container. But my happiness did not last long as I started facing a very annoying and weird error message during ear deployment which I could not get rid off. I'm seeing the following error in server.log



and some where before this, I have the below error stack


Are there any library version conflicts here ?

I'm using JBoss 4.0.4 as AS, jdk1.4.2 and EJB 2.1.

In case you suspect errors in code, I would be glad to copy them here, but I just do not want to throw all the stuff on to this thread if not needed.

Any help is highly appreciated.


Regards
KumarRaja

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2

Could some one look into this and advice? If this is not the right group, please advice, if this post can be moved to some other group.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9315
    
109

Looks like a jar (version) conflict. Are you packaging any jars containing org.apache.bcel.* in your application?

By the way, any specific reason for using such a old version of JBoss AS?


[My Blog] [JavaRanch Journal]
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2

Thanks for the reply Jai. I'm deploying
the following jars along with my ear.

jboss-j2ee.jar
log4j.jar
xerces.jar
xml.jar

There is no specific reason for using 4.0.4 version. Since I'm just learning, I did not bother to have the latest version of AS. Do you suspect anything caused by older version.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9315
    
109

jboss-j2ee.jar
log4j.jar
xerces.jar
xml.jar


Don't package jboss-j2ee.jar in your application. You *may* package the other 3 jars in your app, but that will require some additional classloading configurations for things to work properly. Since you are just getting started, I would recommend you remove those 3 jars too from the application packaging. JBoss already ships those.

There is no specific reason for using 4.0.4 version. Since I'm just learning, I did not bother to have the latest version of AS. Do you suspect anything caused by older version.


Can't say for sure whether this is because of the older version. But it's always better to start off with the latest stable versions because they will have any bug fixes that might be related to your issue. I would recommend that you use JBoss AS 5.1.0 (that's currently the latest stable version).

Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9315
    
109

By the way, EJB2.x is old too. You might want to start working with EJB3, but I'll leave that to you to decide depending on your technical requirements.
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2

Hmm,

Instead of deploying in JBoss 4.0.4, I compiled my files with jdk1.6 and deployed in JBoss 4.2.3 version and was able to get around the issue. But now it seems some thing else is breaking and now this seems to be more from my components. My design is as follows,

I'm using a standalone client (no specific reason to use standalone. I'm just concentrating on EJBs not web currently). This standalone obtains a reference of a stateless session bean through JNDI (remote reference) and and calls a business method to insert a Employee object. Session Facade, in turn obtains a local home interface of entity beans through JNDI and then calls create method on this. This is the objective in short.

I checked the deployment status of my beans and I see my datasource, session facade is bound to JNDI. However I do not see JNDI bound for Employee as expected.

For my SessionFacade - MyEJB/Facade is correct JNDI name given in Jboss.xml and MyEJB/Employee for my entity bean. But from below JMX, I see local/Employee. I do not know why.


jndiName=MyEJB/Facade,plugin=pool,service=EJB
jndiName=MyEJB/Facade,service=EJB
jndiName=local/Employee@17326134,plugin=cache,service=EJB
jndiName=local/Employee@17326134,plugin=pool,service=EJB
jndiName=local/Employee@17326134,service=EJB
module=MyEJB.jar,service=EjbModule
service=ClientDeployer
service=EARDeployer
service=EARDeployment,url='MyEJB.ear'



Now coming to my problem. I was able to obtain the home reference of Session bean, but when I invoke create method on home interface, boom.... I'm getting an exception, which I never recollect of seeing before.



I know, this information is not really sufficient to pinpoint but I'm just curious if the issue can be found with this information. If needed, I'm glad to put all the files here.
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2

By the way, EJB2.x is old too. You might want to start working with EJB3, but I'll leave that to you to decide depending on your technical requirements.


I'm just curious to know, how far EJBs have travelled leaving 2.x behind (I mean literally in the practical world). To be honest with you, in our projects we are using ejbs 1.1 (I swear) and I assume this might be the case with many legacy projects. Do you suggest it is not worthy, spending time in learning 2.x version, when 3.x is sweeping. I thought, it is only the way ejbs are coded, is different in 3.x from its earlier versions but soul remained the same.
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2

Any help on this.

If this question needs to be moved to a different group, please advice how to do that.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9315
    
109

Kumar Raja wrote:Any help on this.

If this question needs to be moved to a different group, please advice how to do that.


A bit of patience is all that's required
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9315
    
109

Kumar Raja wrote:
I'm just curious to know, how far EJBs have travelled leaving 2.x behind (I mean literally in the practical world). To be honest with you, in our projects we are using ejbs 1.1 (I swear) and I assume this might be the case with many legacy projects.


Yes, that's correct. There are a lot of applications out there which still use EJB2.x. But I haven't heard of many EJB1.x apps.

EJB3 is backward compatible. What this means is, you can use EJB2.x semantics within a EJB3 app.

Kumar Raja wrote:
Do you suggest it is not worthy, spending time in learning 2.x version, when 3.x is sweeping. I thought, it is only the way ejbs are coded, is different in 3.x from its earlier versions but soul remained the same.


EJB3 (and EJB3.1) development is way easier compared to EJB2.x. If you are going to start a new application, then there is no point in using EJB2.x. But however, if there are existing apps which you are working on, which use earlier versions, then you don't have a choice - you'll have to learn the previous versions.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9315
    
109

Kumar Raja wrote:
Now coming to my problem. I was able to obtain the home reference of Session bean, but when I invoke create method on home interface, boom.... I'm getting an exception, which I never recollect of seeing before.





Looks like the objects being passed around are not serializable? But that's just a guess, since I don't know about the example you are trying.

By the way, If you are interested in EJB3 tutorials, you can find them here
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2



JaiKiran

A bit of patience is all that's required




I agree .

I will cross check my code again and see If I could figure out anything.

By the way thanks for the link to ejb3.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Annoying error_java.lang.NoSuchMethodError: org.apache.bcel.generic.InstructionFactory.createNewArra
 
Similar Threads
Error while deploying CMP
DeploymentException while deploying ear file in JBoss
can't find data source: java:/OracleDS
How to connect from JBoss to SQL server ?
State: NOTYETINSTALLED