Archive for the ‘en-US’ Category
weblogic.security.SecurityInitializationException: Authentication for user weblogic denied
Case
Starting a WebLogic 9.2 instance, I got this message:
[java]Server subsystem failed. Reason: weblogic.security.SecurityInitializationException: Authentication for user weblogic denied[/java]
Anyway, I checked the admin login and passwords were OK, since I had never changed them.
Stacktrace
[java]<Mar 18, 2011 11:14:03 AM CET> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: weblogic.security.SecurityInitializationException: Authentication for user weblogic denied
weblogic.security.SecurityInitializationException: Authentication for user weblogic denied
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.doBootAuthorization(CommonSecurityServiceManagerDelegateImpl.java:947)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(CommonSecurityServiceManagerDelegateImpl.java:1029)
at weblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:854)
at weblogic.security.SecurityService.start(SecurityService.java:141)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
[/java]
Fix
- Go to
$DOMAIN_HOME/servers/admin/data/ - Rename
ldapasldap.OLD - Restart WebLogic admin
- Then, a file
$DOMAIN_HOME/servers/admin/security/boot.propertiesshould appear and contain the encrypted login and passwords.The issue should be fixed.
Failed to start Service “Cluster” (ServiceState=SERVICE_STOPPED, STATE_ANNOUNCE)
Case
I introduced an Oracle Coherence cache withing my application, which is deployed as a WAR within WebLogic Server. In a first step, I used an instance of Oracle Coherence / Coherence Web already built in WebLogic. Then, for a couple a reasons, I detroyed the Coherence cluster. Deploying the application, the following error appeared:
[java]java.lang.RuntimeException: Failed to start Service "Cluster" (ServiceState=SERVICE_STOPPED, STATE_ANNOUNCE)[/java]
Complete Stacktrace
[java]java.lang.RuntimeException: Failed to start Service "Cluster" (ServiceState=SERVICE_STOPPED, STATE_ANNOUNCE)
at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.start(Service.CDB:38)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.start(Grid.CDB:38)
at com.tangosol.coherence.component.net.Cluster.onStart(Cluster.CDB:366)
at com.tangosol.coherence.component.net.Cluster.start(Cluster.CDB:11)
at com.tangosol.coherence.component.util.SafeCluster.startCluster(SafeCluster.CDB:3)[/java]
Explanation and Fix
The Coherence cluster view available in WebLogic server is a view of the Tangosol configuration, available in the files tangosol-coherence*.xml of Coherence’s JAR. To fix the issue, create a file tangosol-coherence-override.xml, in your classpath. Fill the file with a minimum content, such as:
[xml]<?xml version=’1.0′?>
<!DOCTYPE coherence SYSTEM "coherence.dtd">
<coherence>
<cluster-config>
<multicast-listener>
<time-to-live system-property="tangosol.coherence.ttl">0</time-to-live>
<join-timeout-milliseconds>3000</join-timeout-milliseconds>
</multicast-listener>
<unicast-listener>
<address>127.0.0.1</address>
<port>8088</port>
<port-auto-adjust>true</port-auto-adjust>
<priority>8</priority>
</unicast-listener>
<packet-publisher>
<packet-delivery>
<timeout-milliseconds>30000</timeout-milliseconds>
</packet-delivery>
</packet-publisher>
<service-guardian>
<timeout-milliseconds system-property="tangosol.coherence.guard.timeout">35000</timeout-milliseconds>
</service-guardian>
</cluster-config>
<logging-config>
<severity-level system-property="tangosol.coherence.log.level">5</severity-level>
<character-limit system-property="tangosol.coherence.log.limit">0</character-limit>
</logging-config>
</coherence>
[/xml]
Of course, you can amend and improve the file to match your requirements.
NB: in case your file is ignored by Coherence, override the property tangosol.coherence.override with value tangosol-coherence-override.xml.
IntelliJ IDEA: javac: source release 1.6 requires target release 1.6
Case
After my Java project upgrade from “Tiger” to “Mustang”, I tried to launch a “make module” within IntelliJ IDEA. I got this message
[java]javac: source release 1.6 requires target release 1.6[/java]
Fix
In IntelliJ IDEA, go to:
File > Settings > Compiler > Java Compiler > remove > Additional command line parameters > remove the parameter -target 1.5
java.rmi.UnmarshalException: failed to unmarshal class weblogic.security.acl.internal.AuthenticatedUser / java.io.StreamCorruptedException: invalid type code: 31
Case
Following an upgrade from Java 5 “Tiger” to Java 6 “Mustang”, I tried to deploy a WAR with Maven-WebLogic plugin. I got this error:
[java]weblogic.deploy.api.tools.deployer.DeployerException: Unable to connect to ‘t3://localhost:7001’: invalid type code: 31. Ensure the url represents a running admin server and that the credentials are correct. If using http protocol, tunneling must be enabled on the admin server.
(…)
Caused by: javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException
(…)
Caused by: weblogic.deploy.api.spi.exceptions.ServerConnectionException
(…)
Caused by: javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: failed to unmarshal class weblogic.security.acl.internal.AuthenticatedUser; nested exception is:
java.io.StreamCorruptedException: invalid type code: 31]
(…)
Caused by: java.rmi.UnmarshalException: failed to unmarshal class weblogic.security.acl.internal.AuthenticatedUser; nested exception is:
java.io.StreamCorruptedException: invalid type code: 31
(…)
Caused by: java.io.StreamCorruptedException: invalid type code: 31
[/java]
Complete Stacktrace
[java]weblogic.deploy.api.tools.deployer.DeployerException: Unable to connect to ‘t3://localhost:7001’: invalid type code: 31. Ensure the url represents a running admin server and that the credentials are correct. If using http protocol, tunneling must be enabled on the admin server.
at weblogic.deploy.api.tools.deployer.Jsr88Operation.connect(Jsr88Operation.java:314)
at weblogic.deploy.api.tools.deployer.Deployer.perform(Deployer.java:137)
at weblogic.deploy.api.tools.deployer.Deployer.runBody(Deployer.java:88)
at weblogic.utils.compiler.Tool.run(Tool.java:158)
at weblogic.utils.compiler.Tool.run(Tool.java:115)
at weblogic.Deployer.run(Deployer.java:70)
at org.codehaus.mojo.weblogic.DeployMojoBase.executeDeployer(DeployMojoBase.java:510)
at org.codehaus.mojo.weblogic.DeployMojo.execute(DeployMojo.java:49)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:454)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:513)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:483)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:331)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:292)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:345)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:132)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:290)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException
at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.<init>(WebLogicDeploymentManagerImpl.java:121)
at weblogic.deploy.api.spi.factories.internal.DeploymentFactoryImpl.getDeploymentManager(DeploymentFactoryImpl.java:84)
at weblogic.deploy.api.tools.SessionHelper.getRemoteDeploymentManager(SessionHelper.java:482)
at weblogic.deploy.api.tools.deployer.Jsr88Operation.connect(Jsr88Operation.java:295)
… 25 more
Caused by: weblogic.deploy.api.spi.exceptions.ServerConnectionException
at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.init(ServerConnectionImpl.java:143)
at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.getNewConnection(WebLogicDeploymentManagerImpl.java:148)
at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.<init>(WebLogicDeploymentManagerImpl.java:118)
… 28 more
Caused by: javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: failed to unmarshal class weblogic.security.acl.internal.AuthenticatedUser; nested exception is:
java.io.StreamCorruptedException: invalid type code: 31]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:85)
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:41)
at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:765)
at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialContextFactoryDelegate.java:665)
at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialContextFactoryDelegate.java:465)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:372)
at weblogic.jndi.Environment.getContext(Environment.java:307)
at weblogic.jndi.Environment.getContext(Environment.java:277)
at weblogic.jndi.Environment.createInitialContext(Environment.java:200)
at weblogic.jndi.Environment.getInitialContext(Environment.java:184)
at weblogic.jndi.Environment.getInitialContext(Environment.java:162)
at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.getContext(ServerConnectionImpl.java:330)
at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.getEnvironment(ServerConnectionImpl.java:302)
at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.init(ServerConnectionImpl.java:141)
… 30 more
Caused by: java.rmi.UnmarshalException: failed to unmarshal class weblogic.security.acl.internal.AuthenticatedUser; nested exception is:
java.io.StreamCorruptedException: invalid type code: 31
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:219)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:224)
at weblogic.common.internal.RMIBootServiceImpl_922_WLStub.authenticate(Unknown Source)
at weblogic.security.acl.internal.Security$1.run(Security.java:185)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.security.acl.internal.Security.authenticate(Security.java:181)
at weblogic.jndi.WLInitialContextFactoryDelegate.authenticateRemotely(WLInitialContextFactoryDelegate.java:726)
at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialContextFactoryDelegate.java:659)
… 40 more
Caused by: java.io.StreamCorruptedException: invalid type code: 31
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1356)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:195)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:565)
at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:191)
at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:217)
… 48 more[/java]
Fix
Edit your pom.xml, and add the two following properties:
[xml] <com.sun.xml.namespace.QName.useCompatibleSerialVersionUID>1.0</com.sun.xml.namespace.QName.useCompatibleSerialVersionUID>
<sun.lang.ClassLoader.allowArraySyntax>1.5</sun.lang.ClassLoader.allowArraySyntax>[/xml]
If needed, and if your current pom is only intented at package and deploying a WAR, you can also downgrade the Java compilation version, adding the block:
[xml] <maven.compiler.target>1.5</maven.compiler.target>
<maven.compiler.source>1.5</maven.compiler.source>
[/xml]
You can also append those properties on the head of environment variable MAVEN_OPTS.
Oracle / OUI-10038
Case
Trying to install Oracle Agent on a Windows XP SP2 desktop, I get the following error:
[java]ERROR: OUI-10038:You do not have the necessary permissions to write to the inventory at \Oracle\Inventory. Please make sure that you have the appropriate permissions to perform the installation.[/java]
Fix
Edit the registry. For the key HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\inst_loc, replace the value \Oracle\Inventory with C:\Oracle\Inventory
java.io.NotSerializableException: org.apache.log4j.Logger
Case
I use Oracle Coherence (Tangosol) as distributed cache for a given class. This class contains a non-static Log4J’s Logger as field.
(what a Logger does in an “POJO” is not obvious and requires further development ; let’s say it is used during the development phase, but has nothing to do in a POJO and should be removed later).
When Tangosol tries to put the object in cache, I get this error:
[java]java.io.NotSerializableException: org.apache.log4j.Logger[/java]
Complete stacktrace
java.io.NotSerializableException: org.apache.log4j.Logger
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at com.tangosol.util.ExternalizableHelper.writeSerializable(ExternalizableHelper.java:2181)
at com.tangosol.util.ExternalizableHelper.writeObjectInternal(ExternalizableHelper.java:2603)
at com.tangosol.util.ExternalizableHelper.serializeInternal(ExternalizableHelper.java:2529)
at com.tangosol.util.ExternalizableHelper.toBinary(ExternalizableHelper.java:206)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$ConverterValueToBinary.convert(DistributedCache.CDB:3)
at com.tangosol.util.ConverterCollections$ConverterMap.put(ConverterCollections.java:1566)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$ViewMap.put(DistributedCache.CDB:1)
at com.tangosol.coherence.component.util.SafeNamedCache.put(SafeNamedCache.CDB:1)
at com.lalou.jonathan.business.cache.TypedEhCache.put(TypedEhCache.java:73)
at com.lalou.jonathan.business.cache.TypedEhCache.setInCache(TypedEhCache.java:58)
at com.lalou.jonathan.business.StringToRequestListTransformer.transform(JonathanTransformer.java:104)
at org.mule.transformer.AbstractMessageAwareTransformer.doTransform(AbstractMessageAwareTransformer.java:68)
at org.mule.transformer.AbstractTransformer.transform(AbstractTransformer.java:254)
at org.mule.DefaultMuleMessage.applyAllTransformers(DefaultMuleMessage.java:621)
at org.mule.DefaultMuleMessage.applyTransformers(DefaultMuleMessage.java:582)
at org.mule.DefaultMuleMessage.applyTransformers(DefaultMuleMessage.java:575)
at org.mule.DefaultMuleEvent.transformMessage(DefaultMuleEvent.java:326)
at org.mule.DefaultMuleEvent.transformMessage(DefaultMuleEvent.java:321)
at org.mule.component.simple.PassThroughComponent.doInvoke(PassThroughComponent.java:27)
at org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:133)
at org.mule.component.AbstractComponent.invoke(AbstractComponent.java:161)
at org.mule.service.AbstractService.invokeComponent(AbstractService.java:929)
at org.mule.model.seda.SedaService.access$100(SedaService.java:56)
at org.mule.model.seda.SedaService$ComponentStageWorker.run(SedaService.java:574)
at org.mule.work.WorkerContext.run(WorkerContext.java:310)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Thread.java:619)
Fix
Declare the Logger as static:
[java]private final Logger LOG = Logger.getLogger(CsvFileObject.class);[/java]
In my case, the issue was fixed. If it is not, try to declare the Logger as static transient, I assume it could help.
javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException
Case
I deploy a WAR on a WebLogic server, thanks to Maven’s Weblogic plugin. For any reason, the pom.xml was modified, to add a dependency to weblogic-maven-plugin:
[xml] <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>weblogic-maven-plugin</artifactId>
<version>2.9.1</version>
<configuration>(…)</configuration>
<dependencies>
<dependency>
<groupId>weblogic</groupId>
<artifactId>wlfullclient</artifactId>
<version>10.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
</plugin>[/xml]
From then I could not deploy anymore. I get the error:
[java]javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException
at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.<init>(WebLogicDeploymentManagerImpl.java:121)[/java]
Complete stacktrace
"[ServerConnectionImpl.close():332] : Closing DM connection
[ServerConnectionImpl.close():352] : Unregistered all listeners
javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException
at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.(WebLogicDeploymentManagerImpl.java:121)
at weblogic.deploy.api.spi.factories.internal.DeploymentFactoryImpl.getDeploymentManager(DeploymentFactoryImpl.java:86)
at weblogic.deploy.api.tools.SessionHelper.getRemoteDeploymentManager(SessionHelper.java:496)
at weblogic.deploy.api.tools.deployer.Jsr88Operation.connect(Jsr88Operation.java:297)
at weblogic.deploy.api.tools.deployer.Deployer.perform(Deployer.java:137)
at weblogic.deploy.api.tools.deployer.Deployer.runBody(Deployer.java:88)
at weblogic.utils.compiler.Tool.run(Tool.java:158)
at weblogic.utils.compiler.Tool.run(Tool.java:115)
at weblogic.Deployer.run(Deployer.java:70)
at org.codehaus.mojo.weblogic.DeployMojoBase.executeDeployer(DeployMojoBase.java:510)
at org.codehaus.mojo.weblogic.DeployMojo.execute(DeployMojo.java:49)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:454)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:513)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:483)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:331)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:292)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:345)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:132)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:290)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: weblogic.deploy.api.spi.exceptions.ServerConnectionException
at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.init(ServerConnectionImpl.java:141)
at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.getNewConnection(WebLogicDeploymentManagerImpl.java:148)
at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.(WebLogicDeploymentManagerImpl.java:118)
... 28 more
Caused by: javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ProtocolException: unrecognized response from proxy: 'HTTP/1.1 403 Forbidden'; No available router to destination]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:40)
at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:787)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:366)
at weblogic.jndi.Environment.getContext(Environment.java:315)
at weblogic.jndi.Environment.getContext(Environment.java:285)
at weblogic.jndi.Environment.createInitialContext(Environment.java:208)
at weblogic.jndi.Environment.getInitialContext(Environment.java:192)
at weblogic.jndi.Environment.getInitialContext(Environment.java:170)
at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.getContext(ServerConnectionImpl.java:328)
at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.getEnvironment(ServerConnectionImpl.java:300)
at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.init(ServerConnectionImpl.java:139)
... 30 more
Caused by: java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ProtocolException: unrecognized response from proxy: 'HTTP/1.1 403 Forbidden'; No available router to destination
at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:216)
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:170)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:153)
at weblogic.jndi.WLInitialContextFactoryDelegate$1.run(WLInitialContextFactoryDelegate.java:345)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:340)
... 38 more
Caused by: java.rmi.ConnectException: Destination unreachable; nested exception is:
java.net.ProtocolException: unrecognized response from proxy: 'HTTP/1.1 403 Forbidden'; No available router to destination
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:464)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:315)
at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:254)
at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:197)
at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:238)
at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:200)
... 44 more
weblogic.deploy.api.tools.deployer.DeployerException: Unable to connect to 't3://localhost:7001': Destination unreachable; nested exception is:
java.net.ProtocolException: unrecognized response from proxy: 'HTTP/1.1 403 Forbidden'; No available router to destination. Ensure the url represents a running admin server and that the credentials are correct. If using http protocol, tunneling must be enabled on the admin server.
at weblogic.deploy.api.tools.deployer.Jsr88Operation.connect(Jsr88Operation.java:316)
at weblogic.deploy.api.tools.deployer.Deployer.perform(Deployer.java:137)
at weblogic.deploy.api.tools.deployer.Deployer.runBody(Deployer.java:88)
at weblogic.utils.compiler.Tool.run(Tool.java:158)
at weblogic.utils.compiler.Tool.run(Tool.java:115)
at weblogic.Deployer.run(Deployer.java:70)
at org.codehaus.mojo.weblogic.DeployMojoBase.executeDeployer(DeployMojoBase.java:510)
at org.codehaus.mojo.weblogic.DeployMojo.execute(DeployMojo.java:49)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:454)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:513)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:483)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:331)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:292)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:345)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:132)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:290)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException
at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.(WebLogicDeploymentManagerImpl.java:121)
at weblogic.deploy.api.spi.factories.internal.DeploymentFactoryImpl.getDeploymentManager(DeploymentFactoryImpl.java:86)
at weblogic.deploy.api.tools.SessionHelper.getRemoteDeploymentManager(SessionHelper.java:496)
at weblogic.deploy.api.tools.deployer.Jsr88Operation.connect(Jsr88Operation.java:297)
... 25 more
Caused by: weblogic.deploy.api.spi.exceptions.ServerConnectionException
at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.init(ServerConnectionImpl.java:141)
at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.getNewConnection(WebLogicDeploymentManagerImpl.java:148)
at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.(WebLogicDeploymentManagerImpl.java:118)
... 28 more
Caused by: javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ProtocolException: unrecognized response from proxy: 'HTTP/1.1 403 Forbidden'; No available router to destination]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:40)
at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:787)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:366)
at weblogic.jndi.Environment.getContext(Environment.java:315)
at weblogic.jndi.Environment.getContext(Environment.java:285)
at weblogic.jndi.Environment.createInitialContext(Environment.java:208)
at weblogic.jndi.Environment.getInitialContext(Environment.java:192)
at weblogic.jndi.Environment.getInitialContext(Environment.java:170)
at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.getContext(ServerConnectionImpl.java:328)
at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.getEnvironment(ServerConnectionImpl.java:300)
at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.init(ServerConnectionImpl.java:139)
... 30 more
Caused by: java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ProtocolException: unrecognized response from proxy: 'HTTP/1.1 403 Forbidden'; No available router to destination
at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:216)
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:170)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:153)
at weblogic.jndi.WLInitialContextFactoryDelegate$1.run(WLInitialContextFactoryDelegate.java:345)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:340)
... 38 more
Caused by: java.rmi.ConnectException: Destination unreachable; nested exception is:
java.net.ProtocolException: unrecognized response from proxy: 'HTTP/1.1 403 Forbidden'; No available router to destination
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:464)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:315)
at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:254)
at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:197)
at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:238)
at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:200)
... 44 more
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Exception encountered during artifact start: weblogic.deploy.api.tools.deployer.DeployerException: Unable to connect to 't3://localhost:7001': Destination unreachable; nested exception is:
java.net.ProtocolException: unrecognized response from proxy: 'HTTP/1.1 403 Forbidden'; No available router to destination. Ensure the url represents a running admin server and that the credentials are correct. If using http protocol, tunneling must be enabled on the admin server."
Explanation
In weblogic-maven-plugin-2.9.1.pom, we can find the following dependencies:
[xml] <dependency>
<groupId>weblogic</groupId>
<artifactId>weblogic</artifactId>
<version>[9.0,11.0)</version>
</dependency>
<dependency>
<groupId>weblogic</groupId>
<artifactId>webservices</artifactId>
<version>[9.0,11.0)</version>
</dependency>[/xml]
Since WebLogic client jars are not compatibles between versions 9 and 10, a conflit of JARs appears between my pom’s dependency to weblogic:wlfullclient-10.3.jar and the plugin pom’s dependencies to weblogic:weblogic-XXX.jar and weblogic:webservices-XXX.jar
Fix
In the project pom.xml, remove the dependency to <strongwlfullclient.jar.
WebLogic: set a System property within a WAR
Case
You would like to set a System property within an application packaged as a WAR.
Of course, you may modify the launching scripts of your servers, to add an option -DmyPropertyName=myPropertyValue. Sometimes, you would like to avoid such a solution, because updating the property would require an update of the setEnv.* files and therefore a action of the exploitation team.
In my case, I had to set the property tangosol.coherence.cacheconfig, which hints at the configuration file used my Oracle Coherence / Coherence*Web
Fix
The first solution is to set the property in a startup class. For more detials, consult this page: WebLogic: use a startup and/or a shutdown class in a WAR.
Another mean to handle this problematic is to create a servlet, with a code similar to:
[java]public class JonathanBootServlet extends HttpServlet {
private static final Logger LOGGER = Logger.getLogger(JonathanBootServlet.class);
private static final String SVN_ID = "$Id$";
public JonathanBootServlet() {
super();
if (LOGGER.isDebugEnabled()){
LOGGER.debug(SVN_ID);
}
}
public void init(ServletConfig config) throws ServletException {
if (LOGGER.isDebugEnabled()){
LOGGER.debug("in init()");
}
System.setProperty("tangosol.coherence.cacheconfig", "jonathan-tangosol-coherence.xml");
super.init(config);
}
}[/java]
Then add the following block in your web.xml:
[xml] <servlet>
<servlet-name>JonathanBootServlet</servlet-name>
<servlet-class>lalou.jonathan.weblogic.technical.JonathanBootServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>[/xml]
Ensure this servlet is run before all others (1).
java.lang.NoClassDefFoundError: com/tangosol/run/component/EventDeathException
Case
You have an application which uses Oracle Coherence / Coherence*Web as cache manager. On redeploying the application, you get a stacktrace of which header is:
[java]Exception in thread ‘DistributedCache|SERVICE_STOPPED’ java.lang.NoClassDefFoundError: com/tangosol/run/component/EventDeathException[/java]
Explanation
Indeed, an undeploy operation stops the services of your application. But Coherence is not launched as a service among the others: it should be considered as an independant one. Therefore, you have to stop it before undeploying your application ; otherwise, your classloader is in a confused state, and loses references to classes it had loaded before, but that should now be unloaded.
Fix
You have to stop Oracle Coherence on your application shutdown.
EAR
If your application is packaged as an EAR, then create a shutdown class with the following main():
[java]public class JonathanLalouEARShutdown extends ApplicationLifecycleListener {
public static void main(String[] args) {
CacheFactory.shutdown();
}
}[/java]
Add the following block in your weblogic-application.xml, hinting the shutdown class:
[xml]<shutdown>
<shutdown-class>lalou.jonathan.weblogic.JonathanLalouEARShutdown </shutdown-class>
</shutdown>[/xml]
WAR
If your application is packaged as a WAR, then create a class implementing ServletContextListener, and add the following block in your web.xml:
[xml]
<listener>
<listener-class>your.class.implementing.ServletContextListener</listener-class>
</listener>
[/xml]
The detailed procedure is described at this link: WebLogic: use a startup and/or a shutdown class in a WAR
WebLogic: use a startup and/or a shutdown class in a WAR
Abstract
WebLogic offers you to specify a startup and/or a shutdown class for an application. Anyway, this feature is restrained to EARs, and is not available for applications deployed as WARs. For EARs, Oracle WebLogic Server’s documentation is complete and gives basic examples: Programming Application Life Cycle Events
Yet, sometimes you need such a class even for a WebApp. You have two ways to handle this case.
Solutions
Full Weblogic!
Base
The first solution is not elegant. Open WebLogic console, go to Startup And Shutdown Classes, then add the classes names of which main() methods will be run on startup and shutdown, let’s say JonathanWeblogicStartup. These classes must be available in WebLogic classpath, which is surely different from your application classpath, eg in a library $DOMAIN_HOME/lib/customized-weblogic.jar.
Advantage of this means: if your startup/shutdown class does not evoluate often, then write it once and forget, it will be OK. Unlike, you will have to manage different versions of the JAR on each release… I assume your exploitation team may get angry at playing with classpaths and lib folders 😀
Suggestion
To improve the basic solution (and avoid your exploitation guy burst in your office), I had the following idea, that I did not experiment, but that should work:
- Keep
JonathanWeblogicStartup
- Create another class
JonathanConcreteStartup, locate as a source in your application code. - In
JonathanStartup.main(), callJonathanConcreteStartup
This way,
- You keep a unique JAR in classpath that you do not need to update and you can forget.
- You can add, update or remove features in your very source code.
- The exploitation teams does not become hateful at you.
Add a Listener
The second one requires a bit more work.
- Create a class implementing
javax.servlet.ServletContextListenerinterface, let’s sayMyLifecycleListener. - Implement methods
contextInitialized()andcontextDestroyed(). - Edit your web.xml, add the following block:
[xml]
<listener>
<listener-class>lalou.jonathan.MyLifecycleListener</listener-class>
</listener>[/xml] - Rebuild and deploy. It should be OK