sushil bajracharya

Greenhorn
+ Follow
since Jan 20, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sushil bajracharya

in JSP if I have an object A with application scope and another object B with a session scope. Now I can need to control the object A when the session for object B expires. THis is easy if we explicitly invalidate B's session via session.invalidate but what if B's session is invaldated by the web container after it is timed out, how do i trap that event to control A in my JSP
20 years ago
JSP
hi ajith,
firstly thanks!
thats true.. the packet is being sent to a jsp page. if i'm going to use it as a name-value pair then i guess i need to put the xml packet inside some hidden form field, right? or is there another way around to access the xml packet directly..
if the structure of xml is lets say..
<body>
:::
<xml>
:::
</xml>
::
</body>
inside a html , then i think the browser won't display the contents inside <xml>..<\xml>. Now can i directly access the contents inside the <xml>..<\xml> , is there any method the Servlet API provides that lets you extract a set of tags from the submitted request? If not i think i'll just enclose all the XML in side a form field and work with that..
i have another problem too, actually the xml is initially generated from a jsp, i can work around for that, but the problem is i have to modify the XML using javascript at the client side itself and keep on changing that XML packet.. then finally submit a final modified XML (packet) to jsp.. i've downloaded a XML parser in javascript from the sourceforge and playing around it. if you have any good resource for this please let me know. i sar the examples with that javascript parser, it works with a set of hardcoded xml data, it allows us to change it too and has a button to save it in the html form too, but when i save it, the edited data is not reflected in the html file.. may be when we submit the form the edited set of XML data is submitted but the change is not reflected in the HTML itself..

thanks a lot again for your prompt reply.
now i know why they call you XML guru over here ;-)
i have a XML packet inside a HTML page , the XML is generated as the user gives input using dynamically, now the xml that is transient is sent along with the HTML as an encapsulated message or packet. i need to extract the XML packet only, from the HTML and process it. how do i do that ? do i parse all the binary content or there is some other way .. ?
here is the problem,
How do i bind a datasource in Jboss with jndi so that the clients can access them with or without EJbs??
----------------------
============================================================
i have a simple client as :
====================================
import java.sql.*;
import javax.sql.*;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import Converter;
import ConverterHome;
public class ConverterClient {
private static Connection conn=null;
public static void main(String[] args) {
try {
InitialContext initial = new InitialContext();
System.out.println("Got context");
Object objref = initial.lookup("converter/Converter");
System.out.println("Got reference");
ConverterHome home =
(ConverterHome)PortableRemoteObject.narrow(objref,
ConverterHome.class);
Converter currencyConverter = home.create();

DataSource ds = (DataSource)initial.lookup("java:comp/env/jdbc/mySQLDSname");
System.out.println("Got datasource.");

conn = ds.getConnection("dev_hospital","dev_hospital");
if(conn!=null){
System.out.println("Got Connection");
conn.close();
}else{
System.out.println("Unable to get connection.");
}

double amount = currencyConverter.dollarToYen(100.00);
System.out.println(String.valueOf(amount));
amount = currencyConverter.yenToEuro(100.00);
System.out.println(String.valueOf(amount));
currencyConverter.remove();
} catch (Exception ex) {
System.err.println("Error> ");
ex.printStackTrace();
}
}
}
=======
when i run this client it shows error as;
D:\tryouts\Converter>java -classpath ".;c:\jboss;c:\jboss\client\ejb.jar;c:\jbos
s\client\jboss-j2ee.jar;c:\jboss\client\jaas.jar;c:\jboss\client\jbosssx-client.
jar;c:\jboss\client\jboss-client.jar;c:\jboss\client\jnp-client.jar;C:\tomcat\li
b\servlet.jar" -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFac
tory -Djava.naming.provider.url=localhost:1099 -Djava.naming.factory.url.pkgs=o
rg.jboss.naming rg.jnp.interfaces -Djava.security.policy=c:\jboss\conf\hospital
.policy ConverterClient
Got context
Got reference
Error>
javax.naming.NameNotFoundException: jdbc not bound
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
n Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
at javax.naming.InitialContext.lookup(Unknown Source)
at ConverterClient.main(ConverterClient.java:26)
==========
please help
How do i bind a datasource in Jboss with jndi so that the clients can access them with or without EJbs??
thanks
sushil
####################################################################################################
i have jboss.jcml as:
==========================
<?xml version="1.0" encoding="UTF-8"?>
< !-- This is where you can add and configure your MBeans<br /> ATTENTION: The order of the listing here is the same order as<br /> the MBeans are loaded. Therefore if a MBean depends on another<br /> MBean to be loaded and started it has to be listed after all<br /> the MBeans it depends on.<br /> -->
<server>

< !-- Classloading -->
<mbean code="org.jboss.web.WebService" name="DefaultDomain:service=Webserver">
<attribute name="Port">8083</attribute>
</mbean>
< !-- JNDI -->
<mbean code="org.jboss.naming.NamingService" name="DefaultDomain:service=Naming">
<attribute name="Port">1099</attribute>
</mbean>
<mbean code="org.jboss.naming.JNDIView" name="DefaultDomain:service=JNDIView" />

< !-- Transactions -->
<mbean code="org.jboss.tm.TransactionManagerService" name="DefaultDomain:service=TransactionManager">
<attribute name="TransactionTimeout">300</attribute>
</mbean>
< !-- Security -->
< !-- Uncomment to enable the sample SRPVerifierStore service<br /> <mbean code="org.jboss.security.srp.SRPVerifierStoreService" name="Security:name=SRPVerifierStoreService"><br /> <attribute name="JndiName">SRPDefaultVerifierSource</attribute><br /> <attribute name="StoreFile">SRPVerifierStore.ser</attribute><br /> </mbean><br /> -->
< !-- Uncomment to enable the SRP login service<br /> <mbean code="org.jboss.security.srp.SRPService" name="service:name=SRPService"><br /> <attribute name="JndiName">SRPServerInterface</attribute><br /> <attribute name="VerifierSourceJndiName">SRPDefaultVerifierSource</attribute><br /> <attribute name="AuthenticationCacheJndiName">SRPAuthenticationCache</attribute><br /> <attribute name="ServerPort">10099</attribute><br /> </mbean><br /> -->
< !-- JAAS security manager and realm mapping -->
<mbean code="org.jboss.security.plugins.JaasSecurityManagerService" name="Security:name=JaasSecurityManager">
<attribute name="SecurityManagerClassName">org.jboss.security.plugins.JaasSecurityManager</attribute>
</mbean>
< !-- Uncomment to enable the XML implementation of the JAAS policy<br /> <mbean code="org.jboss.security.plugins.SecurityPolicyService" name="Security:name=SecurityPolicyService"><br /> <attribute name="JndiName">DefaultSecurityPolicy</attribute><br /> <attribute name="PolicyFile">sample_policy.xml</attribute><br /> </mbean><br /> -->
< !-- JDBC -->
<mbean code="org.jboss.jdbc.JdbcProvider" name="DefaultDomain:service=JdbcProvider">
<attribute name="Drivers">org.gjt.mm.mysql.Driver,oracle.jdbc.driver.OracleDriver</attribute>
</mbean>
< !--JDBC settings to use MySql added by sushil_kb -->

<mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=mySQLDB">
<attribute name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl</attribute>
<attribute name="PoolName">mySQLDS</attribute>
<attribute name="URL">jdbc:mysql://192.168.3.50/dbHospital</attribute>
<attribute name="JDBCUser">dev_hospital</attribute>
<attribute name="Password">dev_hospital</attribute>
</mbean>
< !-- end MySql settings by sushil_kb -->
<mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=OracleDB">
<attribute name="PoolName">OracleDB</attribute>
<attribute name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl</attribute>
<attribute name="URL">jdbc racle:thin:@csenet:1521:csedb</attribute>
<attribute name="JDBCUser">scott</attribute>
<attribute name="Password">tiger</attribute>
</mbean>

< !-- J2EE deployment -->
<mbean code="org.jboss.ejb.ContainerFactory" name=":service=ContainerFactory">
<attribute name="VerifyDeployments">true</attribute>
<attribute name="MetricsEnabled">false</attribute>
<attribute name="VerifierVerbose">true</attribute>
<attribute name="BeanCacheJMSMonitoringEnabled">false</attribute>
</mbean>
< !-- Uncomment to add embedded tomcat service -->
<mbean code="org.jboss.tomcat.EmbeddedTomcatServiceSX" name="DefaultDomain:service=EmbeddedTomcat" />

< !-- Uncomment and set file URL to add Jetty service (you can set config more than once)<br /> <mbean code="org.jboss.jetty.JettyService" name="DefaultDomain:service=Jetty"><br /> <attribute name="Configuration">file URL to jetty.xml e.g. file:/usr/local/jboss/dist/conf/default/jetty.xml</attribute><br /> </mbean><br /> -->
< !-- For Message Driven Beans -->
<mbean code="org.jbossmq.server.JBossMQService" name="DefaultDomain:service=JBossMQ" />
<mbean code="org.jboss.jms.jndi.JMSProviderLoader" name=":service=JMSProviderLoader,name=JBossMQProvider">
<attribute name="ProviderName">DefaultJMSProvider</attribute>
<attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JBossMQProvider</attribute>
</mbean>
<mbean code="org.jboss.jms.asf.ServerSessionPoolLoader" name=":service=ServerSessionPoolMBean,name=StdJMSPool">
<attribute name="PoolName">StdJMSPool</attribute>
<attribute name="PoolFactoryClass">org.jboss.jms.asf.StdServerSessionPoolFactory</attribute>
</mbean>

< !-- Make sure you change EmbeddedTomcat to Jetty if you are using Jetty -->
<mbean code="org.jboss.deployment.J2eeDeployer" name="J2EE:service=J2eeDeployer">
<attribute name="DeployerName">Default</attribute>
<attribute name="JarDeployerName">:service=ContainerFactory</attribute>
<attribute name="WarDeployerName">:service=EmbeddedTomcat</attribute>
</mbean>
<mbean code="org.jboss.ejb.AutoDeployer" name="EJB:service=AutoDeployer">
<attribute name="Deployer">J2EE:service=J2eeDeployer</attribute>
<attribute name="URLs">../deploy</attribute>
</mbean>
< !-- J2EE connector architecture -->
<mbean code="org.jboss.resource.RARDeployer" name="JCA:service=RARDeployer">
</mbean>
< !-- Minerva no transaction connection manager factory.<br /> <br /> Use this for resource adapters that don't support <br /> transactions. -->
<mbean code="org.jboss.resource.ConnectionManagerFactoryLoader"<br /> name="JCA:service=ConnectionManagerFactoryLoader,name=MinervaNoTransCMFactory">
<attribute name="FactoryName">MinervaNoTransCMFactory</attribute>
<attribute name="FactoryClass">org.opentools.minerva.connector.jboss.MinervaNoTransCMFactory</attribute>
<attribute name="Properties"></attribute>
</mbean>
< !-- Minerva local transaction connection manager factory.<br /> <br /> Use this for resource adapters that support "local"<br /> transactions. -->
<mbean code="org.jboss.resource.ConnectionManagerFactoryLoader"<br /> name="JCA:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory">
<attribute name="FactoryName">MinervaSharedLocalCMFactory</attribute>
<attribute name="FactoryClass">
org.opentools.minerva.connector.jboss.MinervaSharedLocalCMFactory
</attribute>
<attribute name="Properties"></attribute>
</mbean>
< !-- Minerva XA transaction connection manager factory<br /> <br /> Use this for resource adapters that support "xa"<br /> transactions. -->
<mbean code="org.jboss.resource.ConnectionManagerFactoryLoader"<br /> name="JCA:service=ConnectionManagerFactoryLoader,name=MinervaXACMFactory">
<attribute name="FactoryName">MinervaXACMFactory</attribute>
<attribute name="FactoryClass">
org.opentools.minerva.connector.jboss.MinervaXACMFactory
</attribute>
<attribute name="Properties"></attribute>
</mbean>
< !-- Example connection factory for the example "Black Box" resource<br /> adapter. This points at the same database as DefaultDS. -->

< !--snippet removed to file jboss1backup and replaced by mySQLDS by sushil_kb -->
<mbean code="org.jboss.resource.ConnectionFactoryLoader"<br /> name="JCA:service=ConnectionFactoryLoader,name=BlackBoxDS">
<attribute name="FactoryName">BlackBoxDS</attribute>
<attribute name="RARDeployerName">JCA:service=RARDeployer</attribute>
<attribute name="ResourceAdapterName">Black Box LocalTx Adapter</attribute>
<attribute name="Properties">
ConnectionURL=jdbc:mysql://192.168.3.50/dbHospital
</attribute>
<attribute name="ConnectionManagerFactoryName">
MinervaSharedLocalCMFactory
</attribute>
< !-- See the documentation for the specific connection manager<br /> implementation you are using for the properties you can set -->
<attribute name="ConnectionManagerProperties">
# Pool type - uncomment to force, otherwise it is the default
#PoolConfiguration=per-factory
# Connection pooling properties - see
# org.opentools.minerva.pool.PoolParameters
MinSize=0
MaxSize=10
Blocking=true
GCEnabled=false
IdleTimeoutEnabled=false
InvalidateOnError=false
TrackLastUsed=false
GCIntervalMillis=120000
GCMinIdleMillis=1200000
IdleTimeoutMillis=1800000
MaxIdleTimeoutPercent=1.0
</attribute>
< !-- Principal mapping configuration -->
<attribute name="PrincipalMappingClass">
org.jboss.resource.security.ManyToOnePrincipalMapping
</attribute>
<attribute name="PrincipalMappingProperties">
userName=dev_hospital
password=dev_hospital
</attribute>
</mbean>
< !-- This is an example of using a resource adapter that supports XA<br /> transactions. The Black Box XA resource adapter requires an<br /> XADataSource to be in JNDI somewhere. JBoss doesn't include a<br /> database with an XA-compliant JDBC driver, so this will need to<br /> be configured to use whatever XADataSource implementation you<br /> have.<br /> <mbean code="org.jboss.jdbc.RawXADataSourceLoader"<br /> name="DefaultDomain:service=RawXADataSourceLoader,name=BlackBoxXADS"><br /> <attribute name="PoolName">BlackBoxXADS</attribute><br /> <attribute name="DataSourceClass"><br /> Put your XADataSource implementation class here<br /> </attribute><br /> <attribute name="Properties"></attribute><br /> </mbean><br /> <mbean code="org.jboss.resource.ConnectionFactoryLoader"<br /> name="JCA:service=ConnectionFactoryLoader,name=XABlackBoxDS"><br /> <attribute name="FactoryName">XABlackBoxDS</attribute><br /> <attribute name="RARDeployerName">JCA:service=RARDeployer</attribute><br /> <attribute name="ResourceAdapterName">Black Box XA Adapter</attribute><br /> <attribute name="Properties"><br /> XADataSourceName=java:/BlackBoxXADS<br /> </attribute><br /> <attribute name="ConnectionManagerFactoryName"><br /> MinervaXACMFactory<br /> </attribute><br /> <attribute name="ConnectionManagerProperties"><br /> # Pool type - uncomment to force, otherwise it is the default<br /> #PoolConfiguration=per-factory<br /> # Connection pooling properties - see<br /> # org.opentools.minerva.pool.PoolParameters<br /> MinSize=0<br /> MaxSize=10<br /> Blocking=true<br /> GCEnabled=false<br /> IdleTimeoutEnabled=false<br /> InvalidateOnError=false<br /> TrackLastUsed=false<br /> GCIntervalMillis=120000<br /> GCMinIdleMillis=1200000<br /> IdleTimeoutMillis=1800000<br /> MaxIdleTimeoutPercent=1.0<br /> </attribute><br /> <attribute name="PrincipalMappingClass"><br /> org.jboss.resource.security.ManyToOnePrincipalMapping<br /> </attribute><br /> <attribute name="PrincipalMappingProperties"><br /> userName=sa<br /> password=<br /> </attribute><br /> </mbean><br /> -->
< !-- JMX adaptors -->
<mbean code="org.jboss.jmx.server.JMXAdaptorService" name="Adaptor:name=RMI" />
<mbean code="org.jboss.jmx.server.RMIConnectorService" name="Connector:name=RMI" />
<mbean code="com.sun.jdmk.comm.HtmlAdaptorServer" name="Adaptor:name=html">
<attribute name="MaxActiveClientCount">10</attribute>
<attribute name="Parser" />
<attribute name="Port">8082</attribute>
</mbean>
< !-- Mail Connection Factory -->
<mbean code="org.jboss.mail.MailService" name=":service=Mail">
<attribute name="JNDIName">Mail</attribute>
<attribute name="ConfigurationFile">mail.properties</attribute>
<attribute name="User">user_id</attribute>
<attribute name="Password">password</attribute>
</mbean>
< !-- Uncomment to enable JMX monitoring of the bean cache<br /> <mbean code="org.jboss.monitor.BeanCacheMonitor" name="Monitor:name=BeanCacheMonitor"/><br /> -->
< !-- Add your custom MBeans here -->
</server>
===================================================================
i have jboss-auto.jcml as:
==========================
<?xml version="1.0" encoding="UTF-8"?>
<server><mbean code="org.jboss.logging.ConsoleLogging" name="DefaultDomain:service=Logging,type=Console"><attribute name="Format">[{2}] {4}</attribute>
</mbean>
<mbean code="org.jboss.jdbc.JdbcProvider" name="DefaultDomain:service=JdbcProvider"><attribute name="Drivers">org.gjt.mm.mysql.Driver,oracle.jdbc.driver.OracleDriver</attribute>
</mbean>
<mbean code="org.jboss.logging.FileLogging" name="DefaultDomain:service=Logging,type=File"><attribute name="Format">[{2}] {4}</attribute>
<attribute name="LogName">server</attribute>
</mbean>
<mbean code="org.jboss.naming.NamingService" name="DefaultDomain:service=Naming"><attribute name="Port">1099</attribute>
<attribute name="RmiPort">0</attribute>
<attribute name="ClientSocketFactory"></attribute>
<attribute name="ServerSocketFactory"></attribute>
</mbean>
<mbean code="org.jboss.util.ClassPathExtension" name="DefaultDomain:service=ClassPathExtension,name=../../db/"></mbean>
<mbean code="org.jboss.util.Shutdown" name="DefaultDomain:type=Shutdown"></mbean>
<mbean code="org.jboss.mail.MailService" name="DefaultDomain:service=Mail"></mbean>
<mbean code="org.jboss.deployment.J2eeDeployer" name="J2EE:service=J2eeDeployer"><attribute name="JarDeployerName">:service=ContainerFactory</attribute>
<attribute name="DeployerName">Default</attribute>
<attribute name="WarDeployerName">:service=EmbeddedTomcat</attribute>
</mbean>
<mbean code="org.jboss.configuration.ConfigurationService" name="DefaultDomain:service=Configuration"></mbean>
<mbean code="javax.management.MBeanServerDelegate" name="JMImplementation:type=MBeanServerDelegate"></mbean>
<mbean code="org.jbossmq.server.JBossMQService" name="DefaultDomain:service=JBossMQ"></mbean>
<mbean code="org.jboss.resource.ConnectionManagerFactoryLoader" name="JCA:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory"><attribute name="Properties"></attribute>
<attribute name="FactoryName">MinervaSharedLocalCMFactory</attribute>
<attribute name="FactoryClass">org.opentools.minerva.connector.jboss.MinervaSharedLocalCMFactory</attribute>
<attribute name="TransactionManagerName">java:/TransactionManager</attribute>
</mbean>
<mbean code="org.jboss.util.ServiceControl" name="DefaultDomain:service=ServiceControl"></mbean>
<mbean code="org.jboss.jmx.server.JMXAdaptorService" name="Adaptor:name=RMI"></mbean>
<mbean code="org.jboss.resource.ConnectionManagerFactoryLoader" name="JCA:service=ConnectionManagerFactoryLoader,name=MinervaNoTransCMFactory"><attribute name="Properties"></attribute>
<attribute name="FactoryName">MinervaNoTransCMFactory</attribute>
<attribute name="FactoryClass">org.opentools.minerva.connector.jboss.MinervaNoTransCMFactory</attribute>
<attribute name="TransactionManagerName">java:/TransactionManager</attribute>
</mbean>
<mbean code="org.jboss.util.ClassPathExtension" name="DefaultDomain:service=ClassPathExtension,name=../../tmp/"></mbean>
<mbean code="org.jboss.resource.ConnectionManagerFactoryLoader" name="JCA:service=ConnectionManagerFactoryLoader,name=MinervaXACMFactory"><attribute name="Properties"></attribute>
<attribute name="FactoryName">MinervaXACMFactory</attribute>
<attribute name="FactoryClass">org.opentools.minerva.connector.jboss.MinervaXACMFactory</attribute>
<attribute name="TransactionManagerName">java:/TransactionManager</attribute>
</mbean>
<mbean code="org.jboss.web.WebService" name="DefaultDomain:service=Webserver"><attribute name="Port">8083</attribute>
</mbean>
<mbean code="org.jboss.util.ClassPathExtension" name="DefaultDomain:service=ClassPathExtension,name=./"></mbean>
<mbean code="org.jboss.util.ClassPathExtension" name="DefaultDomain:service=ClassPathExtension,name=../../log/"></mbean>
<mbean code="com.sun.jdmk.comm.HtmlAdaptorServer" name="Adaptor:name=html"><attribute name="MaxActiveClientCount">10</attribute>
<attribute name="Parser"></attribute>
<attribute name="Port">8082</attribute>
</mbean>
<mbean code="org.jboss.tm.TransactionManagerService" name="DefaultDomain:service=TransactionManager"><attribute name="TransactionTimeout">300</attribute>
</mbean>
<mbean code="org.jboss.util.Info" name="DefaultDomain:service=Info"></mbean>
<mbean code="org.jboss.naming.JNDIView" name="DefaultDomain:service=JNDIView"></mbean>
<mbean code="org.jboss.ejb.ContainerFactory" name="DefaultDomain:service=ContainerFactory"><attribute name="VerifyDeployments">true</attribute>
<attribute name="MetricsEnabled">false</attribute>
<attribute name="VerifierVerbose">true</attribute>
</mbean>
<mbean code="org.jboss.jmx.server.RMIConnectorService" name="Connector:name=RMI"></mbean>
<mbean code="org.jboss.tomcat.EmbeddedTomcatServiceSX" name="DefaultDomain:service=EmbeddedTomcat"><attribute name="ConfigFile"></attribute>
</mbean>
<mbean code="org.jboss.resource.RARDeployer" name="JCA:service=RARDeployer"></mbean>
<mbean code="org.jboss.ejb.AutoDeployer" name="EJB:service=AutoDeployer"><attribute name="Deployer">J2EE:service=J2eeDeployer</attribute>
<attribute name="URLs">../deploy</attribute>
</mbean>
<mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=mySQLDSXA"><attribute name="Properties"></attribute>
<attribute name="URL">jdbc:mysql://192.168.3.50/dbHospital</attribute>
<attribute name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl</attribute>
<attribute name="GCInterval">120000</attribute>
<attribute name="IdleTimeout">1800000</attribute>
<attribute name="InvalidateOnError">false</attribute>
<attribute name="LoggingEnabled">false</attribute>
<attribute name="MaxSize">10</attribute>
<attribute name="Password">dev_hospital</attribute>
<attribute name="TimestampUsed">false</attribute>
<attribute name="Blocking">true</attribute>
<attribute name="GCEnabled">false</attribute>
<attribute name="GCMinIdleTime">1200000</attribute>
<attribute name="IdleTimeoutEnabled">false</attribute>
<attribute name="JDBCUser">dev_hospital</attribute>
<attribute name="MaxIdleTimeoutPercent">1.0</attribute>
<attribute name="MinSize">0</attribute>
<attribute name="PoolName">mySQLDSpoolXA</attribute>
</mbean>
<mbean code="org.jboss.jms.asf.ServerSessionPoolLoader" name="DefaultDomain:service=ServerSessionPoolMBean,name=StdJMSPool"><attribute name="PoolName">StdJMSPool</attribute>
<attribute name="PoolFactoryClass">org.jboss.jms.asf.StdServerSessionPoolFactory</attribute>
</mbean>
<mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=OracleDB"><attribute name="Properties"></attribute>
<attribute name="URL">jdbc racle:thin:@csenet:1521:csedb</attribute>
<attribute name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl</attribute>
<attribute name="GCInterval">0</attribute>
<attribute name="IdleTimeout">0</attribute>
<attribute name="InvalidateOnError">false</attribute>
<attribute name="LoggingEnabled">false</attribute>
<attribute name="MaxSize">0</attribute>
<attribute name="Password">tiger</attribute>
<attribute name="TimestampUsed">false</attribute>
<attribute name="Blocking">false</attribute>
<attribute name="GCEnabled">false</attribute>
<attribute name="GCMinIdleTime">0</attribute>
<attribute name="IdleTimeoutEnabled">false</attribute>
<attribute name="JDBCUser">scott</attribute>
<attribute name="MaxIdleTimeoutPercent">0.0</attribute>
<attribute name="MinSize">0</attribute>
<attribute name="PoolName">OracleDB</attribute>
</mbean>
<mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="DefaultDomain:service=JMSProviderLoader,name=JBossMQProvider"><attribute name="ProviderName">DefaultJMSProvider</attribute>
<attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JBossMQProvider</attribute>
<attribute name="ProviderUrl"></attribute>
</mbean>
<mbean code="org.jboss.util.ClassPathExtension" name="DefaultDomain:service=ClassPathExtension,name=Tomcat"></mbean>
<mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=mySQLDB"><attribute name="Properties"></attribute>
<attribute name="URL">jdbc:mysql://192.168.3.50/dbHospital</attribute>
<attribute name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl</attribute>
<attribute name="GCInterval">0</attribute>
<attribute name="IdleTimeout">0</attribute>
<attribute name="InvalidateOnError">false</attribute>
<attribute name="LoggingEnabled">false</attribute>
<attribute name="MaxSize">0</attribute>
<attribute name="Password">dev_hospital</attribute>
<attribute name="TimestampUsed">false</attribute>
<attribute name="Blocking">false</attribute>
<attribute name="GCEnabled">false</attribute>
<attribute name="GCMinIdleTime">0</attribute>
<attribute name="IdleTimeoutEnabled">false</attribute>
<attribute name="JDBCUser">dev_hospital</attribute>
<attribute name="MaxIdleTimeoutPercent">0.0</attribute>
<attribute name="MinSize">0</attribute>
<attribute name="PoolName">mySQLDS</attribute>
</mbean>
<mbean code="org.jboss.security.plugins.JaasSecurityManagerService" name="Security:name=JaasSecurityManager"><attribute name="SecurityManagerClassName">org.jboss.security.plugins.JaasSecurityManager</attribute>
<attribute name="AuthenticationCacheJndiName"></attribute>
<attribute name="SecurityProxyFactoryClassName">org.jboss.security.SubjectSecurityProxyFactory</attribute>
</mbean>
<mbean code="org.jboss.logging.Logger" name="DefaultDomain:service=Log"></mbean>
<mbean code="org.jboss.resource.ConnectionFactoryLoader" name="JCA:service=ConnectionFactoryLoader,name=BlackBoxDS"><attribute name="Properties">
ConnectionURL=jdbc:mysql://192.168.3.50/dbHospital
</attribute>
<attribute name="TransactionManagerName">java:/TransactionManager</attribute>
<attribute name="FactoryName">BlackBoxDS</attribute>
<attribute name="ConnectionManagerFactoryName">MinervaSharedLocalCMFactory</attribute>
<attribute name="PrincipalMappingClass">org.jboss.resource.security.ManyToOnePrincipalMapping</attribute>
<attribute name="RARDeployerName">JCA:service=RARDeployer</attribute>
<attribute name="ConnectionManagerProperties">
# Pool type - uncomment to force, otherwise it is the default
#PoolConfiguration=per-factory
# Connection pooling properties - see
# org.opentools.minerva.pool.PoolParameters
MinSize=0
MaxSize=10
Blocking=true
GCEnabled=false
IdleTimeoutEnabled=false
InvalidateOnError=false
TrackLastUsed=false
GCIntervalMillis=120000
GCMinIdleMillis=1200000
IdleTimeoutMillis=1800000
MaxIdleTimeoutPercent=1.0
</attribute>
<attribute name="PrincipalMappingProperties">
userName=dev_hospital
password=dev_hospital
</attribute>
<attribute name="ResourceAdapterName">Black Box LocalTx Adapter</attribute>
</mbean>
<mbean code="javax.management.loading.MLet" name="DefaultDomain:service=MLet"><attribute name="LibraryDirectory">C:\jboss\bin</attribute>
</mbean>
</server>
======================================
i have a simple session bean like
===================================
public class ConverterEJB implements SessionBean {

Connection connection = null;
public Connection getConn() throws Exception{
try{
InitialContext initialContext = new InitialContext();
System.out.println("Got context one.");
DataSource ds =
(DataSource)initialContext.lookup("java:comp/env/jdbc/mySQLDSname");
System.out.println("hello 4");
if(ds==null)
System.out.println("null datasource");
System.out.println("Got mySQLDS.");
connection = ds.getConnection("dev_hospital","dev_hospital");
System.out.println("Got connection.");
}catch(Exception et){
System.out.println("exception:" + et);
}
return connection;
}
===
and i have joss.xml as
========================
<?xml version="1.0" encoding="UTF-8"?>
<jboss>
<resource-managers>
<resource-manager res-class="org.jboss.ejb.deployment.JDBCResource">
<res-name>jdbc/mySQLDSsource</res-name>
<res-jndi-name>mySQLDS</res-jndi-name>
</resource-manager>
</resource-managers>
<enterprise-beans>
<session>
<ejb-name>Converter</ejb-name>
<jndi-name>converter/Converter</jndi-name>
<resource-ref>
<res-ref-name>jdbc/mySQLDSname</res-ref-name>
<jndi-name>jdbc/mySQLDSsource</jndi-name>
</resource-ref>
</session>
</enterprise-beans>
</jboss>
===================================
and ejb-jar.xml as
=======================================
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar>
<description>JBoss Currency Converter Application</description>
<display-name>Converter EJB</display-name>
<enterprise-beans>
<session>
<ejb-name>Converter</ejb-name>
<home>ConverterHome</home>
<remote>Converter</remote>
<ejb-class>ConverterEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
<resource-ref>
<res-ref-name>jdbc/mySQLDSname</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

</session>
</enterprise-beans>
</ejb-jar>
hello,
i tried to compile and test the InterestClient.java in the Jboss documentation without using ANT and using my own bat file.. The files were compiled successfully but the bat file in execution showed errors as:
========================================================
D:\tryouts\Converter>
D:\tryouts\Converter>java -classpath ".;c:\jboss\client\ejb.jar;c:\jboss\client\
jboss-j2ee.jar;c:\jboss\client\jbossx-client.jar;c:\jboss\client\jaas.jar;c:\jbo
ss\client\jboss-client.jar;c:\jboss\client\jnp-client.jar" -Djava.naming.factory
.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.provider.url=192.
168.3.48:1099 -Djava.naming.factory.url.pkgs=org.jboss.naming rg.jnp.interface
s org.jboss.docs.interest.InterestClient
Got context
Got reference
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/security/Se
curityAssociation
at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.getPrincipal(Gener
icProxy.java:184)
at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java
:231)
at $Proxy0.create(Unknown Source)
at org.jboss.docs.interest.InterestClient.main(InterestClient.java:39)
========================================================
the bat file i made looks like..
========================================================
set C2=%JBOSS_DIST%\client
set CPATH=.;%C2%\ejb.jar;%C2%\jboss-j2ee.jar;%C2%\jbossx-client.jar;%C2%\jaas.jar;%C2%\jboss-client.jar;%C2%\jnp-client.jar
java -classpath "%CPATH%" -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.provider.url=192.168.3.48:1099 -Djava.naming.factory.url.pkgs=org.jboss.naming rg.jnp.interfaces org.jboss.docs.interest.InterestClient
========================================================
the errors says the class SecurityAssociation was not found but it is in the jar file jboss-j2ee.jar which i have included in the classpath..
the directory with the InterestClient.class has the compiled remote interface copied there too..
please help..
Thank you Tim for the reply..
I was just wandering if it is not possible to take control of the printer attached to the clients computer via a servlet as we take control of the browser the user is using to view the page.
20 years ago
Problem Statement:
i need a facility inside a HTML page generated by some servlet or may be JSP which would allow the client to click an icon within the page and print certain parts of the page only in the printer.
The concept is actually similar to generating a customeized report. THe user gets a HTML page to view within the browser, and if he wants to print it then he has an option to print the page as a report. Actually the printing is to be done on a preformatted paper with ready-made headers and lines. A simple example might be viewing an invoice in the browser and having an option to print the contents of the invoice(HTML page) on a paper in the printer which has headers(company name , and standard lines and fields like Serial No. , Particulars, Qty, amount) already printed. The problem is the printer will be on clients computer, he'll have a standard paper with standard headers printed on it. We just need to fill the items under the header, the data to print will be same as in the HTML page the user is viewing.
How can a servlet control a printer attached to the clients computer?
Please reply..
20 years ago
thankyou i'll check out the site
does the books covers j2ee datasource tranactions and connection pooling. Specially i am interested in implementing connection pooling and using j2ee datasources and transactions without using EJBs.
thank you
thank you avijeet for the reply.
yes i've tried the automatic code genaration by right clicking or using the tools menu but nothing happens when i do so. what may be the problem ?

Originally posted by Avijeet Dash:
u can represent entity beans as class with stereotype set to entity. session beans can be represented as class with stereotype control.
in rose - select the class(s) and right click to generate Java. or go to tools Java and click on generate code.


when i got the out of environment space error, i increased the initial enviromnent memory using the "command /E:nnnn" option, gave about 8192 for nnnn, it worked in my system (running windows ME).
[This message has been edited by sushil bajracharya (edited January 27, 2001).]
how do i model EJBs using UMl in rational rose 98 enterprise edition. reference to any sample rational rose file doing so would be great, also how do i make automatic code generation in rational rose work for java.