dinesh thalis

Ranch Hand
+ Follow
since Nov 19, 2008
Merit badge: grant badges
For More
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 dinesh thalis

copy struts-taglib.jar into your /WEB-INF/lib directory and reference the tags in your code like



or

copy relevant tlds (like struts-html.tld) to WEB-INF
13 years ago
This is how currently my code, it works fine without any exception my application currently run on glassfish v2.1



according to your(Manuel Alberto Quero) advice change my code below show that



But it gave exception



How can I solve this issue

Thanks in advance

Thanks for reply. I'm using jboss 5.10 and netbeans 6.9.1 In here IDE can't find @IgnoreDependency , I added this also import org.jboss.annotation.IgnoreDependency; but not able to find library that contain @IgnoreDependency. please tell what is the library name should I use ?
I have two session beans, they are StudentFacade and SchooldtFacade both of them Stateless, Remote. What I need is call StudentFacade method from SchooldtFacade and vice-versa. Below show how I did it.



If run this application using Galssfish version V2.1 ,V3 work fine without any exception. If I run it using jboss-5.1.0.GA it gave below exception.




How can I solve this problem.

Thank you.
I'm using Glassfish v2.1 server in windows xp machine. I want to run Glassfish server when computer start(Windows XP). Without out putting my bat script into widows start up(C:\Documents and Settings\ABC\Start Menu\Programs\Startup). Below show my .bat script.

run.bat
-----------------
cd C:\Glassfish\bin
asadmin start-domain domain1
pause
---------------

Thank You
13 years ago
I developed simple EJB application, in that application I used Jndi-name as DefaultDS It worked perfeclty no exceptions and data goto database now I want to change Default jndi-name to another name like (mySource) if i change it to mySource i got exceptions. below show technologies I used .

EJB3, Netbeans 6.9 IDE, Mysql 5.1, Jboss 5.1 and Ubuntu 9.1

I copy mysql-connector to jboss-5.1.0.GA/server/default/lib this folder, and remove -ds.xml files in jboss-5.1.0.GA/server/default/deploy and put mysql-ds.xml to it.


Here it contain mysql-ds.xml

<datasources>
<local-tx-datasource>
<jndi-name>mySource</jndi-name>
<use-java-context>false</use-java-context>
<connection-url>jdbc:mysql://192.168.1.3:3306/Man</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>ubuntu</user-name>
<password>rahasak</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
<!-- should only be used on drivers after 3.22.1 with "ping" support
<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
-->
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->

<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>



persistent.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="JbossExample-ejbPU" transaction-type="JTA">
<provider>oracle.toplink.essentials.PersistenceProvider</provider>
<jta-data-source>java:/mySource</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties/>
</persistence-unit>
</persistence>


Below Show Errors I got



14:43:38,108 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@13658395{vfszip:/home/dinesh/jboss-5.1.0.GA/server/default/deploy/JbossExample.ear/JbossExample-ejb.jar/}
14:43:38,108 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@13658395{vfszip:/home/dinesh/jboss-5.1.0.GA/server/default/deploy/JbossExample.ear/JbossExample-ejb.jar/}
14:43:38,108 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@13658395{vfszip:/home/dinesh/jboss-5.1.0.GA/server/default/deploy/JbossExample.ear/JbossExample-ejb.jar/}
14:43:38,108 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@13658395{vfszip:/home/dinesh/jboss-5.1.0.GA/server/default/deploy/JbossExample.ear/JbossExample-ejb.jar/}
14:43:38,537 INFO [JBossASKernel] Created KernelDeployment for: JbossExample-ejb.jar
14:43:38,545 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=JbossExample.ear,jar=JbossExample-ejb.jar,name=ChildFacade,service=EJB3
14:43:38,545 INFO [JBossASKernel] with dependencies:
14:43:38,545 INFO [JBossASKernel] and demands:
14:43:38,545 INFO [JBossASKernel] persistence.unit:unitName=JbossExample.ear/JbossExample-ejb.jar#JbossExample-ejbPU
14:43:38,545 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
14:43:38,545 INFO [JBossASKernel] and supplies:
14:43:38,545 INFO [JBossASKernel] jndi:JbossExample/ChildFacade/remote-Session.ChildFacadeRemote
14:43:38,545 INFO [JBossASKernel] Class:Session.ChildFacadeRemote
14:43:38,545 INFO [JBossASKernel] jndi:JbossExample/ChildFacade/remote
14:43:38,545 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=JbossExample.ear,jar=JbossExample-ejb.jar,name=ChildFacade,service=EJB3) to KernelDeployment of: JbossExample-ejb.jar
14:43:38,966 INFO [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@9e3acc{name=jboss.j2ee:ear=JbossExample.ear,jar=JbossExample-ejb.jar,name=ChildFacade,service=EJB3_endpoint bean=org.jboss.ejb3.endpoint.deployers.impl.EndpointImpl properties=[container] constructor=null autowireCandidate=true}
14:43:38,973 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=JbossExample.ear/JbossExample-ejb.jar#JbossExample-ejbPU
14:43:38,974 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=JbossExample.ear/JbossExample-ejb.jar#JbossExample-ejbPU state=Create
javax.naming.NameNotFoundException: mySource not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.jboss.jpa.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:111)
at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:275)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
14:43:39,007 INFO [TomcatDeployment] deploy, ctxPath=/JbossExample-war
14:43:39,059 WARN [HDScanner] Failed to process changes
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):



DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "jboss.j2ee:ear=JbossExample.ear,jar=JbossExample-ejb.jar,name=ChildFacade,service=EJB3" is missing the following dependencies:
Dependency "<UNKNOWN jboss.j2ee:ear=JbossExample.ear,jar=JbossExample-ejb.jar,name=ChildFacade,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'persistence.unit:unitName=JbossExample.ear/JbossExample-ejb.jar#JbossExample-ejbPU' **")
Dependency "<UNKNOWN jboss.j2ee:ear=JbossExample.ear,jar=JbossExample-ejb.jar,name=ChildFacade,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **")
Deployment "jboss.j2ee:ear=JbossExample.ear,jar=JbossExample-ejb.jar,name=ChildFacade,service=EJB3_endpoint" is missing the following dependencies:
Dependency "jboss.j2ee:ear=JbossExample.ear,jar=JbossExample-ejb.jar,name=ChildFacade,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")



DEPLOYMENTS IN ERROR:
Deployment "persistence.unit:unitName=JbossExample.ear/JbossExample-ejb.jar#JbossExample-ejbPU" is in error due to the following reason(s): javax.naming.NameNotFoundException: mySource not bound
Deployment "<UNKNOWN jboss.j2ee:ear=JbossExample.ear,jar=JbossExample-ejb.jar,name=ChildFacade,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **, ** UNRESOLVED Demands 'persistence.unit:unitName=JbossExample.ear/JbossExample-ejb.jar#JbossExample-ejbPU' **



at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)


14:44:04,268 INFO [[/JbossExample-war]] Marking servlet addRecord as unavailable
14:44:04,268 ERROR [[addRecord]] Allocate exception for servlet addRecord
javax.naming.NameNotFoundException: JbossExample not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1346)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:817)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
at org.jboss.ejb3.JndiUtil.lookup(JndiUtil.java:44)
at org.jboss.injection.JndiPropertyInjector.lookup(JndiPropertyInjector.java:75)
at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:99)
at org.jboss.web.tomcat.service.TomcatInjectionContainer.processInjectors(TomcatInjectionContainer.java:366)
at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:271)
at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:265)
at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:256)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1006)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:777)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)


Please help me to do it. i suffered Internet but unable to solve the problem, Is their any other files should i changed in Joss to this? I'm waiting for you're precious reply's.


Thank You.
13 years ago
I'm working with mysql 5.1 / glassfish v2 .1 /EJB3/JDK6
I want from a nativequery read a field of CHAR(n) in a database, when I user varchar , it s works, but if i use char(n), I always get a Character instead of a String.

When i user native query to retrive data then I get a java.lang.Character instead of a String.



How can solve this. please help me if this can't i have to change whole database architecture. Therefore I should do this.
Thanks for reply, so I want to create outer join but that table(secondary) haven't relation with main table, In that case how can I create it.
Below show my query, In here main table is "Account" , Joining table is "Customer". How can I write left outer join.



Account Entity




Customer Entity



Please How can I resolve it.
Thank You.
According to your post , you have mention that without locking can be achieved the optimistic locking - please give me some reference link.
In a mission critical system like a banking system how to handle the concurrent access like this;

User A :- Get the particular account record and watching it.
User B :- At the same time get that record and change it committed.
User A :- Now change the account record and committed.

Using version concept(Only Version annotation without em.lock) can we eliminate the concurrent problem?



I have big problem in my application that is concurrency issue(stop simultaneous data update). I'm new to Database locking after reading EJB3 in Action book I decided to use optimistic lock for handle this issue, below show my code I'm using CMT. It seems to be not handle concurrency issue. I looking example in internet more that one week but still I'm fail. Please guide me to solve this issue (If you can provide sample example it's great help to my studies). I'm using mysql 5.1, Glassfish 2.1, Netbeans 6.8 in Ubuntu 9.10 environment. I also added version annotation in my entity class.



please give you're precious comments.
Marembo Ochieng' I think you're wrong

1) @TransactionAttribute(TransactionAttributeType.REQUIRED) use in Container Manage Transaction not User Manage Transaction

2) If I use TransactionAttributeType.REQUIRED - If the method is invoked from a nontransactional client, the container will start a transaction before the method is called and finish it when the method returns. On the other hand, if the caller invokes the method from a transactional context, the method will join the existing transaction. Two Transaction not happen -- according EJB3 in Action book page 219

3) I don't think Container Manage Transaction not handle Database locking automatically if this true please provide such links.

Please give you're precious comments if I wrong or write.

I'm totally confused , if I change persistent provide Toplink to Hibernate work fine why ? please give me comments
I'm using Container Manage Transaction(CMT), below show my entity class

Role.java




Update method



After execute above method earlier mention exception happen. My role table contain only one recode and all columns data equal to 1. please help me to overcome this problem.
Without query.executeUpdate(); every thing work fine if I put query.executeUpdate(); exception happen