This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes Deployment errors in JBoss 5.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Deployment errors in JBoss 5.1" Watch "Deployment errors in JBoss 5.1" New topic
Author

Deployment errors in JBoss 5.1

Jake Hi
Greenhorn

Joined: Jul 26, 2010
Posts: 12
Hi.

I get some exceptions when I try to deploy ear in JBoss 5.1. Ear works fine in JBoss 4.2.

When I don't change anything JBoss gives following exception:

07:27:29,412 INFO [SessionFactoryObjectFactory] Unbinding factory from JNDI name: persistence.unit:unitName=xxx.ear/entities.jar#EJBXXX
07:27:29,412 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.namingrg.jnp.interfaces}
07:27:29,412 INFO [SessionFactoryObjectFactory] Unbound factory from JNDI name: persistence.unit:unitName=xxx.ear/entities.jar#EJBXXX
07:27:29,709 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/JB501/jboss-5.0.1.GA/server/default/deploy/xxx.ear/ state=PreReal mode=Manual requiredState=Real
org.jboss.deployers.spi.DeploymentException: java.lang.NullPointerException: name cannot be null
at org.jboss.wsf.container.jboss50.deployer.WebServiceDeployerEJB.internalDeploy(WebServiceDeployerEJB.java:100)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:698)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: name cannot be null
at javax.management.ObjectName.construct(Unknown Source)
at javax.management.ObjectName.<init>(Unknown Source)
at org.jboss.wsf.container.jboss50.deployer.WebServiceDeployerEJB.internalDeploy(WebServiceDeployerEJB.java:96)
... 26 more
07:27:29,787 WARN [HDScanner] Failed to process changes
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

DEPLOYMENTS IN ERROR:
Deployment "vfszip:/C:/JB501/jboss-5.0.1.GA/server/default/deploy/xxx.ear/" is in error due to the following reason(s): java.lang.NullPointerException: name cannot be null

at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:863)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:806)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:293)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


Exception occurs in the JBoss code where it try to get container name? Where this should be defined?

If I remove all (6) jboss.xml files from projects there is not any exceptions, but then applications try to use wrong jndi names. There is sample of one jboss.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<jboss>
<security-domain>java:/jaas/xxxSecurity</security-domain>
<enterprise-beans>
<message-driven>
<ejb-name>xxxMessageListener</ejb-name>
<destination-jndi-name>queue/xxxQueue</destination-jndi-name>
</message-driven>
<!-- ======= Creators ======= -->
<session>
<ejb-name>xxxCreator</ejb-name>
<local-jndi-name>ejblocal:com.xx.xx.xx.Creator</local-jndi-name>
</session>
<session>
<ejb-name>yyCreator</ejb-name>
<local-jndi-name>ejblocal:yy.yy.yy.yy.YCreator</local-jndi-name>
</session>
<session>
<ejb-name>bbProcessor</ejb-name>
<local-jndi-name>ejblocal:com.bb.bb.bb.Processor</local-jndi-name>
</session>
</enterprise-beans>
....
....
</jboss>


I also tried to use empty jboss.xml files and same exception occurred.

Ear contains following technologies and its build with eclipse:
-Struts 1.2
-Hibernate
-EJB 3

Please help me someone so we could start to use JBoss 5.1.

Regards
Jaakko
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10069
    
163

How are you packaging the application? The ejb-names in the jboss.xml, do they match with the class names of the annotated EJB classes?

[My Blog] [JavaRanch Journal]
Jake Hi
Greenhorn

Joined: Jul 26, 2010
Posts: 12
Hi Jaikiran.

Thank you for fast response.

Eclipse does all packaging and deploying automatically. Is it possible that eclipse does something wrong?

EJB names in beans and jboss.xml:

/**
* Bean implementation class for Enterprise Bean: AccountServicesWebFacade
*/
@Stateless(name = "AccountServicesWebFacade")
@Remote(value = AccountServices.class)
public class AccountServicesBean implements AccountServices {
...
}

<session>
<ejb-name>AccountServicesWebFacade</ejb-name>
<jndi-name>com.company.product.webfacades.accountservices.AccountServices</jndi-name>
</session>

Does that look correct to you? I have not worked with JavaEE very long time, so there could be also some trivial errors. But everything works fine in JBoss 4.2 ...

Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10069
    
163

Jake Hi wrote:

Eclipse does all packaging and deploying automatically. Is it possible that eclipse does something wrong?

Not sure. I usually don't use any IDE for packaging or deploying. I would recommend that you keep the IDE out of the equation for now and try packaging/deploying outside of the IDE (ex: through Ant scripts). If that works, then we know where the issue is.

Jake Hi wrote:
EJB names in beans and jboss.xml:





Does that look correct to you?

The names match, so that looks fine (atleast this specific bean). Is there any more detailed exception stacktrace a few lines before the logs that you posted? Anything which shows, which bean is being deployed when it runs into problems?

Jake Hi
Greenhorn

Joined: Jul 26, 2010
Posts: 12
Here is something that I noticed from log.

EJB Starting:
...
...
11:24:48,882 INFO [SessionSpecContainer] Starting jboss.j2ee:ear=ccc.ear,jar=providers.jar,name=SettingServices,service=EJB3
11:24:48,898 INFO [EJBContainer] STARTED EJB: com.company.ccc.utils.SettingServicesBean ejbName: SettingServices
11:24:48,898 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:


11:24:48,929 INFO [SessionSpecContainer] Starting jboss.j2ee:ear=ccc.ear,jar=providers.jar,name=IntervalTimer,service=EJB3
11:24:48,929 INFO [EJBContainer] STARTED EJB: com.company.services.timer.IntervalTimerBean ejbName: IntervalTimer
11:24:48,945 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
...
...

After that two warnings and EJB stopping start. Should EJB:s be stopped? (Warnigs: IntervalTimer and FileHandler)

...
...
11:24:49,070 WARN [WebServiceDeployerEJB] Ingore ejb deployment with null classname: org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData@dae99560{IntervalTimer}
11:24:49,070 WARN [WebServiceDeployerEJB] Ingore ejb deployment with null classname: org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData@fde1be0e{FileHandler}
11:24:49,070 INFO [SessionSpecContainer] Stopping jboss.j2ee:ear=product.ear,jar=providers.jar,name=IntervalTimer,service=EJB3
11:24:49,070 INFO [EJBContainer] STOPPED EJB: com.company.services.timer.IntervalTimerBean ejbName: IntervalTimer
11:24:49,132 INFO [SessionSpecContainer] Stopping jboss.j2ee:ear=product.ear,jar=providers.jar,name=SettingServices,service=EJB3
11:24:49,132 INFO [EJBContainer] STOPPED EJB: com.company.product.utils.SettingServicesBean ejbName: SettingServices
11:24:49,163 INFO [SessionSpecContainer] Stopping jboss.j2ee:ear=product.ear,jar=providers.jar,name=SettingGroupFinder,service=EJB3
11:24:49,163 INFO [EJBContainer] STOPPED EJB: com.company.product.utils.SettingGroupFinderBean ejbName: SettingGroupFinder
11:24:49,226 INFO [SessionSpecContainer] Stopping jboss.j2ee:ear=product.ear,jar=providers.jar,name=SettingFinder,service=EJB3
...
...

And just before exception stopping IntervalTimer and FileHandler

...
...
11:25:11,085 INFO [SessionSpecContainer] Stopping jboss.j2ee:ear=product.ear,jar=general-services.jar,name=IntervalTimer,service=EJB3
11:25:11,101 INFO [EJBContainer] STOPPED EJB: com.company.services.timer.IntervalTimerBean ejbName: IntervalTimer
11:25:11,117 INFO [SessionSpecContainer] Stopping jboss.j2ee:ear=product.ear,jar=file-handler.jar,name=FileHandler,service=EJB3
11:25:11,132 INFO [EJBContainer] STOPPED EJB: com.company.product.propagation.connection.file.FileHandlerBean ejbName: FileHandler
11:25:11,148 INFO [PersistenceUnitDeployment] Stopping persistence unit persistence.unit:unitName=product.ear/entities.jar#EJBproduct
11:25:11,148 INFO [SessionFactoryImpl] closing
11:25:11,148 INFO [SessionFactoryObjectFactory] Unbinding factory from JNDI name: persistence.unit:unitName=product.ear/entities.jar#EJBproduct
11:25:11,164 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.namingrg.jnp.interfaces}
11:25:11,164 INFO [SessionFactoryObjectFactory] Unbound factory from JNDI name: persistence.unit:unitName=product.ear/entities.jar#EJBproduct
11:25:11,398 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/JB501/jboss-5.0.1.GA/server/default/deploy/product.ear/ state=PreReal mode=Manual requiredState=Real
org.jboss.deployers.spi.DeploymentException: java.lang.NullPointerException: name cannot be null
...
...

Here is jboss.xml and bean classes:

<?xml version="1.0" encoding="UTF-8"?>
<jboss>
<enterprise-beans>
<session>
<ejb-name>IntervalTimer</ejb-name>
<jndi-name>com.company.services.timer.IntervalTimer</jndi-name>
</session>
</enterprise-beans>
</jboss>

<?xml version="1.0" encoding="UTF-8"?>
<jboss>
<enterprise-beans>
<session>
<ejb-name>FileHandler</ejb-name>
<local-jndi-name>ejblocal:com.company.product.propagation.connection.file.FileHandler</local-jndi-name>
</session>
</enterprise-beans>
</jboss>

@Stateless(name = "FileHandler")
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
@Local(value = FileHandler.class)
public class FileHandlerBean implements FileHandler {

@Stateless(name = "IntervalTimer")
@Remote(value = IntervalTimer.class)
public class IntervalTimerBean implements IntervalTimer {
Jake Hi
Greenhorn

Joined: Jul 26, 2010
Posts: 12
There is also lots of following warnings on the log:

598 WARN [Ejb3AnnotationHandler] JBMETA-4: did not find any bean meta data for annotation bean ReviewManager, will create some
...
...
15:37:16,644 WARN [EJBRemoteHandler] EJBTHREE-1289: Using legacy EjbEncInjector, because mappedName for enc "env/com.accountservices.AccountFinderBean/productHelper", field "productHelper" is null (container.environmentRefGroup.annotatedEjbReferences = null)
...
...

and in the beginning of the log seems like jars is defined several times. Is this normal?

...
...
[Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@8062124{vfsfile:/C:/JB51/jboss-5.1.0.GA/server/default/deploy/profileservice-secured.jar/}
15:36:58,301 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@8062124{vfsfile:/C:/JB51/jboss-5.1.0.GA/server/default/deploy/profileservice-secured.jar/}
15:36:58,301 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@8062124{vfsfile:/C:/JB51/jboss-5.1.0.GA/server/default/deploy/profileservice-secured.jar/}
15:36:58,301 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@8062124{vfsfile:/C:/JB51/jboss-5.1.0.GA/server/default/deploy/profileservice-secured.jar/}
...
...

Jake Hi
Greenhorn

Joined: Jul 26, 2010
Posts: 12
Problem resolved.

There was one MDB defined in jboss.xml but it was disabled in the code. Removing MDB definitions from jboss.xml resolved problem.

But there occurred another problem while application was loading some properties. Following line returns null:

InputStream is = Css.class.getClassLoader().getResourceAsStream("theme/css-colors.properties");

This worked fine in JBoss 4.2.3. Does anyone know how to resolve this?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10069
    
163

Jake Hi wrote:
InputStream is = Css.class.getClassLoader().getResourceAsStream("theme/css-colors.properties");



Where exactly in the packaged deployment, is the "theme/css-colors.properties" located? And which jar/war contains the Css.class (which I believe is your application's class)?
Jake Hi
Greenhorn

Joined: Jul 26, 2010
Posts: 12
theme/css-colors.properties is located in ear.ear/customer-web.war/theme/css-colors.properties
and Css.class is located in ear.ear/web-core.jar/com...Css.class
Jake Hi
Greenhorn

Joined: Jul 26, 2010
Posts: 12
Hi Jaikiran.

getResourcesAsStream() method works if parameter is "myApp.war/theme/css-colors.properties". We have used method in many places so there would be lot of work if we have to change it everywhere.

Do you know is there any changes to get it work like it work in earlier version of JBoss ("theme/css-colors.properties")?

Is it possible that we have to set some class loading settings somewhere? When we run our application in WebSphere we have to set class loading: parent last to an another .ear (and web module) and parent first to an another .ear (and web module).
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10069
    
163

Jake Hi wrote:theme/css-colors.properties is located in ear.ear/customer-web.war/theme/css-colors.properties
and Css.class is located in ear.ear/web-core.jar/com...Css.class


The .war files in AS-5.1 have a separate classloader and is isolated from rest of the .ear. So resources/classes within the .war will not be visible to classes outside the war (even if they belong to the .ear). You have 2 options:

1) Move the web-core.jar from the root of the .ear to .war/WEB-INF/lib folder. This will work if the web-core.jar is not required by any of the other classes in the .ear and is just being used by the classes in the .war. Going by the name of that jar, it does appear to be just meant to be used by that .war file

OR

2) You can disable the .war from using its own classloader. See this
Jake Hi
Greenhorn

Joined: Jul 26, 2010
Posts: 12
Ok.

But even if I added jboss-classloading.xml to my .war getResurceAsStream returns null

<?xml version="1.0" encoding="UTF-8"?>

<classloading xmlns="urn:jboss:classloading:1.0"
name="web.war"
domain="DefaultDomain"
parent-domain="Ignored"
export-all="NON_EMPTY"
import-all="true">
</classloading>

Do you notice anything what should change in that file?

Is domains ok? and should I add also parent-first="true".

I tried many different combinations but nothing worked yet.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10069
    
163

Where exactly did you place that jboss-classloading.xml?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10069
    
163

By the way, I just noticed that you are placing that "theme" folder at the root of the .war. From what I remember, I think the root of the .war isn't made available in the classpath. You might want to move that folder (and its contents) to .war/WEB-INF/classes folder and try it.
Jake Hi
Greenhorn

Joined: Jul 26, 2010
Posts: 12
Now it works!

Thank you very much.

When I moved theme folder to under WEB-INF/classes and add jboss-classloadings to all .wars everything works like before.

Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deployment errors in JBoss 5.1