pacionet
pacionet

Reputation: 361

Ant wldeploy - failed to load java type corresponding to e=deployment-plan@http://www.bea.com/ns/weblogic/deployment-plan

I need to deploy an EAR with a deployment plan on weblogic server 10.3 When I manually deploy the EAR and the plan on weblogic console, all is ok. When I try to use ANT wldeploy task I get this exception on deploy:

 [wldeploy] com.bea.xml.XmlException: failed to load java type corresponding to e=deployment-plan@http://www.bea.com/ns/weblogic/deployment-plan
 [wldeploy]     at com.bea.staxb.runtime.internal.UnmarshalResult.getPojoBindingType(UnmarshalResult.java:361)
 [wldeploy]     at com.bea.staxb.runtime.internal.UnmarshalResult.determineTypeForGlobalElement(UnmarshalResult.java:316)
 [wldeploy]     at com.bea.staxb.runtime.internal.UnmarshalResult.determineTypeForGlobalElement(UnmarshalResult.java:326)
 [wldeploy]     at com.bea.staxb.runtime.internal.UnmarshalResult.determineRootType(UnmarshalResult.java:307)
 [wldeploy]     at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalDocument(UnmarshalResult.java:158)
 [wldeploy]     at com.bea.staxb.runtime.internal.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:65)
 [wldeploy]     at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:141)
 [wldeploy]     at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:306)
 [wldeploy]     at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:270)
 [wldeploy]     at weblogic.deploy.api.spi.config.DescriptorParser.parseDeploymentPlan(DescriptorParser.java:127)

As the exception says, it should be something related to the parsing of deployment plan. The plan seems valid (and on manual deploy works!) and starts with:

<?xml version='1.0' encoding='UTF-8'?>
<deployment-plan xmlns="http://www.bea.com/ns/weblogic/deployment-plan"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/deployment-plan http://www.bea.com/ns/weblogic/deployment-plan/1.0/deployment-plan.xsd">

...

Any hints?

Thanks Andrea

Upvotes: 0

Views: 1043

Answers (1)

Eelse
Eelse

Reputation: 21

I had the same problem, and was unable to find an answer online. So I had to experiment a little, and was able to find a workaround. I'll share it here, in case you - or someone else - still has the problem.

As explained here, I got around the problem by setting the CLASSPATH environment variable. Ensure that, before calling ant, you call ORACLE_HOME/wlserver/server/bin/setWLSEnv - it gets the environment ready for you.

Setting the right classpath in Ant itself for the wldeploy taskdef works fine on linux and os/x probably, but on windows it gives an error for exceeding the windows maximum path length (CreateProcess error=206). As I want to be able to call the ant targets from JDeveloper, I ended up wrapping the actual call to wldeploy in an external Ant call using exec, supplying the classpath as an environment variable.

Refer to the documentation also.

Upvotes: 1

Related Questions