403 Error running ADF application in JCS

I am getting a 403 error while running a ADF application in JCS. I defined a security role and mapped it to a custom role. web.xml and weblogic.xml are pasted below
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
  <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
  </context-param>
  <context-param>
    <description>If this parameter is true, there will be an automatic check of the modification date of your JSPs, and saved state will be discarded when JSP's change. It will also automatically check if your skinning css files have changed without you having to restart the server. This makes development easier, but adds overhead. For this reason this parameter should be set to false when your application is deployed.</description>
    <param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>
    <param-value>false</param-value>
  </context-param>
  <context-param>
    <description>Whether the 'Generated by...' comment at the bottom of ADF Faces HTML pages should contain version number information.</description>
    <param-name>oracle.adf.view.rich.versionString.HIDDEN</param-name>
    <param-value>true</param-value>
  </context-param>
  <filter>
    <filter-name>trinidad</filter-name>
    <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
  </filter>
  <filter>
    <filter-name>ServletADFFilter</filter-name>
    <filter-class>oracle.adf.share.http.ServletADFFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>trinidad</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
  </filter-mapping>
  <filter-mapping>
    <filter-name>ServletADFFilter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
  </filter-mapping>
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>resources</servlet-name>
    <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
  </servlet>
  <servlet>
    <servlet-name>BIGRAPHSERVLET</servlet-name>
    <servlet-class>oracle.adfinternal.view.faces.bi.renderkit.graph.GraphServlet</servlet-class>
  </servlet>
  <servlet>
    <servlet-name>BIGAUGESERVLET</servlet-name>
    <servlet-class>oracle.adfinternal.view.faces.bi.renderkit.gauge.GaugeServlet</servlet-class>
  </servlet>
  <servlet>
    <servlet-name>MapProxyServlet</servlet-name>
    <servlet-class>oracle.adfinternal.view.faces.bi.renderkit.geoMap.servlet.MapProxyServlet</servlet-class>
  </servlet>
  <servlet>
    <servlet-name>GatewayServlet</servlet-name>
    <servlet-class>oracle.adfinternal.view.faces.bi.renderkit.graph.FlashBridgeServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>resources</servlet-name>
    <url-pattern>/adf/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>resources</servlet-name>
    <url-pattern>/afr/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>BIGRAPHSERVLET</servlet-name>
    <url-pattern>/servlet/GraphServlet/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>BIGAUGESERVLET</servlet-name>
    <url-pattern>/servlet/GaugeServlet/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>MapProxyServlet</servlet-name>
    <url-pattern>/mapproxy/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>resources</servlet-name>
    <url-pattern>/bi/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>GatewayServlet</servlet-name>
    <url-pattern>/flashbridge/*</url-pattern>
  </servlet-mapping>
  <mime-mapping>
    <extension>swf</extension>
    <mime-type>application/x-shockwave-flash</mime-type>
  </mime-mapping>
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>constraint1</web-resource-name>
      <url-pattern>*</url-pattern>
    </web-resource-collection>
  </security-constraint>
  <login-config>
    <auth-method>CLIENT-CERT</auth-method>
    <realm-name>default</realm-name>
  </login-config>
  <security-role>
    <description>javauser</description>
    <role-name>javauser</role-name>
  </security-role>
</web-app>
<weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd"
                  xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
  <security-role-assignment>
    <role-name>javauser</role-name>
    <principal-name>manager</principal-name>
  </security-role-assignment>
  <session-descriptor>
    <cookie-path>cloudTest1</cookie-path>
  </session-descriptor>
  <context-root>/cloudTest1</context-root>
</weblogic-web-app>

Does it work without security ? Does it work with "BASIC" authentication ? Which browser are you using, there have been authorization issues with CLIENT-CERT on IE. Try FF and clear your cookies / cache before accessing.
Jani Rautiainen
Fusion Applications Developer Relations
https://blogs.oracle.com/fadevrel/

Similar Messages

  • JDeveloper 11.1.1.3 has Bug "adrci.exe" when I Run ADF Applications

    Hi all
    my Environment is
    1- Windows XP Service pack 3
    2- Database 10g r10.2.0.4.0
    2- Jdev 11.1.1.3
    when I Run any ADF Applications, I got this error "adrci.exe"
    any solution for this error or this bugs from JDev 11.1.1.3?
    mugmug

    Hi Shay ;
    I did not get this error "adrci.exe" inside the WLS log file and
    when I Run ADF Application for the first time only I get this error "adrci.exe" in popup window;
    like the figure in this link:
    http://adfbugs.blogspot.com/2009/11/issues-after-migrating-our-application.html
    but when I run it again (next time) I do not get the error (only for first time)
    thanks

  • Error while running adf application(wrong post)

    Hi
    while running a simple adf application on jdev11g i am getting following error:
    ServerInstance1 startup time: 25355 ms.
    ServerInstance1 started.[Running application HRSystem on Server Instance ServerInstance1...]
    [12:52:51 AM] ---- Deployment started. ----
    [12:52:51 AM] Target platform is (Weblogic 10.3).
    [12:52:52 AM] Retrieving existing application information
    [12:52:53 AM] Running dependency analysis...
    [12:52:53 AM] Deploying 2 profiles...
    [12:52:55 AM] Wrote Web Application Module to C:\Users\Ami\AppData\Roaming\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\HRSystem\ViewControllerWebApp.war
    [12:52:55 AM] Wrote Enterprise Application Module to C:\Users\Ami\AppData\Roaming\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\HRSystem
    [12:52:55 AM] Deploying Application...
    <Feb 10, 2011 12:52:55 AM IST> <Error> <Deployer> <BEA-149132> <Split-dir application HRSystem can only be deployed to the Admin Server>
    <Feb 10, 2011 12:52:55 AM IST> <Warning> <Deployer> <BEA-149124> <Failures were detected while initiating deploy task for application 'HRSystem'. Error is: '[Deployer:149132] Split-dir application HRSystem can only be deployed to the Admin Server' >
    [12:52:55 AM] #### Deployment incomplete. ####
    [12:52:55 AM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
    #### Cannot run application HRSystem due to error deploying to ServerInstance1.
    Serverinstance1 is the Admin server application server name.HRSystem is the name of application.Please advice.
    Thanks

    It looks like some jasper library missing.
    java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.compiler.JspRuntimeContext
    Please make sure you have all dependent jasper libraries imported in your project.
    Thanks,
    Nantha

  • Error while running adf application

    Hi
    while running a simple adf application on jdev11g i am getting following error:
    ServerInstance1 startup time: 25355 ms.
    ServerInstance1 started.[Running application HRSystem on Server Instance ServerInstance1...]
    [12:52:51 AM] ---- Deployment started. ----
    [12:52:51 AM] Target platform is (Weblogic 10.3).
    [12:52:52 AM] Retrieving existing application information
    [12:52:53 AM] Running dependency analysis...
    [12:52:53 AM] Deploying 2 profiles...
    [12:52:55 AM] Wrote Web Application Module to C:\Users\Ami\AppData\Roaming\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\HRSystem\ViewControllerWebApp.war
    [12:52:55 AM] Wrote Enterprise Application Module to C:\Users\Ami\AppData\Roaming\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\HRSystem
    [12:52:55 AM] Deploying Application...
    <Feb 10, 2011 12:52:55 AM IST> <Error> <Deployer> <BEA-149132> <Split-dir application HRSystem can only be deployed to the Admin Server>
    <Feb 10, 2011 12:52:55 AM IST> <Warning> <Deployer> <BEA-149124> <Failures were detected while initiating deploy task for application 'HRSystem'. Error is: '[Deployer:149132] Split-dir application HRSystem can only be deployed to the Admin Server' >
    [12:52:55 AM] #### Deployment incomplete. ####
    [12:52:55 AM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
    #### Cannot run application HRSystem due to error deploying to ServerInstance1.
    Serverinstance1 is the Admin server application server name.HRSystem is the name of application.Please advice.
    Thanks

    It looks like some jasper library missing.
    java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.compiler.JspRuntimeContext
    Please make sure you have all dependent jasper libraries imported in your project.
    Thanks,
    Nantha

  • Error while running ADF application in integrated weblogic server

    Hi, I'm new to Jdeveloper. I'm using Jdeveloper 11, when i try to run a sample ADF application in Jdeveloper integrated weblogic server i am getting following errors. Can anyone help me how to fix it?
    [06:44:04 PM] Redeploying Application...
    <AzUtil> <getPermClassLoadingErrorMessage> Cannot instantiate permission class "oracle.fodemo.storefront.store.view.AccountPermission", target "AccountPermission", or actions "view" as defined in the system policy context.
    <ConfigureListener> <contextInitialized> Critical error during deployment:
    java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.compiler.JspRuntimeContext
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:169)
         at com.sun.faces.config.ConfigureListener.isJspTwoOne(ConfigureListener.java:624)
         at com.sun.faces.config.ConfigureListener.registerELResolverAndListenerWithJsp(ConfigureListener.java:649)
         at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:244)
         at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
         at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872)
         at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
         at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)
         at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
         at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
         at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
         at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
         at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)
         at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58)
         at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
         at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    <Oct 6, 2011 6:44:13 PM EDT> <Warning> <HTTP> <BEA-101162> <User defined listener com.sun.faces.config.ConfigureListener failed: java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.compiler.JspRuntimeContext.
    java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.compiler.JspRuntimeContext
         at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:294)
         at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
         Truncated. see log file for complete stacktrace
    Caused By: java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.compiler.JspRuntimeContext
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:169)
         at com.sun.faces.config.ConfigureListener.isJspTwoOne(ConfigureListener.java:624)
         at com.sun.faces.config.ConfigureListener.registerELResolverAndListenerWithJsp(ConfigureListener.java:649)
         at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:244)
         Truncated. see log file for complete stacktrace
    >
    <AzUtil> <getPermClassLoadingErrorMessage> Cannot instantiate permission class "oracle.fodemo.storefront.store.view.AccountPermission", target "AccountPermission", or actions "view" as defined in the system policy context.
    <Oct 6, 2011 6:44:14 PM EDT> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1317941045593' for task '0'. Error is: 'weblogic.application.ModuleException: '
    weblogic.application.ModuleException:
         at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1510)
         at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
         Truncated. see log file for complete stacktrace
    Caused By: java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.compiler.JspRuntimeContext
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:169)
         at com.sun.faces.config.ConfigureListener.isJspTwoOne(ConfigureListener.java:624)
         at com.sun.faces.config.ConfigureListener.registerELResolverAndListenerWithJsp(ConfigureListener.java:649)
         at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:244)
         Truncated. see log file for complete stacktrace
    >
    <Oct 6, 2011 6:44:14 PM EDT> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 1 task for the application 'StoreFrontModule'.>
    <Oct 6, 2011 6:44:14 PM EDT> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'StoreFrontModule'.>
    <Oct 6, 2011 6:44:14 PM EDT> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    weblogic.application.ModuleException:
         at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1510)
         at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
         Truncated. see log file for complete stacktrace
    Caused By: java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.compiler.JspRuntimeContext
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:169)
         at com.sun.faces.config.ConfigureListener.isJspTwoOne(ConfigureListener.java:624)
         at com.sun.faces.config.ConfigureListener.registerELResolverAndListenerWithJsp(ConfigureListener.java:649)
         at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:244)
         Truncated. see log file for complete stacktrace
    >
    Thanks,

    It looks like some jasper library missing.
    java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.compiler.JspRuntimeContext
    Please make sure you have all dependent jasper libraries imported in your project.
    Thanks,
    Nantha

  • Getting class not found error running java application using OIM libraries

    Hi,
    I have created a java application in which I access OIM libraries to fetch user list and then assign user roles. As i run the application it generates exception and program crashes. However, I am using the same libraries in OIM adapters and it is working fine. Following is the exception message i am getting.
    Caused by: java.lang.NoClassDefFoundError: org/springframework/jndi/JndiTemplate
    at oracle.iam.platform.OIMClient.<init>(OIMClient.java:83)
    at RoleAssignment.RoleAssignment.getUserAndChangePassword(RoleAssignment.java:143)
    at RoleAssignment.RoleAssignment.execute(RoleAssignment.java:81)
    at RoleAssignment.RoleAssignment.main(RoleAssignment.java:36)
    ... 5 more
    Caused by: java.lang.ClassNotFoundException: org.springframework.jndi.JndiTemplate
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

    Hi,
    I resolved the problem by making spring.jar part of my executable jar file. I have added oimclient.jar, spring.jar, wlfullclient.jar, commons-logging.jar, and eclipselink.jar part of my executable jar. Now I am getting the error below. I googled it and it mentioned that i should add path of authwl.conf in my run configuration in eclipse. So i added the following line in " -Djava.security.auth.login.config=/u01/oracle/Middleware/Oracle_IDM1/server/CustomExec/authwl.conf " under the VM Arguments section of run configuration, but it continues to give the same error.
    java.lang.SecurityException: Unable to locate a login configuration
         at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:93)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at java.lang.Class.newInstance0(Class.java:355)
         at java.lang.Class.newInstance(Class.java:308)
         at javax.security.auth.login.Configuration$3.run(Configuration.java:247)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.login.Configuration.getConfiguration(Configuration.java:242)
         at javax.security.auth.login.LoginContext$1.run(LoginContext.java:237)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.login.LoginContext.init(LoginContext.java:234)
         at javax.security.auth.login.LoginContext.<init>(LoginContext.java:403)
         at Thor.API.Security.LoginHandler.weblogicLoginHandler.login(weblogicLoginHandler.java:58)
         at oracle.iam.platform.OIMClient.login(OIMClient.java:134)
         at oracle.iam.platform.OIMClient.login(OIMClient.java:129)
         at com.infotech.tra.organization.RoleAssignment.getUserAndChangePassword(RoleAssignment.java:213)
         at com.infotech.tra.organization.RoleAssignment.execute(RoleAssignment.java:149)
         at com.infotech.tra.organization.RoleAssignment.main(RoleAssignment.java:49)
         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.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)
    Caused by: java.io.IOException: Unable to locate a login configuration
         at com.sun.security.auth.login.ConfigFile.init(ConfigFile.java:250)
         at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:91)
         ... 24 more

  • Error Deploying ADF application to ADF Server

    Hi Team,
    Iam unable to deploy the ADF application to server.
    The following is the log :
    *[08:25:11 PM] ---- Deployment started. ----*
    *[08:25:11 PM] Target platform is (Weblogic 10.3).*
    *[08:25:11 PM] Retrieving existing application information*
    *[08:25:11 PM] Running dependency analysis...*
    *[08:25:11 PM] Building...*
    *[08:25:15 PM] Deploying profile...*
    *[08:25:15 PM] Wrote Web Application Module to D:\sridhar\SampleADF\ADFWorld\ViewController\deploy\ADFWorld_ViewController_webapp1.war*
    *[08:25:15 PM] Deploying Application...*
    *[08:25:16 PM] [Deployer:149191]Operation 'deploy' on application 'ADFWorld_ViewController_webapp1' is initializing on 'ADFServer'*
    *[08:25:17 PM] [Deployer:149193]Operation 'deploy' on application 'ADFWorld_ViewController_webapp1' has failed on 'ADFServer'*
    *[08:25:17 PM] [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application ADFWorld_ViewController_webapp1 on ADFServer.: Failed to load webapp: 'ADFWorld_ViewController_webapp1.war'.*
    *[08:25:17 PM] Weblogic Server Exception: weblogic.application.ModuleException: Failed to load webapp: 'ADFWorld_ViewController_webapp1.war'*
    *[08:25:17 PM] Caused by: weblogic.management.DeploymentException: Error: Unresolved Webapp Library references for "ServletContext@6261447[app:ADFWorld_ViewController_webapp1 module:ADFWorld_ViewController_webapp1.war path:/ADFWorld spec-version:2.5]", defined in weblogic.xml [Extension-Name: adf.oracle.domain.webapp, exact-match: false], [Extension-Name: jstl, Specification-Version: 1.2, exact-match: false], [Extension-Name: jsf, Specification-Version: 1.2, exact-match: false]*
    *[08:25:17 PM] See server logs or server console for more details.*
    *[08:25:17 PM] weblogic.application.ModuleException: Failed to load webapp: 'ADFWorld_ViewController_webapp1.war'*
    *[08:25:17 PM] #### Deployment incomplete. ####*
    *[08:25:17 PM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)*
    Please suggest me what is the error.
    Regards
    Sridhar Yerram

    Hi Sridhar,
    Try to get more details from your Server related to Deployer:149026.
    This indicates failure of app due some issues on your services.
    paste the error stack to get the clue of issue.
    Regards,
    Kal

  • Error deploying adf application to weblogic

    hi am deploying my adf application using weblogic but am geting this error
    weblogic 10.3.5
    jeveloper is 11.1.6.0
    [12:14:21 PM] ----  Deployment started.  ----
    [12:14:21 PM] Target platform is  (Weblogic 10.3).
    [12:14:22 PM] Retrieving existing application information
    [12:14:22 PM] Running dependency analysis...
    [12:14:22 PM] Building...
    [12:14:32 PM] Deploying profile...
    [12:14:33 PM] Wrote Web Application Module to C:\JDeveloper\mywork\Align\ViewController\deploy\Align_ViewController_webapp.war
    [12:14:33 PM] Deploying Application...
    [12:14:35 PM] [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application Align_ViewController_webapp on AdminServer.: [Deployer:149145]Unable to contact 'madimad-b533821'. Deployment is deferred until 'madimad-b533821' becomes available.; nested exception is:
        java.rmi.UnknownHostException: Could not discover administration URL for server 'madimad-b533821'.
    [12:14:35 PM] [Deployer:149193]Operation 'deploy' on application 'Align_ViewController_webapp' has failed on 'AdminServer'
    [12:14:35 PM] [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application Align_ViewController_webapp on AdminServer.: Failed to load webapp: 'Align_ViewController_webapp.war'.
    [12:14:35 PM] Weblogic Server Exception: weblogic.application.ModuleException: Failed to load webapp: 'Align_ViewController_webapp.war'
    [12:14:35 PM] Caused by: java.lang.ClassNotFoundException: oracle.adf.model.servlet.ADFBindingFilter
    [12:14:35 PM]   See server logs or server console for more details.
    [12:14:35 PM] weblogic.application.ModuleException: Failed to load webapp: 'Align_ViewController_webapp.war'
    [12:14:35 PM] Deployment cancelled.
    [12:14:35 PM] ----  Deployment incomplete  ----.
    [12:14:35 PM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)

    Hi,
    ADF applications that use business components need the weblogic-application.xml deployment
    descriptor to be present to be able to work on a WLS.
    http://docs.oracle.com/cd/E12839_01/web.1111/b31974/deployment_topics.htm#CHDCICJH
    35.4 Creating and Editing Deployment Descriptors
    mentions the need of :
    <library-ref>
      <library-name>adf.oracle.domain</library-name>
    </library-ref>
    in the weblogic-application.xml
    ==> please execute the following steps:
    1. Wrap the WAR file in an EAR file configured to be deployed to a WebLogic server as follows, so that  JDeveloper includes the needed deployment descriptor file:
    2.Right-click the project containing the web contents (usually ViewController), and select New -> Deployment Profile. Then select EAR Deployment Profile.
    3. Enter the name for the application, and then in the EAR profile properties dialog, in the Application Assembly, include the ViewController project, and in the Platform node, make sure Default Platform is set to WebLogic 10.3. Click OK.
    4. In the next dialog box (Project properties), open the node ADF Model, and make sure the checkbox "Contains Data Controls" is checked, and click OK
    5. Now to deploy, right click the ViewController project and select Deploy, then the name of the recently created application deployment profile, and then "to EAR file". This will result in a .ear file, deployable from the WLS administration page.
    Thanks,
    Sharmela

  • Issue with Jdeveloper 11.1.1.2 while Running ADF Application - Reg

    Hi All,
    We are facing an issue while running an application in our Jdeveloper version 11.2 . The error is as follows :
    oracle.rc.asadapter.weblogic.context.spi.AppDeploymentProvider$1: Cannot establish connection.
         at oracle.rc.asadapter.weblogic.context.spi.AppDeploymentProvider.listBindingsImpl(AppDeploymentProvider.java:109)
         at oracle.rc.asadapter.context.spi.AbstractContextProvider.listBindings(AbstractContextProvider.java:133)
         at oracle.rc.asadapter.context.spi.DefaultMutableAppServerContext$ContextProviderSupport$3.method(DefaultMutableAppServerContext.java:384)
         at oracle.rc.asadapter.context.spi.DefaultMutableAppServerContext$ContextProviderSupport$MethodCall.invoke(DefaultMutableAppServerContext.java:421)
         at oracle.rc.asadapter.context.spi.DefaultMutableAppServerContext$ContextProviderSupport.listBindings(DefaultMutableAppServerContext.java:381)
         at oracle.rc.asadapter.context.spi.DefaultMutableAppServerContext$ContextProviderSupport.access$500(DefaultMutableAppServerContext.java:314)
         at oracle.rc.asadapter.context.spi.DefaultMutableAppServerContext.localListBindings(DefaultMutableAppServerContext.java:207)
         at oracle.rc.asadapter.context.spi.AbstractEventDirContext.listBindings(AbstractEventDirContext.java:185)
         at oracle.adf.rc.spi.jndi.AbstractDirContext.listBindings(AbstractDirContext.java:214)
         at oracle.rc.asadapter.context.spi.DefaultAppServerManageableContext.getManageables(DefaultAppServerManageableContext.java:58)
         at oracle.jdeveloper.asnav.nodes.DefaultManageableFolder.loadChildren(DefaultManageableFolder.java:327)
         at oracle.jdeveloper.asnav.nodes.DefaultManageableFolder$4.run(DefaultManageableFolder.java:288)
    Caused by: oracle.rc.asadapter.connection.ConnectionException: Cannot establish connection.
         at oracle.rc.asadapter.weblogic.connection.spi.Weblogic10Jsr160Provider.getPresentation(Weblogic10Jsr160Provider.java:73)
         at oracle.rc.asadapter.connection.AppServerConnectionImpl$PM.getPresentation(AppServerConnectionImpl.java:171)
         at oracle.rc.asadapter.weblogic.connection.spi.Weblogic10ServerMBeanModelImpl.getDomainRuntimeService(Weblogic10ServerMBeanModelImpl.java:59)
         at oracle.rc.asadapter.weblogic.context.spi.AppDeploymentProvider.listBindingsImpl(AppDeploymentProvider.java:71)
         ... 11 more
    Caused by: java.io.IOException
         at weblogic.management.remote.common.ClientProviderBase.makeConnection(ClientProviderBase.java:187)
         at weblogic.management.remote.common.ClientProviderBase.newJMXConnector(ClientProviderBase.java:81)
         at javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnectorFactory.java:338)
         at oracle.rc.asadapter.weblogic.connection.spi.Weblogic10Jsr160Provider.getPresentation(Weblogic10Jsr160Provider.java:67)
         ... 14 more
    Caused by: javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://127.0.0.1:7101: Destination unreachable; nested exception is:
         java.net.ConnectException: Connection refused: connect; No available router to destination]
         at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:40)
         at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:783)
         at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:365)
         at weblogic.jndi.Environment.getContext(Environment.java:315)
         at weblogic.jndi.Environment.getContext(Environment.java:285)
         at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
         at javax.naming.InitialContext.init(InitialContext.java:223)
         at javax.naming.InitialContext.<init>(InitialContext.java:197)
         at weblogic.management.remote.common.ClientProviderBase.makeConnection(ClientProviderBase.java:169)
         ... 17 more
    Caused by: java.net.ConnectException: t3://127.0.0.1:7101: Destination unreachable; nested exception is:
         java.net.ConnectException: Connection refused: connect; 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:344)
         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:339)
         ... 25 more
    Caused by: java.rmi.ConnectException: Destination unreachable; nested exception is:
         java.net.ConnectException: Connection refused: connect; 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:251)
         at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:194)
         at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:238)
         at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:200)
         ... 31 more
    Pointers in resolving this issue would help us a lot.
    Regards,
    Ramnath
    Edited by: Ramanatha Sharma on Aug 24, 2010 3:22 PM

    Hi,
    We have remove the file which you have specified ..but still having the issue..when we try to start the Integrated WLS server for the Jdev.Changed my subject line also..
    [Waiting for the domain to finish building...]
    [03:25:40 PM] Creating Integrated Weblogic domain...
    [03:26:25 PM] Error processing Integrated Weblogic domain:The Server Instance cannot be started because the Integrated Weblogic domain was not built successfully.
    The Server Instance cannot be started because the Integrated Weblogic domain was not built successfully.
    Regards,
    Ramnath

  • Unable to deploy/run adf application in jdeveloper/ satandalone server

    Hi
    I am trying to deploy a simple ADF application (Fusion Web application) in
    Jdeveloper IDE (Integrated WL server)  - In this case, the server state is changing to RUNNING but no signs that the application is deployed and no Target URL is seen.
    Deploying it on a standalone server: In  this case, I get the following error: Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer).
    Can anyone please suggest...
    Thanks a lot

    Hi Shay
    Thanks a ton for responding.
    My application is a basic taskflow app - to display the values of a form on the following page (splash page)...
    when I tried to deploy it on a stand alone wl server( 2nd case) - deployment status = Failed with the error message I mentioned above.
    a) i tried running on standalone using the jdeveloper and
    B) i took the war file and deployed it - I get the same error with Deployment Status = Failed.
    the strange part is that the same application is running fine on my friends machine - she is able to see the Target URL and the deployment is successful.

  • Row concurrency error in ADF application

    Hi,
    I recently moved my ADF application from 10.1.3 Rel2 to 10.1.3.4.0 SOA Rel3.
    Now I am frequently getting the following error.
    JBO-35007: Row currency has changed since the user interface was rendered. The expected row key was oracle.jbo.Key.
    Any help would be appreciated.
    Viki.

    Hi,
    I already fixed this problem.
    It was Date conversion problem.
    Instead of Date I used Timestamp.
    To investigate it I should look into some internals.
    How to turn on some additional logs?(That is why my question about Diagnostic class) , but nobody answered yet.
    Thanks.

  • Error in adf application

    I am using adf application with JDev 10.1.3. With oracle 10g works well.
    When I tried to use Oracle Lite- I got error
    JBO-26041: Failed to post data to database during "Update": SQL Statement "UPDATE S_CONTACT ContactEO SET LAST_UPD=?,LAST_UPD_BY=?,MODIFICATION_NUM=?,WORK_PH_NUM=? WHERE ROW_ID=?".
    SQL Exception : Unknown SQL Type for PreparedStatement.setObject (SQL Type=1111
    But the same statement works with Oracle and Oracle XE...
    Any suggestions?

    Hi,
    I already fixed this problem.
    It was Date conversion problem.
    Instead of Date I used Timestamp.
    To investigate it I should look into some internals.
    How to turn on some additional logs?(That is why my question about Diagnostic class) , but nobody answered yet.
    Thanks.

  • Error run web application designer 3.X

    hello forum,
    When I run the tool designer of the web application version 3.x.
    jumps the following error:
    Run-time error "75"
    Path / file access error.
    I have installed the patch:
    gui710_7-10002995.exe: Patch Level 7 for SAP Logon.
    bi710sp05_500-10004472.exe: BI Add-on 7.x, Support Package 5, Patch Level 5.
    And he still does not work, you know if I need to install any more patch or perform some sort of setup?
    A greeting and thanks.

    Hi,
    You are talking in the query designer?
    But that will only appear the result (with value) red or green or yellow, correct?
    The idea is not to show the value, only the light.
    Example:
    I have the following:
    Client|Value|
    11    | 10eur
    12    | 12eur
    13    | -2eur|
    The idea is to have the following:
    Client|Alert|
    11    |  Green
    12    |  Green
    13    |  Red
    Green to positive, red to negative, but only a light, no values displayed.
    Thanks!
    Edited by: Pedro Taveira on Nov 3, 2011 2:03 PM

  • Error running sample application

    Not able to run sample application. while compiling *.java files it's giving error oracle.ifs.bean.* not found. pls. suggest asap.

    Do you have your CLASSPATH setup correctly? Your CLASSPATH must include the iFS libraries if you want to compile anything. Read the devkit documentation for more info.

  • Errors running converted application (from applet)

    I've converted some codes (applet) into an application. When I run the application, I can see the GUI, but the application reports error as follows:
    Exception occurred during event dispatching:
    java.lang.NullPointerException
         at swarmCanvas.paint(Swarm.java:192)
         at sun.awt.RepaintArea.paint(RepaintArea.java:298)
         at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:196)
         at java.awt.Component.dispatchEventImpl(Component.java:2663)
         at java.awt.Component.dispatchEvent(Component.java:2497)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
    What I see is only the GUI less the animation that occurs when it was an applet. Could anyone offer me any suggestions or help? Thanks a lot.

    Here's my codes, many thanks:
    * Swarm.class
    * This is the major class of the swarm animation. The Swarm class is
    * responsible for initialising and coordinating the Flock, swarmCanvas,
    * and swarmPanel classes.
    * @see Flock.class
    * @see Bird.class
    * @see Barrier.class
    * @author Duncan Crombie
    * @version 2.02, 20 September 1997
    import java.awt.*;
    public class Swarm extends java.applet.Applet implements Runnable {
    Thread animator; // animation thread
    swarmCanvas arena; // display canvas
    swarmPanel controls; // control panel
    static int NUMBLUE = 15, NUMRED = 5, MAXPOP = 20;
    static double SPEED = 5.0;
    static int TURN = 15, MINDIST = 30, MAXDIST = 60;
    boolean paused = false;
    public void init() { // initialise applet components
    arena = new swarmCanvas();
    controls = new swarmPanel(NUMBLUE, NUMRED, MAXPOP);
    setLayout(new BorderLayout());
    add("Center", arena); // add canvas to applet at 'Center'
    add("South", controls); // add panel to applet at 'South'
    arena.requestFocus();
    public void start() { // start thread when applet starts
    if (animator == null) {
    animator = new Thread(this);
    animator.start();
    public void stop() { // stop thread when applet stops
    if (animator != null) {
    animator.stop();
    animator = null;
    public void run() {
    boolean flocking = false;
    while (true) {
    if (!flocking && arena.unpacked) { // once canvas component is unpacked
    Bird.setBoundaries(arena.w, arena.h); // set swarm boundaries
    arena.flock = new Flock(NUMBLUE, NUMRED, SPEED, TURN, MINDIST, MAXDIST);
    flocking = true;
    } else if (flocking) {
    Bird.setBoundaries(arena.w, arena.h);
    if (!paused)
    arena.flock.move(); // animate the flock
    arena.repaint(); // update display
    try {
    Thread.sleep(20); // interval between steps
    } catch (InterruptedException e) {}
    public boolean handleEvent(Event ev) { // check for control panel actions
    if (ev.id == Event.ACTION_EVENT && ev.target == controls.reset) {
    resetApplet(); // reset button pressed in controls
    return true;
    if (ev.id == Event.ACTION_EVENT && ev.target == controls.pause) {
    paused = !paused; // toggle paused status
    controls.pause.setLabel((paused) ? "Continue" : "Pause");
    return true;
    if (ev.target == controls.sbRed) {
    if (ev.id == Event.SCROLL_LINE_UP)
    arena.flock.removeBird(Color.red); // remove a red Bird from flock
    else if (ev.id == Event.SCROLL_LINE_DOWN)
    arena.flock.addBird(new Bird(Color.red)); // add a red Bird
    return true;
    if (ev.target == controls.sbBlue) {
    if (ev.id == Event.SCROLL_LINE_UP)
    arena.flock.removeBird(Color.blue); // remove a blue Bird from flock
    else if (ev.id == Event.SCROLL_LINE_DOWN)
    arena.flock.addBird(new Bird(Color.blue)); // add a blue Bird
    return true;
    return super.handleEvent(ev); // pass on unprocessed events
    public boolean keyDown(Event e, int x) { // check for key press
    boolean shiftKeyDown = ((e.modifiers & Event.SHIFT_MASK) != 0);
    if (shiftKeyDown) {
    if (x == Event.DOWN) Flock.minDISTANCE -= 5; // less separation
    if (x == Event.UP) Flock.minDISTANCE += 5; // more separation
    if (x == Event.LEFT) Flock.maxDISTANCE -= 5; // lower detection
    if (x == Event.RIGHT) Flock.maxDISTANCE += 5; // higher detection
    Barrier.minRANGE = Flock.minDISTANCE;
    Barrier.maxRANGE = Flock.maxDISTANCE;
    } else {
    if (x == Event.DOWN) Bird.maxSPEED -= 1.0; // slower
    if (x == Event.UP) Bird.maxSPEED += 1.0; // faster
    if (x == Event.LEFT) Bird.maxTURN -= 5; // less turning
    if (x == Event.RIGHT) Bird.maxTURN += 5; // more turning
    return true; // all key events handled
    public void resetApplet() {
    arena.flock = new Flock(NUMBLUE, NUMRED, SPEED, TURN, MINDIST, MAXDIST);
    controls.sbBlue.setValue(NUMBLUE); // initialise scrollbars
    controls.sbRed.setValue(NUMRED);
    * swarmPanel.class
    * A Panel holding two scrollbars and two buttons for controlling the
    * Swarm applet.
    * @see Swarm.class
    * @author Duncan Crombie
    * @version 2.01, 20 September 1997
    class swarmPanel extends Panel { // class defines applet control panel
    Button reset, pause;
    Scrollbar sbBlue = new Scrollbar(Scrollbar.HORIZONTAL);
    Scrollbar sbRed = new Scrollbar(Scrollbar.HORIZONTAL);
    Label label1, label2;
    * The construction method creates and adds control panel components
    swarmPanel(int numRed, int numBlue, int maxBoid) {
    setLayout(new GridLayout(2, 3)); // define 2 x 3 grid layout for controls
    label1 = new Label("Blue #");
    label1.setFont(new Font("Dialog", Font.PLAIN, 12)); add(label1);
    label2 = new Label("Red #");
    label2.setFont(new Font("Dialog", Font.PLAIN, 12)); add(label2);
    reset = new Button("Reset"); add(reset);
    sbBlue.setValues(numRed, 1, 0, maxBoid);
    add(sbBlue);
    sbRed.setValues(numBlue, 1, 0, maxBoid);
    add(sbRed);
    pause = new Button("Pause");
    add(pause);
    * swarmCanvas.class
    * A Canvas for displaying the Flock and Swarm parameters.
    * @see Swarm.class
    * @author Duncan Crombie
    * @version 2.01, 20 September 1997
    class swarmCanvas extends Canvas {
    Flock flock;
    Image offScrImg;
    boolean unpacked = false;
    int w, h;
    /* Double buffered graphics */
    public void update(Graphics g) {
    if (offScrImg == null || offScrImg.getWidth(this) != w || offScrImg.getHeight(this) != h)
    offScrImg = createImage(w, h);
    Graphics og = offScrImg.getGraphics();
    paint(og);
    g.drawImage(offScrImg, 0, 0, this);
    og.dispose();
    public void paint(Graphics g) {
    Dimension d = this.preferredSize();
    if (!unpacked) {
    this.w = d.width;
    this.h = d.height;
    unpacked = true;
    g.setColor(Color.white);
    g.fillRect(0, 0, w, h); // draw white background
    g.setColor(Color.black); // set font and write applet parameters
    g.setFont(new Font("Dialog", Font.PLAIN, 10));
    g.drawString("Bird Speed: " + Bird.maxSPEED, 10, 15);
    g.drawString("Bird Turning: " + Bird.maxTURN, 10, 30);
    g.drawString("Minimum Distance: " + Flock.minDISTANCE, 10, 45);
    g.drawString("Maximum Distance: " + Flock.maxDISTANCE, 10, 60);
    flock.display(g); // draw Flock members
    if (this.w != d.width || this.h != d.height)
    unpacked = false;
    public boolean mouseDown(Event ev, int x, int y) {
    int radius = Barrier.maxRANGE;
    boolean top, bottom;
    flock.addBird(new Barrier(x, y)); // place Barrier at click coordinates
    top = (y < radius);
    bottom = (y > h-radius);
    if (x < radius) { // if left
    flock.addBird(new Barrier(w + x, y));
    if (top) flock.addBird(new Barrier(w + x, h + y));
    else if (bottom) flock.addBird(new Barrier(w + x, y - h));
    } else if (x > w-radius) { // if right
    flock.addBird(new Barrier(x - w, y));
    if (top) flock.addBird(new Barrier(x - w, h + y));
    else if (bottom) flock.addBird(new Barrier(x - w, y - h));
    if (top) flock.addBird(new Barrier(x, h + y));
    else if (bottom) flock.addBird(new Barrier(x, y - h));
    return true;
    ===================================================================
    * Bird.class
    * This class defines the appearance and behaviour of a Bird object.
    * @see Swarm.class
    * @see Flock.class
    * @see Barrier.class
    * @author Duncan Crombie
    * @version 2.02, 21 September 1997
    import java.awt.*;
    class Bird {
    int iX, iY, iTheta;
    Color cFeathers;
    static int arenaWIDTH, arenaHEIGHT; // canvas dimensions
    static double maxSPEED; // speed of Bird
    static int maxTURN; // maximum turn in degrees
    Bird(int x, int y, int theta, Color feath) {
    iX = x;
    iY = y;
    iTheta = theta;
    cFeathers = feath;
    Bird(Color feath) {
    this((int)(Math.random() * arenaWIDTH),
    (int)(Math.random() * arenaHEIGHT),
    (int)(Math.random() * 360),
    feath);
    public void move(int iHeading) {
    int iChange = 0;
    int left = (iHeading - iTheta + 360) % 360;
    int right = (iTheta - iHeading + 360) % 360;
    if (left < right)
    iChange = Math.min(maxTURN, left);
    else
    iChange = -Math.min(maxTURN, right);
    iTheta = (iTheta + iChange + 360) % 360;
    iX += (int)(maxSPEED * Math.cos(iTheta * Math.PI/180)) + arenaWIDTH;
    iX %= arenaWIDTH;
    iY -= (int)(maxSPEED * Math.sin(iTheta * Math.PI/180)) - arenaHEIGHT;
    iY %= arenaHEIGHT;
    public void display(Graphics g) { // draw Bird as a filled arc
    g.setColor(this.cFeathers);
    g.fillArc(iX - 12, iY - 12, 24, 24, iTheta + 180 - 15, 30);
    public int getDistance(Bird bOther) {
    int dX = bOther.getPosition().x-iX;
    int dY = bOther.getPosition().y-iY;
    return (int)Math.sqrt(Math.pow(dX, 2) + Math.pow(dY, 2));
    static void setBoundaries(int w, int h) {
    arenaWIDTH = w;
    arenaHEIGHT = h;
    public int getTheta() {
    return iTheta;
    public Point getPosition() {
    return new Point(iX, iY);
    public Color getFeathers() {
    return cFeathers;
    =================================================================
    * Flock.class
    * This class creates and coordinates the movement of a flock of Birds.
    * @see Swarm.class
    * @see Bird.class
    * @see Barrier.class
    * @author Duncan Crombie
    * @version 2.02, 21 September 1997
    import java.util.Vector;
    import java.awt.*;
    class Flock { // implement swarming algorithm on flock of birds
    private Vector vBirds;
    static int minDISTANCE, maxDISTANCE;
    Flock(int nBlue, int nRed, double speed, int turn, int minDist, int maxDist) {
    vBirds = new Vector(5, 5);
    for (int i=0; i < nBlue + nRed; i++)
    addBird(new Bird((i < nBlue) ? Color.blue : Color.red));
    Bird.maxSPEED = speed;
    Bird.maxTURN = turn;
    Barrier.minRANGE = minDISTANCE = minDist;
    Barrier.maxRANGE = maxDISTANCE = maxDist;
    public void addBird(Bird bird) { // add Bird to vector
    vBirds.addElement(bird);
    synchronized void removeBird(Color col) { // remove Bird from vector
    for (int i=0; i < vBirds.size(); i++) { // loop through vector of Birds
    Bird bTemp = (Bird)vBirds.elementAt(i);
    if (bTemp.getFeathers() == col) { // search for Bird of given colour
    vBirds.removeElementAt(i); // if found, remove Bird..
    break; // ..and stop searching
    * The move function simply tells each Bird in the Vector vBirds to move
    * according to the resultant Point of generalHeading.
    synchronized public void move() {
    for (int i=0; i < vBirds.size(); i++) {
    Bird bTemp = (Bird)vBirds.elementAt(i);
    bTemp.move(generalHeading(bTemp));
    * The display function simply draws each Bird in the Vector vBirds at its
    * current position.
    public void display(Graphics g) { // display each Bird in flock
    for (int i=0; i < vBirds.size(); i++) {
    Bird bTemp = (Bird)vBirds.elementAt(i);
    bTemp.display(g);
    public Point sumPoints(Point p1, double w1, Point p2, double w2) {
    return new Point((int)(w1*p1.x + w2*p2.x), (int)(w1*p1.y + w2*p2.y));
    public double sizeOfPoint(Point p) {
    return Math.sqrt(Math.pow(p.x, 2) + Math.pow(p.y, 2));
    public Point normalisePoint(Point p, double n) {
    if (sizeOfPoint(p) == 0.0) return p;
    else {
    double weight = n / sizeOfPoint(p);
    return new Point((int)(p.x * weight), (int)(p.y * weight));
    * The generalHeading function determines the point a Bird will turn towards
    * in the next timestep. The Bird b checks for all Birds (other than self)
    * that fall within the detection range. If the Bird is of a different colour
    * or closer than the separation distance then they are repulsed else the
    * Birds are attracted according to the flocking algorithm.
    private int generalHeading(Bird b) {
    if (b instanceof Barrier) return 0;
    Point pTarget = new Point(0, 0);
    int numBirds = 0; // total of Birds to average
    for (int i=0; i < vBirds.size(); i++) { // for each Bird in array
    Bird bTemp = (Bird)vBirds.elementAt(i); // retrieve element i
    int distance = b.getDistance(bTemp); // get distance to Bird
    if (!b.equals(bTemp) && distance > 0 && distance <= maxDISTANCE) {
    * If the neighbour is a sibling the algorithm tells the boid to align its
    * direction with the other Bird. If the distance between them differs from
    * minDISTANCE then a weighted forces is applied to move it towards that
    * distance. This force is stronger when the boids are very close or towards
    * the limit of detection.
    if (b.getFeathers().equals(bTemp.getFeathers())) { // if same colour
    Point pAlign = new Point((int)(100 * Math.cos(bTemp.getTheta() * Math.PI/180)), (int)(-100 * Math.sin(bTemp.getTheta() * Math.PI/180)));
    pAlign = normalisePoint(pAlign, 100); // alignment weight is 100
    boolean tooClose = (distance < minDISTANCE);
    double weight = 200.0;
    if (tooClose) weight *= Math.pow(1 - (double)distance/minDISTANCE, 2);
    else weight *= - Math.pow((double)(distance-minDISTANCE) / (maxDISTANCE-minDISTANCE), 2);
    Point pAttract = sumPoints(bTemp.getPosition(), -1.0, b.getPosition(), 1.0);
    pAttract = normalisePoint(pAttract, weight); // weight is variable
    Point pDist = sumPoints(pAlign, 1.0, pAttract, 1.0);
    pDist = normalisePoint(pDist, 100); // final weight is 100
    pTarget = sumPoints(pTarget, 1.0, pDist, 1.0);
    * In repulsion the target point moves away from the other Bird with a force
    * that is weighted according to a distance squared rule.
    else { // repulsion
    Point pDist = sumPoints(b.getPosition(), 1.0, bTemp.getPosition(), -1.0);
    pDist = normalisePoint(pDist, 1000);
    double weight = Math.pow((1 - (double)distance/maxDISTANCE), 2);
    pTarget = sumPoints(pTarget, 1.0, pDist, weight); // weight is variable
    numBirds++;
    if (numBirds == 0) return b.getTheta();
    else // average target points and add to position
    pTarget = sumPoints(b.getPosition(), 1.0, pTarget, 1/(double)numBirds);
    int targetTheta = (int)(180/Math.PI * Math.atan2(b.getPosition().y - pTarget.y, pTarget.x - b.getPosition().x));
    return (targetTheta + 360) % 360; // angle for Bird to steer towards
    ======================================================================
    * Barrier.class
    * This class creates and coordinates the movement of a flock of Birds.
    * @see Swarm.class
    * @see Flock.class
    * @see Bird.class
    * @author Duncan Crombie
    * @version 2.01, 21 September 1997
    import java.awt.*;
    class Barrier extends Bird {
    static int minRANGE, maxRANGE;
    Barrier(int x, int y) {
    super(x, y, 0, Color.black); // position Barrier and define color as black
    public void move(int dummy) {
    // do nothing
    public void display(Graphics g) { // paint Barrier
    g.setColor(Color.black);
    g.fillOval(this.iX-5, this.iY-5, 10, 10);
    g.setColor(Color.gray); // paint separation circle
    g.drawOval(this.iX-minRANGE, this.iY-minRANGE, 2*minRANGE, 2*minRANGE);
    g.setColor(Color.lightGray); // paint detection circle
    g.drawOval(this.iX-maxRANGE, this.iY-maxRANGE, 2*maxRANGE, 2*maxRANGE);
    =====================================================================
    import java.awt.*;
    import java.awt.event.*;
    public class SwarmFrame extends Frame implements ActionListener {
    public SwarmFrame() {
    super("Flocking Bird");
    MenuBar mb = new MenuBar();
    setMenuBar(mb);
    Menu fileMenu = new Menu("File");
    mb.add(fileMenu);
    MenuItem exitMenuItem = new MenuItem("Exit");
    fileMenu.add(exitMenuItem);
    exitMenuItem.addActionListener(this);
    Swarm swarmApplet = new Swarm();
    add(swarmApplet, BorderLayout.CENTER);
    swarmApplet.init();
    public void actionPerformed(ActionEvent evt) {
    if(evt.getSource() instanceof MenuItem) {
    String menuLabel = ((MenuItem) evt.getSource()).getLabel();
    if(menuLabel.equals("Exit")) {
    dispose();
    System.exit(0);
    =====================================================================
    import java.awt.*;
    public class SwarmApplication {
    public static void main(String[] args) {
    Frame frame = new SwarmFrame();
    frame.setBounds(10, 10, 600, 400);
    frame.setVisible(true);

Maybe you are looking for