[JBoss Seam] - Re: Framework: Counting query entities
by CptnKirk
Lol, should really not drink and make forum posts. :) A combination of dsmith's solution and my components.xml should give you what you're looking for. You only need 1 small class that you reuse in components.xml. You could even write your own namespace and have your own <myframework:entity-query> tag. But that's probably overkill, the <component...> syntax isn't that verbose.
Although I haven't tried it, you may even be able to use the class attribute on <framework:entity-query> to tell Seam to use your EntityQuery subclass. If so, great. You have plenty of options.
Based on the HQL, you'd think that Hibernate should be able to look at any digested query that has a single return and determine the correct count() syntax. Even eliminate unnecessary joins like the one you have here. Given how frequently this is used I think this would be a great convenience feature, especially for folks that use the Criteria APIs.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4038001#4038001
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4038001
19 years, 2 months
[JBossWS] - No service endpoint generated?
by Schludi
Hello i have the following maven-Script added to my pom.xml which starts wstools with an ANT-Task:
|
| <artifactId>maven-antrun-plugin</artifactId>
| <executions>
| <execution>
| <id>antTask</id>
| <phase>process-classes</phase>
| <goals>
| <goal>run</goal>
| </goals>
| <configuration>
| <tasks>
| <!-- Define a taskdef for the wstools ant task
| <taskdef name="wstools" classname="org.jboss.ws.tools.ant.wstools">
| <classpath refid="library.classpath"/>
| <classpath refid="test.client.classpath"/>
| <classpath path="${build.test.classes.dir}"/>
| </taskdef>-->
| <taskdef name="wstools" classname="org.jboss.ws.tools.ant.wstools">
| <classpath refid="maven.dependency.classpath"/>
| <classpath>
| <fileset dir="C:/servers/client/">
| <include name="activation.jar"/>
| <include name="javassist.jar"/>
| <include name="jbossall-client.jar"/>
| <include name="jbossretro-rt.jar"/>
| <include name="jboss-backport-concurrent.jar"/>
| <include name="jbossws-client.jar"/>
| <include name="jboss-xml-binding.jar"/>
| <include name="jbossws14-client.jar"/>
| <include name="log4j.jar"/>
| <include name="mail.jar"/>
| </fileset>
| <fileset dir="C:/servers/lib/endorsed">
| <include name="*.jar"/>
| </fileset>
| </classpath>
| </taskdef>
| <echo message="********** Running jboss ws **************"/>
| <mkdir dir="ws" />
| <wstools dest="C:/dev/helloMaven/FirstEJB-ejb/ws"
| config="C:/dev/helloMaven/FirstEJB-ejb/resources/wstools-mybean-config.xml"/>
| </tasks>
| </configuration>
| </execution>
| </executions>
|
Here the EJB.Code
| package org.test;
|
| import java.rmi.RemoteException;
|
| import java.math.*;
| import javax.ejb.SessionBean;
| import javax.ejb.SessionContext;
|
| /**
| * Trade Session EJB manages all Trading services
| *
| * @ejb.bean name="FirstEJBBean"
| * display-name="FirstEJBBean"
| * description="A simple hello world bean."
| * local-jndi-name="FirstEJBBean"
| * type=stateless
| * view-type="service-endpoint"
| *(a)ejb.interface generate="service-endpoint"
| * service-endpoint-class="org.test.StatlessEJBEndpoint"
| *
| * @wsee.port-component name="org.test.StatlessEJBEndpointPort"
| */
| public class StatlessEjbBean implements SessionBean
| {
|
| BigDecimal yenRate = new BigDecimal("121.6000");
|
| BigDecimal euroRate = new BigDecimal("0.0077");
|
| /**
| * @ejb.interface-method view-type="service-endpoint"
| */
| public BigDecimal dollarToYen(BigDecimal dollars) {
| BigDecimal result = dollars.multiply(yenRate);
| return result.setScale(2, BigDecimal.ROUND_UP);
| }
|
| /**
| * @ejb.interface-method view-type="service-endpoint"
| */
| public BigDecimal yenToEuro(BigDecimal yen) {
| BigDecimal result = yen.multiply(euroRate);
| return result.setScale(2, BigDecimal.ROUND_UP);
| }
|
| public StatlessEjbBean() {
| }
|
| public void ejbCreate() {
| }
|
| public void ejbRemove() {
| }
|
| public void ejbActivate() {
| }
|
| public void ejbPassivate() {
| }
|
| public void setSessionContext(SessionContext sc) {
| }
| }
i get the following error:
|
| [INFO] [antrun:run {execution: antTask}]
| [INFO] Executing tasks
| [echo] ********** Running jboss ws **************
| log4j:WARN No appenders could be found for logger (org.jboss.ws.tools.WSTools).
| log4j:WARN Please initialize the log4j system properly.
| org.jboss.ws.WSException: Endpoint com.bbraun.bbmag.test.StatlessEJBEndpoint can
| not be loaded
| at org.jboss.ws.tools.helpers.ToolsHelper.handleJavaToWSDLGeneration(Too
| lsHelper.java:113)
| at org.jboss.ws.tools.WSTools.process(WSTools.java:132)
| at org.jboss.ws.tools.WSTools.generate(WSTools.java:120)
| at org.jboss.ws.tools.ant.wstools.execute(wstools.java:103)
| at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
| at org.apache.tools.ant.Task.perform(Task.java:364)
| at org.apache.tools.ant.Target.execute(Target.java:341)
| at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractA
| ntMojo.java:108)
| at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
|
| at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
| nManager.java:420)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
| ultLifecycleExecutor.java:539)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
| fecycle(DefaultLifecycleExecutor.java:480)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
| ltLifecycleExecutor.java:459)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
| dleFailures(DefaultLifecycleExecutor.java:311)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
| ts(DefaultLifecycleExecutor.java:278)
| at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
| fecycleExecutor.java:143)
| at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330)
| at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123)
| at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
| java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
| sorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:324)
| at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
| at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
| at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
|
| at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
| [INFO] ------------------------------------------------------------------------
| [ERROR] BUILD ERROR
| [INFO] ------------------------------------------------------------------------
| [INFO] Error executing ant tasks
|
| Embedded error: Error running jbossws:
| Endpoint com.bbraun.bbmag.test.StatlessEJBEndpoint cannot be loaded
| [INFO] ------------------------------------------------------------------------
| [INFO] For more information, run Maven with the -e switch
| [INFO] ------------------------------------------------------------------------
| [INFO] Total time: 1 minute 9 seconds
| [INFO] Finished at: Tue Apr 17 16:31:46 CEST 2007
| [INFO] Final Memory: 9M/20M
| [INFO] ------------------------------------------------------------------------
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037998#4037998
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037998
19 years, 2 months
[JBoss Seam] - <s:fileUpload/> IE/Firefox Filename differences
by chane
I'm using Seam1.2.0patch1.
The filename parameter on <s:fileUpload/> is different between IE and Firefox. On Firefox, I get just the filename. On IE (6.x), the path + filename is returned.
Is this expected?
My page is:
| <h:form enctype="multipart/form-data" id="f1">
| <h:commandLink action="#{backing.uploadFile}" value="Upload"/>
| <s:fileUpload id="importfile" data="#{backing.dataFile}"
| fileName="${backing.fileName}"/>
| </h:form>
|
My Bean Action is:
| public String uploadFile(){
|
| if(dataFile==null || dataFile.length==0){
| facesMessages.add("File was empty!");
| return FORM_UPLOAD;
| }
|
| verifyDirectory(step.getTemplatePath());
|
| File file = new File(step.getTemplatePath() + fileName);
| if(file.exists()){
| facesMessages.add("File already exsits! ");
| return "formUpload";
| }
|
| OutputStream bos=null;
| bos = new FileOutputStream(file);
| for(int x=0; x<dataFile.length; x++){
| bos.write(dataFile[x]);
| }
| return "success";
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037993#4037993
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037993
19 years, 2 months