TopLink - create dynamically session login ?
Hi all,
pls, how can I create dynamically login to database?
I use toplink workbench and in this step 6: [http://www.oracle.com/technology/products/ias/toplink/doc/11110/tutorial/intro/standalone/intro_tutorial010.htm#CIHIHIFF] I do not check "save Login and Password" ...
If I set static user and password, everthing works fine, bud i need created login dynamically.. my code is:
+protected void createSession() throws Exception {+
System.setProperty("toplink.xml.platform", "oracle.toplink.platform.xml.jaxp.JAXPPlatform");
XMLSessionConfigLoader loader = new XMLSessionConfigLoader(getSessionsXmlPath());
SessionManager mgr = oracle.toplink.tools.sessionmanagement.SessionManager.getManager();
session.setLogin(applyLogin());
session = (ServerSession)mgr.getSession(loader, getSessionName(), Thread.currentThread().getContextClassLoader(), true, true);
+}+
+private DatabaseLogin applyLogin(){+
DatabaseLogin login = new DatabaseLogin();
login.usePlatform(new oracle.toplink.platform.database.oracle.Oracle8Platform());
login.setDriverClassName("oracle.jdbc.OracleDriver");
login.setConnectionString("path"); //jdbc:oracle:thin:@HOST:PORT:SID - path is OK (but its SECRET) :-)
login.setUserName("user"); //USER NAME - user is OK, but secred ;-)
login.setEncryptedPassword("pass"); //PASSWORD, ENCRYPTED password is OK ;-)
return login;
+}+
but it still returns java.lang.NullPointerException! If i set in TopLink workbench user and password, so it works..
Any ideas, how set login in Java, pls?
Sry for my English..
Thanks advance!
Bes regards, KLD
Well,
now it's works, but I have still one problem :(
If I create a session in the TopLink Benchmark, and I don't save a user and user's password in the connection to the DB (in Benchmark when I create Login in session.. - and this I don't want to save user and password!) the sessions is created OK:
session = (ServerSession)mgr.getSession(loader, getSessionName(), Thread.currentThread().getContextClassLoader(), false, true);
Login is created OK:
session.setLogin(myLogin());
+private DatabaseLogin myLogin(){+
DatabaseLogin login = new DatabaseLogin();
login.usePlatform(new oracle.toplink.platform.database.oracle.Oracle11Platform());
login.setDriverClassName("oracle.jdbc.driver.OracleDriver");
login.setConnectionString("xxx"); //jdbc:oracle:thin:@HOST:PORT:SID
login.setUserName("xxx"); //USER NAME
login.setEncryptedPassword(xxx"); //PASSWORD, ENCRYPTED
return login;
+}+
But If I want login to the DB with this login and session:
session.login();
Then return java.lang.NullPointerException
and in console is write:
*Exception [TOPLINK-4002] (Oracle TopLink - 11g (11.1.1.0.0) (Build 080909)): oracle.toplink.exceptions.DatabaseException*
Internal Exception: java.sql.SQLException: call invalid arguments
Error Code: 17433
But I don't now how? If i save user and password in benchmark, everthing works fine...
Any ideas, pls?
Thanks advance!
Sry for my English...
Best regards, KLD.
Similar Messages
-
JDeveloper 11g R1 Toplink Session Login Problem
Hi Everyone,
Toplink Session Login are unsuccessful in my application. My session.xml file gives xml validation errors.
Please help me,
Best Regards
Gokmen
XML Validation errors :
element primary-project not expected.
element login not expected.
element connection-pools not expected.
My session.xml file here:
<?xml version="1.0" encoding="windows-1254"?>
<toplink-sessions version="11g Release 1 (11.1.1.1.0)" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<session xsi:type="server-session">
<name>AnahtarV3</name>
<server-platform xsi:type="weblogic-10-platform"/>
<primary-project xsi:type="xml">META-INF/ToplinkMap.xml</primary-project>
<login xsi:type="database-login">
<platform-class>oracle.toplink.platform.database.oracle.Oracle11Platform</platform-class>
<user-name>xxxx</user-name>
<password>7D39547AAAC98C485237BC9ABBBAEFBA</password>
<sequencing>
<default-sequence xsi:type="native-sequence">
<preallocation-size>1</preallocation-size>
</default-sequence>
</sequencing>
<driver-class>oracle.jdbc.OracleDriver</driver-class>
<connection-url>jdbc:oracle:thin:@xx.yyyy.www:1521:zzzz</connection-url>
<force-field-names-to-upper-case>true</force-field-names-to-upper-case>
<optimize-data-conversion>true</optimize-data-conversion>
<trim-strings>false</trim-strings>
</login>
<connection-pools>
<read-connection-pool>
<name>read</name>
<max-connections>1</max-connections>
<min-connections>1</min-connections>
<login xsi:type="database-login">
<user-name>bonus</user-name>
<password>C9AB9547D3AC98C485237B7AABBAEFBA</password>
<driver-class>oracle.jdbc.OracleDriver</driver-class>
<connection-url>jdbc:oracle:thin:@oratest.boyner.trk:1521:bdbtest</connection-url>
</login>
</read-connection-pool>
<write-connection-pool>
<max-connections>1</max-connections>
<min-connections>1</min-connections>
</write-connection-pool>
</connection-pools>
</session>
</toplink-sessions>
Console Error Log:
Exception Description: Several [3] SessionLoaderExceptions were thrown:
org.xml.sax.SAXParseException: <Line 35, Column 30>: XML-24534: (Error) Element 'max-connections' not expected.
org.xml.sax.SAXParseException: <Line 36, Column 30>: XML-24534: (Error) Element 'min-connections' not expected.
org.xml.sax.SAXParseException: <Line 37, Column 34>: XML-24521: (Error) Element not completed: 'write-connection-pool'Hi Gokmen,
Enhancement for clearing the design time errors by providing support for xsi:type is planned for the Shepherd release.
The workaround for the Connection Pool errors is to define using the API.Below sample code can be useful for you.
Create a class which implements SessionEventListener or extend SessionEventAdapter and override the preLogin(SessionEvent event) and define read and write connections in the method.Register the SessionEventListener with session(open the session.xml in JDeveloper flat editor->Options->EventListener->browse and Select the class).
When application is run and preLogin() event will be called and connection pool is defined with read and write connections.
package model;
import org.eclipse.persistence.sessions.SessionEvent;
import org.eclipse.persistence.sessions.SessionEventAdapter;
public class SampleEventListener extends SessionEventAdapter {
public SampleEventListener() {
super();
public void preLogin(SessionEvent event) {
System.out.println("in the pre login method");
org.eclipse.persistence.sessions.server.ServerSession serverSession=(org.eclipse.persistence.sessions.server.ServerSession)event.getSession();
serverSession.addConnectionPool("testReadPool", event.getSession().getDatasourceLogin(), 1, 10);
public void postLogin(SessionEvent event) {
org.eclipse.persistence.sessions.server.ServerSession serverSession=(org.eclipse.persistence.sessions.server.ServerSession)event.getSession();
System.out.println(serverSession.getConnectionPool("testReadPool").getMaxNumberOfConnections());
System.out.println(serverSession.getConnectionPool("testReadPool").getMinNumberOfConnections());
Hope this helps.
Regards,
P.Vinay Kumar -
SSL VPN, "Login failed" and "WebVPN: error creating WebVPN session!"
Hi,
Just ran the wizard for Anyconnect SSL VPN, created a tunnel group, a vpn pool and added user to it. When trying to logon on the SSL service, it simply says "login failed". I suspect that the user might not be in correct groups or so?
some relevant config
webvpn
enable wan
svc image disk0:/anyconnect-win-2.4.1012-k9.pkg 1
svc enable
group-policy vpnpolicy1 internal
group-policy vpnpolicy1 attributes
vpn-tunnel-protocol svc
tunnel-group admins type remote-access
tunnel-group admins general-attributes
address-pool sslpool2
default-group-policy vpnpolicy1
username myuser password 1234567890 encrypted privilege 15
username myuser attributes
vpn-group-policy vpnpolicy1
Debug:
asa01# debug webvpn 255
INFO: debug webvpn enabled at level 255.
asa01# webvpn_allocate_auth_struct: net_handle = CD5734D0
webvpn_portal.c:ewaFormSubmit_webvpn_login[3203]
webvpn_portal.c:webvpn_login_validate_net_handle[2234]
webvpn_portal.c:webvpn_login_allocate_auth_struct[2254]
webvpn_portal.c:webvpn_login_assign_app_next[2272]
webvpn_portal.c:webvpn_login_cookie_check[2289]
webvpn_portal.c:webvpn_login_set_tg_buffer_from_form[2325]
webvpn_portal.c:webvpn_login_transcend_cert_auth_cookie[2359]
webvpn_login_transcend_cert_auth_cookie: tg_cookie = NULL, tg_name =
webvpn_portal.c:webvpn_login_set_tg_cookie_form[2421]
webvpn_portal.c:webvpn_login_set_tg_cookie_querry_string[2473]
webvpn_portal.c:webvpn_login_resolve_tunnel_group[2546]
webvpn_login_resolve_tunnel_group: tgCookie = NULL
webvpn_login_resolve_tunnel_group: tunnel group name from default
webvpn_login_resolve_tunnel_group: TG_BUFFER = DefaultWEBVPNGroup
webvpn_portal.c:webvpn_login_negotiate_client_cert[2636]
webvpn_portal.c:webvpn_login_check_cert_status[2733]
webvpn_portal.c:webvpn_login_cert_only[2774]
webvpn_portal.c:webvpn_login_primary_username[2796]
webvpn_portal.c:webvpn_login_primary_password[2878]
webvpn_portal.c:webvpn_login_secondary_username[2910]
webvpn_portal.c:webvpn_login_secondary_password[2988]
webvpn_portal.c:webvpn_login_extra_password[3021]
webvpn_portal.c:webvpn_login_set_cookie_flag[3040]
webvpn_portal.c:webvpn_login_set_auth_group_type[3063]
webvpn_login_set_auth_group_type: WEBVPN_AUTH_GROUP_TYPE = 4
webvpn_portal.c:webvpn_login_aaa_not_resuming[3137]
webvpn_portal.c:http_webvpn_kill_cookie[790]
webvpn_auth.c:http_webvpn_pre_authentication[2321]
WebVPN: calling AAA with ewsContext (-867034168) and nh (-849922864)!
webvpn_add_auth_handle: auth_handle = 17
WebVPN: started user authentication...
webvpn_auth.c:webvpn_aaa_callback[5138]
WebVPN: AAA status = (ACCEPT)
webvpn_portal.c:ewaFormSubmit_webvpn_login[3203]
webvpn_portal.c:webvpn_login_validate_net_handle[2234]
webvpn_portal.c:webvpn_login_allocate_auth_struct[2254]
webvpn_portal.c:webvpn_login_assign_app_next[2272]
webvpn_portal.c:webvpn_login_cookie_check[2289]
webvpn_portal.c:webvpn_login_set_tg_buffer_from_form[2325]
webvpn_portal.c:webvpn_login_transcend_cert_auth_cookie[2359]
webvpn_login_transcend_cert_auth_cookie: tg_cookie = NULL, tg_name =
webvpn_portal.c:webvpn_login_set_tg_cookie_form[2421]
webvpn_portal.c:webvpn_login_set_tg_cookie_querry_string[2473]
webvpn_portal.c:webvpn_login_resolve_tunnel_group[2546]
webvpn_portal.c:webvpn_login_negotiate_client_cert[2636]
webvpn_portal.c:webvpn_login_check_cert_status[2733]
webvpn_portal.c:webvpn_login_cert_only[2774]
webvpn_portal.c:webvpn_login_primary_username[2796]
webvpn_portal.c:webvpn_login_primary_password[2878]
webvpn_portal.c:webvpn_login_secondary_username[2910]
webvpn_portal.c:webvpn_login_secondary_password[2988]
webvpn_portal.c:webvpn_login_extra_password[3021]
webvpn_portal.c:webvpn_login_set_cookie_flag[3040]
webvpn_portal.c:webvpn_login_set_auth_group_type[3063]
webvpn_login_set_auth_group_type: WEBVPN_AUTH_GROUP_TYPE = 4
webvpn_portal.c:webvpn_login_aaa_resuming[3093]
webvpn_auth.c:http_webvpn_post_authentication[1485]
WebVPN: user: (myuser) authenticated.
webvpn_auth.c:http_webvpn_auth_accept[2938]
webvpn_session.c:http_webvpn_create_session[184]
WebVPN: error creating WebVPN session!
webvpn_remove_auth_handle: auth_handle = 17
webvpn_free_auth_struct: net_handle = CD5734D0
webvpn_allocate_auth_struct: net_handle = CD5734D0
webvpn_free_auth_struct: net_handle = CD5734D0AnyConnect says:
"The secure gateway has rejected the agents VPN connect or reconnect request. A new connection requires re-authentication and must be started manually. Please contact your network administrator if this problem persists.
The following message was received from the secure gateway: Host or network is 0"
Other resources indicate that it's either the tunnel group, or the address pool.. The address pool is:
ip local pool sslpool2 172.16.20.0-172.16.20.254 mask 255.255.255.0
asa01# debug webvpn 255
INFO: debug webvpn enabled at level 255.
asa01# debug http 255
debug http enabled at level 255.
asa01# webvpn_allocate_auth_struct: net_handle = CE9C3208
webvpn_portal.c:ewaFormSubmit_webvpn_login[3203]
webvpn_portal.c:webvpn_login_validate_net_handle[2234]
webvpn_portal.c:webvpn_login_allocate_auth_struct[2254]
webvpn_portal.c:webvpn_login_assign_app_next[2272]
webvpn_portal.c:webvpn_login_cookie_check[2289]
webvpn_portal.c:webvpn_login_set_tg_buffer_from_form[2325]
webvpn_portal.c:webvpn_login_transcend_cert_auth_cookie[2359]
webvpn_login_transcend_cert_auth_cookie: tg_cookie = NULL, tg_name =
webvpn_portal.c:webvpn_login_set_tg_cookie_form[2421]
webvpn_portal.c:webvpn_login_set_tg_cookie_querry_string[2473]
webvpn_portal.c:webvpn_login_resolve_tunnel_group[2546]
webvpn_login_resolve_tunnel_group: tgCookie = NULL
webvpn_login_resolve_tunnel_group: tunnel group name from default
webvpn_login_resolve_tunnel_group: TG_BUFFER = DefaultWEBVPNGroup
webvpn_portal.c:webvpn_login_negotiate_client_cert[2636]
webvpn_portal.c:webvpn_login_check_cert_status[2733]
webvpn_portal.c:webvpn_login_cert_only[2774]
webvpn_portal.c:webvpn_login_primary_username[2796]
webvpn_portal.c:webvpn_login_primary_password[2878]
webvpn_portal.c:webvpn_login_secondary_username[2910]
webvpn_portal.c:webvpn_login_secondary_password[2988]
webvpn_portal.c:webvpn_login_extra_password[3021]
webvpn_portal.c:webvpn_login_set_cookie_flag[3040]
webvpn_portal.c:webvpn_login_set_auth_group_type[3063]
webvpn_login_set_auth_group_type: WEBVPN_AUTH_GROUP_TYPE = 4
webvpn_portal.c:webvpn_login_aaa_not_resuming[3137]
webvpn_portal.c:http_webvpn_kill_cookie[790]
webvpn_auth.c:http_webvpn_pre_authentication[2321]
WebVPN: calling AAA with ewsContext (-845538720) and nh (-828624376)!
webvpn_add_auth_handle: auth_handle = 22
WebVPN: started user authentication...
webvpn_auth.c:webvpn_aaa_callback[5138]
WebVPN: AAA status = (ACCEPT)
webvpn_portal.c:ewaFormSubmit_webvpn_login[3203]
webvpn_portal.c:webvpn_login_validate_net_handle[2234]
webvpn_portal.c:webvpn_login_allocate_auth_struct[2254]
webvpn_portal.c:webvpn_login_assign_app_next[2272]
webvpn_portal.c:webvpn_login_cookie_check[2289]
webvpn_portal.c:webvpn_login_set_tg_buffer_from_form[2325]
webvpn_portal.c:webvpn_login_transcend_cert_auth_cookie[2359]
webvpn_login_transcend_cert_auth_cookie: tg_cookie = NULL, tg_name =
webvpn_portal.c:webvpn_login_set_tg_cookie_form[2421]
webvpn_portal.c:webvpn_login_set_tg_cookie_querry_string[2473]
webvpn_portal.c:webvpn_login_resolve_tunnel_group[2546]
webvpn_portal.c:webvpn_login_negotiate_client_cert[2636]
webvpn_portal.c:webvpn_login_check_cert_status[2733]
webvpn_portal.c:webvpn_login_cert_only[2774]
webvpn_portal.c:webvpn_login_primary_username[2796]
webvpn_portal.c:webvpn_login_primary_password[2878]
webvpn_portal.c:webvpn_login_secondary_username[2910]
webvpn_portal.c:webvpn_login_secondary_password[2988]
webvpn_portal.c:webvpn_login_extra_password[3021]
webvpn_portal.c:webvpn_login_set_cookie_flag[3040]
webvpn_portal.c:webvpn_login_set_auth_group_type[3063]
webvpn_login_set_auth_group_type: WEBVPN_AUTH_GROUP_TYPE = 4
webvpn_portal.c:webvpn_login_aaa_resuming[3093]
webvpn_auth.c:http_webvpn_post_authentication[1485]
WebVPN: user: (myuser) authenticated.
webvpn_auth.c:http_webvpn_auth_accept[2938]
HTTP: net_handle->standalone_client [0]
webvpn_session.c:http_webvpn_create_session[184]
webvpn_session.c:http_webvpn_find_session[159]
WebVPN session created!
webvpn_session.c:http_webvpn_find_session[159]
webvpn_remove_auth_handle: auth_handle = 22
webvpn_portal.c:ewaFormServe_webvpn_cookie[1805]
webvpn_free_auth_struct: net_handle = CE9C3208
webvpn_allocate_auth_struct: net_handle = CE9C3208
ewsStringSearch: no buffer
Close 0
webvpn_free_auth_struct: net_handle = CE9C3208
webvpn_allocate_auth_struct: net_handle = CE9C3208
webvpn_auth.c:webvpn_auth[581]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:webvpn_update_idle_time[1463]
WebVPN: session has been authenticated.
webvpn_free_auth_struct: net_handle = CE9C3208
webvpn_allocate_auth_struct: net_handle = CE9C3208
ewsStringSearch: no buffer
Close 0
webvpn_free_auth_struct: net_handle = CE9C3208
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:webvpn_update_idle_time[1463]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_allocate_auth_struct: net_handle = CE9C3208
webvpn_auth.c:webvpn_auth[581]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:webvpn_update_idle_time[1463]
WebVPN: session has been authenticated.
webvpn_free_auth_struct: net_handle = CE9C3208
webvpn_allocate_auth_struct: net_handle = CE9C3208
ewsStringSearch: no buffer
Close 0
webvpn_free_auth_struct: net_handle = CE9C3208
webvpn_allocate_auth_struct: net_handle = CE863DE8
webvpn_auth.c:webvpn_auth[581]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:webvpn_update_idle_time[1463]
WebVPN: session has been authenticated.
webvpn_free_auth_struct: net_handle = CE863DE8
webvpn_allocate_auth_struct: net_handle = CE863DE8
ewsStringSearch: no buffer
Close 0
webvpn_free_auth_struct: net_handle = CE863DE8
webvpn_allocate_auth_struct: net_handle = CE9C32C8
webvpn_auth.c:webvpn_auth[581]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:webvpn_update_idle_time[1463]
WebVPN: session has been authenticated.
webvpn_free_auth_struct: net_handle = CE9C32C8
webvpn_allocate_auth_struct: net_handle = CE9C32C8
ewsStringSearch: no buffer
Close 0
webvpn_free_auth_struct: net_handle = CE9C32C8
webvpn_allocate_auth_struct: net_handle = CE9C32C8
webvpn_allocate_auth_struct: net_handle = CE863DE8
webvpn_auth.c:webvpn_auth[581]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:webvpn_update_idle_time[1463]
WebVPN: session has been authenticated.
webvpn_auth.c:webvpn_auth[581]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:webvpn_update_idle_time[1463]
WebVPN: session has been authenticated.
webvpn_free_auth_struct: net_handle = CE863DE8
webvpn_allocate_auth_struct: net_handle = CE863DE8
ewsStringSearch: no buffer
Close 0
webvpn_free_auth_struct: net_handle = CE863DE8
webvpn_free_auth_struct: net_handle = CE9C32C8
webvpn_allocate_auth_struct: net_handle = CE9C32C8
ewsStringSearch: no buffer
Close 0
webvpn_free_auth_struct: net_handle = CE9C32C8
webvpn_allocate_auth_struct: net_handle = CE9C32C8
webvpn_auth.c:webvpn_auth[581]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:webvpn_update_idle_time[1463]
WebVPN: session has been authenticated.
webvpn_free_auth_struct: net_handle = CE9C32C8
webvpn_allocate_auth_struct: net_handle = CE9C32C8
ewsStringSearch: no buffer
Close 0
webvpn_free_auth_struct: net_handle = CE9C32C8
HTTP: Periodic admin session check (idle-timeout = 1200, session-timeout = 0)
webvpn_allocate_auth_struct: net_handle = CE9C32C8
webvpn_auth.c:webvpn_auth[581]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:webvpn_update_idle_time[1463]
WebVPN: session has been authenticated.
webvpn_free_auth_struct: net_handle = CE9C32C8
webvpn_allocate_auth_struct: net_handle = CE9C32C8
ewsStringSearch: no buffer
Close 0
webvpn_free_auth_struct: net_handle = CE9C32C8
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_allocate_auth_struct: net_handle = CE9C32C8
webvpn_auth.c:webvpn_auth[581]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:webvpn_update_idle_time[1463]
WebVPN: session has been authenticated.
webvpn_free_auth_struct: net_handle = CE9C32C8
webvpn_allocate_auth_struct: net_handle = CE9C32C8
ewsStringSearch: no buffer
Close 0
webvpn_free_auth_struct: net_handle = CE9C32C8
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:http_webvpn_find_session[159]
webvpn_allocate_auth_struct: net_handle = CC894AA8
webvpn_session.c:http_webvpn_find_session[159]
webvpn_session.c:webvpn_update_idle_time[1463]
Close 1043041832
webvpn_free_auth_struct: net_handle = CC894AA8 -
JDeveloper 11g R1 Toplink Session Login Unsuccessfull
Hi Everyone,
Toplink Session Login are unsuccessful in my application. My session.xml file gives xml validation errors.
Please help me,
Best Regards
Gokmen
XML Validation errors :
element primary-project not expected.
element login not expected.
element connection-pools not expected.
My session.xml file here:
<?xml version="1.0" encoding="windows-1254"?>
<toplink-sessions version="11g Release 1 (11.1.1.1.0)" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<session xsi:type="server-session">
<name>AnahtarV3</name>
<server-platform xsi:type="weblogic-10-platform"/>
<primary-project xsi:type="xml">META-INF/ToplinkMap.xml</primary-project>
<login xsi:type="database-login">
<platform-class>oracle.toplink.platform.database.oracle.Oracle11Platform</platform-class>
<user-name>xxxx</user-name>
<password>7D39547AAAC98C485237BC9ABBBAEFBA</password>
<sequencing>
<default-sequence xsi:type="native-sequence">
<preallocation-size>1</preallocation-size>
</default-sequence>
</sequencing>
<driver-class>oracle.jdbc.OracleDriver</driver-class>
<connection-url>jdbc:oracle:thin:@xx.yyyy.www:1521:zzzz</connection-url>
<force-field-names-to-upper-case>true</force-field-names-to-upper-case>
<optimize-data-conversion>true</optimize-data-conversion>
<trim-strings>false</trim-strings>
</login>
<connection-pools>
<read-connection-pool>
<name>read</name>
<max-connections>1</max-connections>
<min-connections>1</min-connections>
<login xsi:type="database-login">
<user-name>bonus</user-name>
<password>C9AB9547D3AC98C485237B7AABBAEFBA</password>
<driver-class>oracle.jdbc.OracleDriver</driver-class>
<connection-url>jdbc:oracle:thin:@oratest.boyner.trk:1521:bdbtest</connection-url>
</login>
</read-connection-pool>
<write-connection-pool>
<max-connections>1</max-connections>
<min-connections>1</min-connections>
</write-connection-pool>
</connection-pools>
</session>
</toplink-sessions>
Console Error Log:
Exception Description: Several [3] SessionLoaderExceptions were thrown:
org.xml.sax.SAXParseException: <Line 35, Column 30>: XML-24534: (Error) Element 'max-connections' not expected.
org.xml.sax.SAXParseException: <Line 36, Column 30>: XML-24534: (Error) Element 'min-connections' not expected.
org.xml.sax.SAXParseException: <Line 37, Column 34>: XML-24521: (Error) Element not completed: 'write-connection-pool'Hi,
Currently the session.xml shows design time error(as support for xsi:type is not there), but this will not block deployment or functionality of application.
The workaround for the Connection Pool errors is to
provide name element for the connection pool in session.xml after configuring read and write connection pools at session level as below
<connection-pools>
<read-connection-pool>
<name>read-connection-pool</name>
<login xsi:type="database-login">
</read-connection-pool>
</connection-pools> -
All Im very new to Oracle DRM and Im trying to get the app setup on Windows server running SQL Server 2008. When I try to login to the Web Client I keep getting this error.
DRM-61026: Unable to create user session for the following reason: Login failed. Invalid user name or password.
Can you please helpThis might be due to The 'Oracle Instance' path may not have been set to a path relative to the 'CSS Bridge Host' (i.e. the Foundation Services machine) on the Configuration > Host Machines > CSS > General tab of the DRM Configuration Utility.
if this is the case then
1. Open the DRM Configuration Console.
2. Go to the Configuration > Host Machines > CSS > General tab of the DRM Configuration Utility.
3. Ensure that the path in 'Oracle Instance' has been set relative to the 'CSS Bridge Host' (i.e. the Foundation Services machine defined in 'CSS Bridge Host').
4. If corrections are made to 'Oracle Instance' then restart the DRM services to pick up the change.
Thanks,
~KKT~ -
How do I create a session with the datasource set in code not sessions.xml
I want to create a session where I specify the J2EE datasource name dynamically in code. Normally, I would hard-code a J2EE datasource name in sessions.xml e.g.
<login>
<datasource>jdbc/MyApplicationDS</datasource>
<platform-class>oracle.toplink.platform.database.oracle.Oracle10Platform</platform-class>
<uses-external-connection-pool>true</uses-external-connection-pool>
<uses-external-transaction-controller>true</uses-external-transaction-controller>
</login>
However, we don't want to use a hard-coded string "jdbc/MyApplicationDS". We want to be able to set this at runtime.
I found this in the App Developer's Guide:
Configuring an External Connection Pool in Java
To configure the use of an external connection pool in Java:
1. Configure the DataSource on the server.
2. Configure the Login to specify a DataSource and the use of an external connection pool:
login.setConnector(
new JNDIConnector(new InitialContext(), "jdbc/MyApplicationDS"));
login.setUsesExternalConnectionPooling(true);
and this:
Configuring Sessions with the sessions.xml File
OracleAS TopLink provides two ways to preconfigure your sessions: you can export and compile Java source code from the OracleAS TopLink Mapping Workbench, or use the OracleAS TopLink Sessions Editor to build a session configuration file, the sessions.xml file.
It seems like I should export and compile Java code that calls login.setConnector(), but I can't find out any information on how to do this. I looked at the MW user guide and I didn't see anything on this.
I also found this by searching this discussion forum:
To create a server session completely from code given a project you can use,
project.getLogin().setConnector(new JNDIConnector(new InitialContext(), "your-datasource-url"));
project.getLogin().setUserName("");
project.getLogin().setPassword("");
Server server = project.createServerSession();
server.login();
However, I don't know how to get the project.
Thanks,
VickiIf you are using a sessions.xml file, you can get your project from your session. Ensure that when you access your session from the SessionManager, that you do not have it login.
Session session = SessionManager.getManager().getSession("my-session", false);
session.getProject().setConnector(...);
session.login();
If not using a sessions.xml, you can either read your Project from the XMLProjectReader, or instantiate your Project class directly. -
Hi,
I am working with embedded oc4j and I am using form based authentication.The application also has a connection to Oracle database.The Jdev version I am using is Build JDEVADF_MAIN.M1_GENERIC_080131.1115.4839.The application gets deployed on embedded oc4j but when i try to login, I get the following exception.
WARNING: Error creating MDS session
oracle.adf.share.ADFShareException: Error creating MDS session
at oracle.adf.share.config.ADFContextMDSConfigHelperImpl.createMDSSession(ADFContextMDSConfigHelperImpl.java:43)
at oracle.adf.share.ADFContext.getMDSSessionAsObject(ADFContext.java:750)
at oracle.jbo.mom.MOMParserMDS.getMDSSession(MOMParserMDS.java:59)
at oracle.jbo.mom.MOMParserMDS.parse(MOMParserMDS.java:188)
at oracle.jbo.mom.MOMParserNonMDS.readAndParse(MOMParserNonMDS.java:70)
at oracle.jbo.mom.DefinitionContextStandard.readAndParse(DefinitionContextStandard.java:226)
at oracle.jbo.mom.DefinitionManager.loadProjectDefinition(DefinitionManager.java:1391)
at oracle.jbo.uicli.mom.JUMetaObjectManager.findCpx(JUMetaObjectManager.java:743)
at oracle.jbo.uicli.mom.JUMetaObjectManager.loadCpx(JUMetaObjectManager.java:810)
at oracle.adf.model.BindingRequestHandler.initializeBindingContext(BindingRequestHandler.java:347)
at oracle.adf.model.BindingRequestHandler.beginRequest(BindingRequestHandler.java:136)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:176)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
at oracle.adfinternal.view.faces.webapp.rich.SharedLibraryFilter.doFilter(SharedLibraryFilter.java:135)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:69)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
at oracle.adfinternal.view.faces.activedata.ADSFilter.doFilter(ADSFilter.java:74)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:241)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:198)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:141)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
at oracle.security.jazn.oc4j.JAZNFilter$3.run(JAZNFilter.java:434)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:308)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:452)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:583)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:334)
at com.evermind.server.http.HttpRequestHandler.doDispatchRequest(HttpRequestHandler.java:942)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:843)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:658)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:626)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:417)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:189)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:163)
at oracle.oc4j.network.ServerSocketReadHandler$ClientRunnable.run(ServerSocketReadHandler.java:275)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:237)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:29)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:877)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: oracle.adf.share.ADFShareException: getMDSInstance error
at oracle.adf.share.config.FallbackConfigImpl.getMDSInstance(FallbackConfigImpl.java:89)
at oracle.adf.share.config.FallbackConfigImpl.getDefaultMDSInstance(FallbackConfigImpl.java:99)
at oracle.adf.share.config.ADFConfigImpl.getMDSInstance(ADFConfigImpl.java:513)
at oracle.adf.share.config.ADFContextMDSConfigHelperImpl.createMDSSession(ADFContextMDSConfigHelperImpl.java:36)
... 43 more
Caused by: oracle.mds.exception.MDSRuntimeException: schema_reference.4: Failed to read schema document 'code-source:/C:/jdev latest sanity/JDEVADF_MAIN.M1_GENERIC_080131.1115.4839/mds/lib/mdsrt.jar!/oracle/mds/xsd/mdsConfig.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
at oracle.mds.internal.config.ConfigurationUtils.setSchemaOnUnmarshaller(ConfigurationUtils.java:495)
at oracle.mds.internal.config.ConfigurationUtils.getBeanFromElement(ConfigurationUtils.java:159)
at oracle.mds.config.MDSConfig.loadFromElement(MDSConfig.java:795)
at oracle.mds.config.MDSConfig.<init>(MDSConfig.java:359)
at oracle.adf.share.config.ADFMDSConfig.getDefaultMDSInstance(ADFMDSConfig.java:354)
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 oracle.adf.share.config.FallbackConfigImpl.getMDSInstance(FallbackConfigImpl.java:66)
... 46 more
Caused by: org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'code-source:/C:/jdev latest sanity/JDEVADF_MAIN.M1_GENERIC_080131.1115.4839/mds/lib/mdsrt.jar!/oracle/mds/xsd/mdsConfig.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSDHandler.java:2245)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchema(XSDHandler.java:1590)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:438)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:556)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:523)
at com.sun.org.apache.xerces.internal.jaxp.validation.xs.SchemaFactoryImpl.newSchema(SchemaFactoryImpl.java:206)
at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:489)
at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:521)
at oracle.mds.internal.config.ConfigurationUtils.setSchemaOnUnmarshaller(ConfigurationUtils.java:491)
... 55 more
Mar 12, 2008 4:39:29 PM com.evermind.server.ServerBase log
WARNING: OracleIRM-IRMWebV1.1-webapp: Servlet error
oracle.security.jazn.JAZNRuntimeException: Error creating MDS session
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:480)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:583)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:334)
at com.evermind.server.http.HttpRequestHandler.doDispatchRequest(HttpRequestHandler.java:942)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:843)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:658)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:626)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:417)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:189)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:163)
at oracle.oc4j.network.ServerSocketReadHandler$ClientRunnable.run(ServerSocketReadHandler.java:275)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:237)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:29)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:877)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: oracle.adf.share.ADFShareException: Error creating MDS session
at oracle.adf.share.config.ADFContextMDSConfigHelperImpl.createMDSSession(ADFContextMDSConfigHelperImpl.java:43)
at oracle.adf.share.ADFContext.getMDSSessionAsObject(ADFContext.java:750)
at oracle.jbo.mom.MOMParserMDS.getMDSSession(MOMParserMDS.java:59)
at oracle.jbo.mom.MOMParserMDS.parse(MOMParserMDS.java:188)
at oracle.jbo.mom.MOMParserNonMDS.readAndParse(MOMParserNonMDS.java:70)
at oracle.jbo.mom.DefinitionContextStandard.readAndParse(DefinitionContextStandard.java:226)
at oracle.jbo.mom.DefinitionManager.loadProjectDefinition(DefinitionManager.java:1391)
at oracle.jbo.uicli.mom.JUMetaObjectManager.findCpx(JUMetaObjectManager.java:743)
at oracle.jbo.uicli.mom.JUMetaObjectManager.loadCpx(JUMetaObjectManager.java:810)
at oracle.adf.model.BindingRequestHandler.initializeBindingContext(BindingRequestHandler.java:347)
at oracle.adf.model.BindingRequestHandler.beginRequest(BindingRequestHandler.java:136)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:176)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
at oracle.adfinternal.view.faces.webapp.rich.SharedLibraryFilter.doFilter(SharedLibraryFilter.java:135)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:69)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
at oracle.adfinternal.view.faces.activedata.ADSFilter.doFilter(ADSFilter.java:74)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:241)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:198)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:141)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
at oracle.security.jazn.oc4j.JAZNFilter$3.run(JAZNFilter.java:434)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:308)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:452)
... 16 more
Caused by: oracle.adf.share.ADFShareException: getMDSInstance error
at oracle.adf.share.config.FallbackConfigImpl.getMDSInstance(FallbackConfigImpl.java:89)
at oracle.adf.share.config.FallbackConfigImpl.getDefaultMDSInstance(FallbackConfigImpl.java:99)
at oracle.adf.share.config.ADFConfigImpl.getMDSInstance(ADFConfigImpl.java:513)
at oracle.adf.share.config.ADFContextMDSConfigHelperImpl.createMDSSession(ADFContextMDSConfigHelperImpl.java:36)
... 43 more
Caused by: oracle.mds.exception.MDSRuntimeException: schema_reference.4: Failed to read schema document 'code-source:/C:/jdev latest sanity/JDEVADF_MAIN.M1_GENERIC_080131.1115.4839/mds/lib/mdsrt.jar!/oracle/mds/xsd/mdsConfig.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
at oracle.mds.internal.config.ConfigurationUtils.setSchemaOnUnmarshaller(ConfigurationUtils.java:495)
at oracle.mds.internal.config.ConfigurationUtils.getBeanFromElement(ConfigurationUtils.java:159)
at oracle.mds.config.MDSConfig.loadFromElement(MDSConfig.java:795)
at oracle.mds.config.MDSConfig.<init>(MDSConfig.java:359)
at oracle.adf.share.config.ADFMDSConfig.getDefaultMDSInstance(ADFMDSConfig.java:354)
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 oracle.adf.share.config.FallbackConfigImpl.getMDSInstance(FallbackConfigImpl.java:66)
... 46 more
Caused by: org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'code-source:/C:/jdev latest sanity/JDEVADF_MAIN.M1_GENERIC_080131.1115.4839/mds/lib/mdsrt.jar!/oracle/mds/xsd/mdsConfig.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSDHandler.java:2245)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchema(XSDHandler.java:1590)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:438)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:556)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:523)
at com.sun.org.apache.xerces.internal.jaxp.validation.xs.SchemaFactoryImpl.newSchema(SchemaFactoryImpl.java:206)
at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:489)
at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:521)
at oracle.mds.internal.config.ConfigurationUtils.setSchemaOnUnmarshaller(ConfigurationUtils.java:491)
... 55 more
Let me know if somebody has an idea of this .This is because of space character is jdev location i.e C:/jdev latest sanity/. Change the location of jdev to another directory which doesn't contain spaces and try again.
-
How to create a single login for multiple apps on tomcat server?
Hello,
I am running the most recent versions of apache and tomcat on several dells with XP pro.
When I login to an app I have created, a session variable is set, but when I browse to one of the other apps on the same computer, it does not recognize that the session variable has been set and I have to login again.
Can somebody please suggest how, or where I can find docs, to configure tomcat to pass the session variables to other apps?
Thank you very much.
Or, can anybody suggest the most effective strategy for creating single-logon functionality for multiple apps with tomcat and apache running on one computer? and with tomcat and apache running on multiple computers? (i.e., each computer has tomcat and apache integrated).
The database is Oracle 10g running on each computer.
Thank you again.A good place to start is http://www.javaworld.com/javaworld/javatips/jw-javatip34.html
Also, do a search in this forum on HttpURLConnection. That class allows you to use POST method to send form data to a web server.
"Hidden" variables are only hidden in HTML. The HTTP that gets POSTed to the web server doesn't distinguish between hidden and not hidden. That is, the content you would write to the HttpURLConnection.getOutputStream() would be something like:
hidden=1&submit=ok(Of course, the variable names would depend on what the web server was expecting from the form.)
Also, be sure to set the Content-Type request parameter to "application/x-www-form-urlencoded" -
Cannot create a session after the response has been committed (Tomcat 6)
I'm getting a rather annoying error when I try to open a pretty basic JSP page.
I'm rather new to the whole JSP scene, so I'm following the example found on pages 287 and onwards in "JSF in Action - Manning" in case anyone wanted to check my code against the source.
I've searched for about 4 hours now, coming back to this site a couple of times, once reading about writeouts and stuff. But I'm not really sure this is the issue in this case and if it is, where exactly the problem lies.
I've already fixed a number of errors I got (jtsl.jar and standard.jar missing etc...) but this particular problem is driving me (and my co-workers for that matter :-) ) up the wall.
Anyone willing to help me out here?
Error:
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Cannot create a session after the response has been committed
javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
root cause
java.lang.IllegalStateException: Cannot create a session after the response has been committed
org.apache.catalina.connector.Request.doGetSession(Request.java:2301)
org.apache.catalina.connector.Request.getSession(Request.java:2075)
org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
org.apache.myfaces.context.servlet.SessionMap.setAttribute(SessionMap.java:53)
org.apache.myfaces.util.AbstractAttributeMap.put(AbstractAttributeMap.java:103)
org.apache.myfaces.util.AbstractAttributeMap.put(AbstractAttributeMap.java:35)
org.apache.myfaces.application.jsp.JspStateManagerImpl.saveSerializedViewInServletSession(JspStateManagerImpl.java:523)
org.apache.myfaces.application.jsp.JspStateManagerImpl.saveSerializedView(JspStateManagerImpl.java:358)
javax.faces.application.StateManager.saveView(StateManager.java:47)
org.apache.myfaces.application.jsp.JspViewHandlerImpl$StateMarkerAwareWriter.flushToWriter(JspViewHandlerImpl.java:387)
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:322)
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
Source Code of login.jsp:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<f:view>
<html>
<head>
<title>
<h:outputText value="ProjectTrack"/>
</title>
</head>
<body>
<table>
<tr>
<td>
<h:graphicImage url="/images/logo Skillteam.jpg"
alt="Welcome to ProjectTrack"
title="Welcome to ProjectTrack"
width="435" height="120"/>
</td>
<td>
<font face="Arial, sans-serif"
size="6">
<h:outputText value="ProjectTrack"/>
</font>
</td>
</tr>
http://forum.java.sun.com/post!default.jspa?forumID=45#
Click for bold </table>
</body>
</html>
</f:view>
web.xml & faces-config
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>ProjectTrack</display-name>
<welcome-file-list>
<welcome-file>faces/login.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
</web-app>
<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<navigation-rule>
<from-view-id>/login.jsp</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/inbox.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>failure</from-outcome>
<to-view-id>/login.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>Setup:
Eclipse Europe 3.3.0
Tomcat 6.0.13
MyFaces 1.2
JRE 1.6.0_02When searching for this error, this was the first page google gave me. I found the answer and just in case anyone else stumbles in here with the same question I thought I'd share my findings.
Unfortunately, if your problem is the same as mine, you're going to feel pretty silly. I was navigating to the wrong page. If MyFaces(when running tomcat) tries to resolve to a page that doesn't exist, the error given above is what happens.
In my case I accidentally put my .jsp page into the wrong directory and ended up banging my head against the wall for an hour figuring that out. Hope this helps someone. -
How to create a session by AppsLocalLogin.jsp
first, in auth.jsp we check fnd_global.user_name against "ANONYMOUS" to see whether user is logged on.
if not, we invoke AppsLocalLogin.jsp to create a session.
http://server:port/OA_HTML/AppsLocalLogin.jsp?requestUrl=report.jsp%3Fparam1%3Dyyy
the login page shows, page re-directed to report.jsp.
however fnd_global.user_name doesn't work. it still returns "ANONYMOUS".
if user logged on OA normally, then the whole thing worked. it seems fnd_global.user_name doesn't like the way we login.
how should we invoke AppsLocalLogin.jsp so it'll create a proper session?
part of report.jsp:
WebAppsContext ctx =WebRequestUtil.validateContext(request, response);
conn = ctx.getJDBCConnection();
sql = "select fnd_global.user_name from dual";
(we tried to invoke RF.jsp instead.
doesn't work because we don't know how to pass the param1 to report.jsp thru RF.jsp)This is variable what is working in my aplication
String variable;
if(user == null){
user=new String("");
}//if you don'y do this you will have null pointer exception
session.setAttribute("user",user);//put value
String name=(String)session.getAttribu("user"); //get value;
I hope this will help -
Create a session programatically (ie, outside of APEX).
Following on from this thread (Using APEX Collections outside of APEX? we have a requirement to be able to create a user session programatically in sqlplus etc, so that we can utilize the APEX collections framework in our existing developments.
The issue I am having is with getting the session populated in the wwv_flow_sessions$ table.
If I create a session first by opening a page in APEX then my processing works fine using that session id, the problem comes when I want to programatically create a new session.
I have tried the following (where l_session is the id of the session I grabbed from running an APEX page):
DECLARE
l_security_group_id NUMBER := apex_util.find_security_group_id('OUR_WORKSPACE');
l_session_id NUMBER := apex_custom_auth.get_next_session_id;
l_val VARCHAR2(4000);
v_arr wwv_flow_global.vc_arr2;
BEGIN
wwv_flow_api.set_security_group_id(l_security_group_id);
apex_application.g_flow_id := '1';
apex_custom_auth.define_user_session('USERNAME', l_session_id);
apex_custom_auth.post_login(p_uname => 'USERNAME', p_session_id => l_session_id); /*Added this as an after-thought but it made no difference*/
apex_collection.create_collection('XXTEST');
/*some more things after this but it never gets that far*/but I get the error:
ORA-02291: integrity constraint (FLOWS_030100.WWV_FLOW_COLLECTION_FK) violated - parent key not found
ORA-06512: at "FLOWS_030100.WWV_FLOW_COLLECTION", line 288
ORA-06512: at line 12Running v('SESSION') returns a value, so the session is being populated, it's just a corresponding record isn't inserted into wwv_flow_sessions$.
Is there any API to create such a session? If not, what are the implications of doing a manual insert into this table before processing and then removing the row afterwards?Ok, i see.
Why do you need the record in the session-table, does CREATE_COLLECTION require that?
I never created a Collection in a batch-job outside of APEX, but created/called an APEX Report. To "create" the session i used this code:
PROCEDURE initApexFromOutside
( i_app_name IN VARCHAR2
, i_page_id IN NUMBER
, i_apex_user IN VARCHAR2
IS
v_cgivar_name owa.vc_arr;
v_cgivar_val owa.vc_arr;
v_workspace_id NUMBER;
v_app_id NUMBER;
BEGIN
-- set up cgi environment
htp.init;
v_cgivar_name(1) := 'REQUEST_PROTOCOL';
v_cgivar_val(1) := 'HTTP';
owa.init_cgi_env
( num_params => v_cgivar_name.count
, param_name => v_cgivar_name
, param_val => v_cgivar_val
-- load apex IDs by application name
SELECT workspace_id,
application_id
INTO v_workspace_id,
v_app_id
FROM apex_applications
WHERE application_name=i_app_name;
-- set up apex workspace
wwv_flow_api.set_security_group_id(v_workspace_id);
-- set up apex session vars
apex_application.g_instance := wwv_flow_custom_auth.get_next_session_id;
apex_application.g_flow_id := v_app_id;
apex_application.g_flow_step_id := i_page_id;
-- "login"
apex_custom_auth.define_user_session
( p_user => i_apex_user
, p_session_id => apex_application.g_instance
wwv_flow_custom_auth_std.post_login
( p_uname => i_apex_user
, p_session_id => apex_application.g_instance
, p_flow_page => apex_application.g_flow_id
|| ':'
|| apex_application.g_flow_step_id
END initApexFromOutside;
PROCEDURE doInitApex(pUsername IN VARCHAR2)
IS
BEGIN
IF v('APP_ID') IS NULL
THEN
-- init apex environment
initApexFromOutside
( i_app_name => cAppName
, i_page_id => 1
, i_apex_user => pUsername
-- call show once because it sets additonal internal apex parameters
Apex_Application.show
( p_flow_id => Apex_Application.g_flow_id
, p_flow_step_id => Apex_Application.g_flow_step_id
, p_instance => Apex_Application.g_instance
-- show re-sets other parameters at the end. have to init again...
initApexFromOutside
( i_app_name => cAppName
, i_page_id => 1
, i_apex_user => pUsername
END IF;
END;Maybe this works for you, too.
brgds,
Peter
Blog: http://www.oracle-and-apex.com
ApexLib: http://apexlib.oracleapex.info
BuilderPlugin: http://builderplugin.oracleapex.info
Work: http://www.click-click.at -
How to set a lable as the dynamic session variable ?
I have created a dynamic session variable in admin tool and then I want to create a prompt in dashboard and set label to use this session variable
I try to use the @{variable} or @{system.variable} in the label text ,but it is not work ,so what is the correct way or does the obiee not support to do like this?thx, for responded
but I have read a topic said if left the label text empty the reference a presentation variable , then it can work , you can see it below:
http://obiee101.blogspot.in/2009/04/obiee-multi-lingual-prompt.html -
Creation Dynamic session name using BDC session Method
Hi All,
I have one typical BDC problem. If the number of records in file are crossing 80,my bdc is giving problem .So I need to split total records into sets of 80 and submit them. So I need to create the session name dynamically, pass the data dynamically. IF you have example code or know the procedure as how to proceed kindly inform me
Regards
PraveenHi Rob,
Please find my code below..
Part of the variables are in Polish since the original developer is a polish guy..
Praveen
Code.
*& Report ZCO_I025_WSKAZNIKI_STAT_DEV *
*& Interfejs wczytywania wskaźników statystycznych *
REPORT zco_i025_wskazniki_stat_dev .
TYPES:
BEGIN OF l_tab_dane,
indic LIKE rk23f-stagr,
quant LIKE rk23f-mbgbtr,
mpk LIKE rk23f-ekostl,
order LIKE rk23f-eaufnr,
text LIKE rk23f-sgtxt,
END OF l_tab_dane.
DATA:
it_excel TYPE TABLE OF alsmex_tabline,
wa_excel TYPE alsmex_tabline,
it_data TYPE TABLE OF l_tab_dane,
wa_data TYPE l_tab_dane,
error TYPE C,
msg TYPE string.
DATA:
iv_pole TYPE string,
ddatum(10),
kdatum(10),
*Inserted By satyam Developer
filelist TYPE filetable,
rc TYPE i.
DATA: BEGIN OF bdctab OCCURS 5.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdctab.
SELECTION-SCREEN BEGIN OF BLOCK p1 WITH FRAME TITLE text-001.
PARAMETERS:
p_zakla LIKE tka01-kokrs DEFAULT '1000',
p_ddate LIKE sy-datum DEFAULT sy-datum,
p_kdate LIKE sy-datum DEFAULT sy-datum.
SELECTION-SCREEN ULINE.
PARAMETERS:
p_fname LIKE rlgrap-filename. " DEFAULT 'd:dane.xls'.
SELECTION-SCREEN END OF BLOCK p1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
file_filter = cl_gui_frontend_services=>filetype_excel
multiselection = 'X'
CHANGING
file_table = filelist
rc = rc.
IF LINES( filelist ) IS INITIAL.
EXIT.
ENDIF.
READ TABLE filelist INDEX 1 INTO p_fname.
START-OF-SELECTION.
AUTHORITY-CHECK OBJECT 'TKA01'
ID 'KOKRS' FIELD p_zakla.
CONCATENATE p_ddate6(2) '.' p_ddate4(2) '.' p_ddate(4) INTO ddatum.
CONCATENATE p_kdate6(2) '.' p_kdate4(2) '.' p_kdate(4) INTO kdatum.
error = '0'.
PERFORM wczytaj_dane.
IF error = '0'.
PERFORM utworz_sesje.
PERFORM wprowadz_dane.
PERFORM zamknij_sesje. "comment by prav
ENDIF.
PERFORM zamknij_sesje. "add by prav
IF error = '1'.
WRITE: msg, /.
ENDIF.
WRITE: 'Wykonano', /.
*& Form wczytaj_dane
text
FORM wczytaj_dane.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_fname
i_begin_col = 1
i_begin_row = 1
i_end_col = 8
i_end_row = 65000
TABLES
intern = it_excel
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE: / 'Bład importu pliku wejsciowego: ', p_fname, ' - ',
sy-subrc.
ELSE.
SORT it_excel BY row col.
LOOP AT it_excel INTO wa_excel.
IF wa_excel-row = 1.
CONTINUE.
ENDIF.
iv_pole = wa_excel-value.
CASE wa_excel-col.
WHEN 1. wa_data-indic = iv_pole.
WHEN 2.
REPLACE ',' WITH '.' INTO iv_pole.
wa_data-quant = iv_pole.
WHEN 3. wa_data-mpk = iv_pole.
WHEN 4. wa_data-order = iv_pole.
WHEN 5. wa_data-text = iv_pole.
ENDCASE.
AT END OF row.
IF wa_data-mpk IS INITIAL AND wa_data-order IS INITIAL.
error = '1'.
WRITE:
'Musi być podane Stanowisko kosztów lub Zlecenie wewnętrzne. Rekord: ',
wa_excel-row, /.
EXIT.
ENDIF.
IF wa_data-mpk IS NOT INITIAL AND wa_data-order IS NOT INITIAL.
error = '1'.
WRITE:
'Musi być podane Stanowisko kosztów lub Zlecenie wewnętrzne. Rekord: ',
wa_excel-row, /.
EXIT.
ENDIF.
IF wa_data-indic IS INITIAL.
error = '1'.
WRITE: 'Brak identyfikatora wskaźnika. Rekord: ', wa_excel-row
EXIT.
ENDIF.
IF wa_data-quant IS INITIAL.
error = '1'.
WRITE: 'Brak informacji o ilości. Rekord: ', wa_excel-row, /.
EXIT.
ENDIF.
APPEND wa_data TO it_data.
CLEAR wa_data.
ENDAT.
ENDLOOP.
ENDIF.
ENDFORM. "wczytaj_dane
*& Form wprowadz_dane
text
FORM wprowadz_dane.
DATA:
licznik TYPE i,
l_txt TYPE string,
pole(30) TYPE c,
liczba(15) TYPE c.
LOOP AT it_data into wa_data.
PERFORM bdc_dynpro USING 'SAPLSPO4' '0300'.
PERFORM bdc_field USING 'BDC_CURSOR' 'SVALD-VALUE(01)'.
PERFORM bdc_field USING 'BDC_OKCODE' '=FURT'.
PERFORM bdc_field USING 'SVALD-VALUE(01)' p_zakla.
PERFORM bdc_dynpro USING 'SAPLK23F1' '1200'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'COHEADER-SEND_REC_REL' '03SAP'.
PERFORM bdc_field USING 'RK23F-STATUS' 'L'.
PERFORM bdc_field USING 'COHEADER-BLDAT' ddatum.
PERFORM bdc_field USING 'COHEADER-BUDAT' kdatum.
PERFORM bdc_field USING 'BDC_CURSOR' 'EKOSTL(1)'.
licznik = 0.
LOOP AT it_data into wa_data.
ADD 1 TO licznik.
l_txt = licznik.
CONCATENATE 'EL4(' l_txt ')' INTO pole.
condense pole no-gaps.
PERFORM bdc_field USING pole wa_data-indic.
CONCATENATE 'ELR1(' l_txt ')' INTO pole.
condense pole no-gaps.
liczba = wa_data-quant.
if liczba < 0.
shift liczba circular left up to '-'.
endif.
condense liczba no-gaps.
PERFORM bdc_field USING pole liczba.
IF NOT wa_data-mpk IS INITIAL.
CONCATENATE 'EL2(' l_txt ')' INTO pole.
condense pole no-gaps.
PERFORM bdc_field USING pole wa_data-mpk.
ENDIF.
IF NOT wa_data-order IS INITIAL.
CONCATENATE 'EL3(' l_txt ')' INTO pole.
condense pole no-gaps.
PERFORM bdc_field USING pole wa_data-order.
ENDIF.
CONCATENATE 'EL8(' l_txt ')' INTO pole.
condense pole no-gaps.
PERFORM bdc_field USING pole wa_data-text.
call transaction 'KB31N' using bdctab mode 'A'.
refresh:bdctab.
clear bdctab.
ENDLOOP.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = 'KB31N'
TABLES
dynprotab = bdctab
EXCEPTIONS
internal_error = 1
not_open = 2
queue_error = 3
tcode_invalid = 4
printing_invalid = 5
posting_invalid = 6
OTHERS = 7.
IF sy-subrc <> 0.
WRITE: / text-010 .
ENDIF.
call transaction 'KB31N' using bdctab mode 'A'.
REFRESH bdctab.
clear:bdctab. "by praveen
ENDFORM. "wprowadz_dane
*& Form bdc_dynpro
text
-->PROGRAM text
-->DYNPRO text
FORM bdc_dynpro USING program dynpro.
CLEAR bdctab.
MOVE:
program TO bdctab-program,
dynpro TO bdctab-dynpro,
'X' TO bdctab-dynbegin.
APPEND bdctab.
ENDFORM. "bdc_dynpro
*& Form bdc_field
text
-->POLE text
-->WARTOSC text
FORM bdc_field USING pole wartosc.
CLEAR bdctab.
MOVE:
pole TO bdctab-fnam,
wartosc TO bdctab-fval.
APPEND bdctab.
ENDFORM. "bdc_field
*& Form utworz_sesje
text
FORM utworz_sesje.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = 'WSKASTAT'
user = sy-uname
keep = 'X'.
**begin of praveen
*if sy-subrc ne 0.
write 'hai'.
endif.
**end of praveen
ENDFORM. "utworz_sesje
*& Form zamknij_sesje
text
FORM zamknij_sesje.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
IF sy-subrc NE 0.
WRITE: /, 'Bład podczas zamykania sesji'.
EXIT.
ENDIF.
ENDFORM. "zamknij_sesje -
Create a session for a web service in jdeveloper10g
Hi All,
Question 1: How to create a session for a java web service created in jdeveloper10g.
Question 2: How to restrict a particular user for accessing a java web service.
I have done this by using key store. But when creating the java web service client, again we have to configure the key store, which should not happen in my case. Hence i like to create a method for login in a web service, create a session id for the user if he is a valid user and send the session id back to web service client. Using the session id they can access other methods in the web service.
Can any one suggest how I can accomplish this. Thanks in advance.I don't know this can be disscussed or not.
Please delete my topic if this can't be disscussed here.
Thank you. -
OBIEE | Using Dynamic Session Variable in Physical Layer
Hi All,
Any idea if we can use Dynamic Session Variables (I think they are also called Repository Variables) in our physical layer. I basically need to set the value of this variable from dashboard when a link is clicked, and then use this in my SELECT query at physical layer so that OBIEE does not pull all the data from the database tables.
Regards
Adeel Javed
Edited by: user10642426 on Apr 6, 2009 2:03 AMChristian,
Thanks for the quick response, ok we have actually moved to a different solution now, we are actually using Direct Database Request because one of our reports is supposed to be accessing direct transactional system i.e. for this report we are using OBIEE as a reporting tool. We are able to do that and even create links between different reports i.e. based on prompt in Report A filter Report B, but the scenario now is that we need to set a presentation variable from Report A when a navigation link gets clicked, because so far according to our knowledge direct SQL only allows presentation variables in its WHERE clause. So, any ideas how can we set a presentation variable when a navigation link is clicked. Thanks.
Regards
Adeel Javed
Edited by: adeeljaved on Apr 6, 2009 11:43 PM
Maybe you are looking for
-
How to set up RV042 as PPTP client?
Hello all, I'm trying to set up an local RV042 soho router (behind a double-NAT) as a PPTP VPN client to a remote RV042 set up as a PPTP server on a public IP. Because of the double NAT and the fact that I can't control the local NAT router, I have t
-
Error when calling add method of UDO object
Hi all i've created a UDO object. when i invoke the method "add" i get the following error message: "Ref count for this object is higher then 0" anyone can tell me how to fix this? appreciate the help Yoav
-
How to combine my JPEG files into 1 file?
I exported my PDF's into JPEG. Now I need to combine these into 1 to 3 files. How do I do this? Thank you!
-
Automate: Override the default NFS version 4 domain
Hi I configured a Solaris 10 jumpstart server. Everything is working without any problems. But there is this one question which I don't know how to automate: This system is configured with NFS version 4, which uses a domain name that is automatically
-
Can't remap caps lock in system preferences anymore
I just discovered that when I go into system preferences to set up a new keyboard under Yosemite 10.3, and click on "Modifier Keys..." to remap the modifier keys, the only valid mapping for Caps Lock is now "No Action." "Control," "option" and "com