[jboss-user] [JBoss Seam] - Re: How to validate only if the user entered a string

2008-01-12 Thread chrismalan
Hi Tynor,

Seam 1.2.0GA and JBoss-4.2.0.  

I downloaded hibernate validator 3.0.0 and will now use that.

Thanks very much.

Chris

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119387#4119387

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119387
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - How to validate only if the user entered a string

2008-01-12 Thread chrismalan
In the User entity bean an e-mail address is validated using @Email. It works 
fine, but the user should also be allowed not to enter anything in this field.  

The field is not annotated with @NotNull and the default in the database is 
null for this field.  However, Seam wants a value there.  The form does not 
require a value to be entered.

How do I tell Seam to make sure any value is a valid email address if something 
is entered, but to allow null through?

Thanks,

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119336#4119336

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119336
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: selectOneMenu - NullPointerException

2007-11-20 Thread chrismalan
I don't know if I have a Seam Managed Persistence Context in my components.xml. 
 I'm mailing this from work.  But I at last did get s:selectItems to work. 

What did the trick was that every @entity that is used as a source for 
s:selectItems must implement a "boolean equals(Object obj)" and an "int 
hashCode()" method.  Make sure about this last one, maybe it's getHashCode or 
something similar.

Give it a go.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106577#4106577

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106577
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: null injected values

2007-11-10 Thread chrismalan
These conversation scoped variables you are injecting should have non null 
objects backing them.  They should be outjected from one of your action beans 
(session beans).  Create a @Factory method in the relevant bean where you 
outject them to make sure they don't have null values.  When you then inject 
them somewhere else they won't have null values.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103405#4103405

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103405
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - org.hibernate.HibernateException: identifier of an instance

2007-11-09 Thread chrismalan
This is the set-up: a document belongs to a category. Category is a class with 
an ID (Integer - auto generated), a name and a description.  One category can 
have many documents.

A data table of documents is displayed.  The category is in a selectOne and the 
name is displayed.  This is what it looks like in the view:

  | 
  | 
  | 
  | 
This is what an f:selecItem looks like:

  | categoryList = new SelectItem[categories.size()];
  | int i=0;
  | for(Category cat:categories){
  | categoryList(i)=new SelectItem(cat.getCategoryID(), cat.getName());
  | i++;
  | }
  | 

The () after categoryList should be square brackets. It is seen as formatting 
and ignored.

I've tried s:selectItems and it doesn't work for me.  I get and "invalid value" 
when trying to do an update with it.  Maybe the place holders have something to 
do with it.

How can I use a selectOne to change the category of a document?  The display is 
right, the xhtml code is right, just it does not work.

Any help will be greatly appreciated.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103175#4103175

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103175
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Can s:selectItems work in this scenario?

2007-08-07 Thread chrismalan
As I am still new to Seam (read the book twice, looked at a lot of the docs and 
examples), I decided to build an application to get my feet wet.  The 
application is based on the hotel booking demo, but quite different.

One by one the problems have yielded, sometimes not without spirited resistance.

The hotels in my application are in different countries.  There is a Country 
persistence object which is merely the String country name and an Integer 
primary key.  This populates a select which is used when entering a new hotel.  
State and City are String members of Hotel.

When a person searches for hotels, I don't want to display countries without 
hotels in the database.  So I get countries selected from Country joined to 
Hotel on Country.  This is no problem.  I then use s:selectItems to create the 
select list.  This works well, too.  The problem is that the only country in 
that list (this is right, I have only one hotel entered) is seen as an invalid 
value.  Here is what is printed in the console:

  | 09:57:42,030 INFO  [STDOUT] Hibernate: select country0_.ID as ID24_0_, 
country0_.country as country24_0_ from Country country0_ where country0_.ID=?
  | 09:57:42,530 INFO  [lifecycle] WARNING: FacesMessage(s) have been enqueued, 
but may not have been displayed. 
SourceId=countries:j_id12:countrySelect[severity=(ERROR 2), 
summary=(countries:j_id12:countrySelect: Validation Error: Value is not valid), 
detail=(countries:j_id12:countrySelect: Validation Error: Value is not valid)]
  | 

Here is the code of the generated html:

  | 
  | 
  |  
  |   Choose...
  | Australia
  | 
  | 

I know that the value 0 against Australia is only a placeholder.  In the 
database 12 is the actual primary key for Australia.  This placeholder, 0, most 
likely maps somewhere in memory to the right value, which is 12.

When I used the whole list of countries instead of only the countries with 
hotels in the database, everyting worked fine.  In the whole list, Australia is 
allocated its rightful value of 12.

What could I do?  I ditched s:selectItems and replaced it with f:selectItems 
with which I can control both the label and the value.  Now everything works as 
it is intended to.  One first selects a country, then a second select with 
states in that country with hotels in the database is, displayed.  Then one 
selects a state which causes a select with cities displayed. And so forth.

Is there a way to have more control over the actual values with s:selectItems? 
Can this(explanation above) be done with s:selectItems?

s:selectItems also produced a select with just the state names as labels, and 
no values, for the list of String, states. State is not a persistent object, 
just a member of Hotel. The TreeMap with key and value of 'state' worked fine 
with f:selectItems.

Is this a scenario where s:selectItems cannot be used?   Is the placeholder 
paradigm an unnecessary complication?

JBoss 4.2.0 and Seam 1.2.1.GA

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071792#4071792

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071792
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: How do I upgrade my Seam version?

2007-07-31 Thread chrismalan
Just download the version you want and unpack it.  Then use the jars 
(jboss-seam.jar, etc.) in its root directory in your application instead of 
your older seam version jars.  If you need any of the jars in the /lib 
directory on your classpath, use them instead of others with the same name you 
may have on your machine.

You can also change into the root directory and type "ant" into a term/comand 
window.  This will create a directory with the date of the day you are doing it 
and create the three basic seam jars, compiled with the JDK on your machine.

There are some differences to the packaging if you go from an older version of 
JBoss to 4.2.0.  

As far as I know, this is about it.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069437#4069437

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069437
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Dynamically sized pop-up window

2007-07-31 Thread chrismalan
Any idea how to implement a pop-up window just big enough for an image?  I 
don't know what size images are going to be uploaded.

This is how I've done the pop-up, and it works:

pages.xml

  | 
  | 
  | 
  | 
  | 
  | 

and on the view:

  | 
  |   Show the Photo
  |   
  | 
  | 

Incidentally, not using pages.xml and supplying the URL of the pop-up page does 
not work.  The page that pops up is the same as the page on which the link was 
clicked.  The same goes for using navigation.xml

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069017#4069017

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069017
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: s:fileUpload woes

2007-07-24 Thread chrismalan
Got it.  formdata should be form-data.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067312#4067312

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4067312
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: s:fileUpload woes

2007-07-19 Thread chrismalan
Hi Markus,

Yes, it's there.  Only, I called it Seam Filter and not Seam Multipart Filter.
I changed the name, moved it up in web.xml - no luck.

A simple text input get its value propagated to the session bean.  The file 
upload input is totally invisible to the application.  

As far as I'm aware, I did everything by the book.  Where can the problem be?

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066019#4066019

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066019
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - s:fileUpload woes

2007-07-17 Thread chrismalan
s:fileUpload doesn't work for me.  Here is what I have: Seam 1.2.1.GA, 
JBoss-4.2.0.  I use xhtml, not jsp's.

In the ear I have jboss-seam.jar and in WEB-INF/lib jboss-seam-ui.jar, 
jboss-seam-debug.jar and jsf-facelets.jar.

This is what is in web.xml:


  | 
  |   org.jboss.seam.servlet.SeamListener
  | 
  | 
  | 
  |   Seam Filter
  |   org.jboss.seam.web.SeamFilter
  | 
  | 
  | 
  |  Seam Filter
  |  /*
  | 
  | 

This is the relevant part of the xhtml file:

  | 
  |   
  | Add an Image to 
  |
  |   Image File to Load
  |
  | 
  | 
  |   
  |  
  |   
  | 
  | 

This is the relevant part of hotelSessionBean:

  | @Stateful
  | @Scope(ScopeType.SESSION)
  | @Name("hotelSessionBean")
  | public class HotelSessionBean implements HotelSession {
  | 
  | @In 
  | Identity identity;
  | 
  | @PersistenceContext
  | EntityManager em;
  | 
  | private Hotel hotel;
  | private String contentType, filename, description;
  | private byte[] imageData;
  | 

When I test in hotelSessionBean.addImage() to see if the values (contentType, 
filename, imageData) arrived in the hotelSessionBean after clicking the Add an 
Image button, all those values are null.

When these values return null, the method returns with an error message I 
created.  So, no exceptions are thrown.  Before I tested the exeptions stated 
that one could not persist an Image with null values where the database 
stipulatd non-null values.

On logging in and going to the page from where to upload the image, I get this:

  | INFO  [Lifecycle] starting up: org.jboss.seam.security.identity
  | ERROR [STDERR] 18/07/2007 14:38:08 
com.sun.facelets.compiler.TagLibraryConfig loadImplicit
  | INFO: Added Library from: 
jar:file:/C:/JBoss/jboss-4.2.0.GA/server/default/tmp/deploy/tmp50450bookings.ear-contents/bookings-exp.war/WEB-INF/lib/jboss-seam-ui.jar!/META-INF/seam-ui.taglib.xml
  | ERROR [STDERR] 18/07/2007 14:38:08 
com.sun.facelets.compiler.TagLibraryConfig loadImplicit
  | INFO: Added Library from: 
jar:file:/C:/JBoss/jboss-4.2.0.GA/server/default/tmp/deploy/tmp50450bookings.ear-contents/bookings-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml
  | ERROR [STDERR] 18/07/2007 14:38:08 
com.sun.facelets.compiler.TagLibraryConfig loadImplicit
  | INFO: Added Library from: 
jar:file:/C:/JBoss/jboss-4.2.0.GA/server/default/tmp/deploy/tmp50450bookings.ear-contents/bookings-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-html.taglib.xml
  | ERROR [STDERR] 18/07/2007 14:38:08 
com.sun.facelets.compiler.TagLibraryConfig loadImplicit
  | INFO: Added Library from: 
jar:file:/C:/JBoss/jboss-4.2.0.GA/server/default/tmp/deploy/tmp50450bookings.ear-contents/bookings-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml
  | ERROR [STDERR] 18/07/2007 14:38:08 
com.sun.facelets.compiler.TagLibraryConfig loadImplicit
  | INFO: Added Library from: 
jar:file:/C:/JBoss/jboss-4.2.0.GA/server/default/tmp/deploy/tmp50450bookings.ear-contents/bookings-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-core.taglib.xml
  | ERROR [STDERR] 18/07/2007 14:38:08 
com.sun.facelets.compiler.TagLibraryConfig loadImplicit
  | INFO: Added Library from: 
jar:file:/C:/JBoss/jboss-4.2.0.GA/server/default/tmp/deploy/tmp50450bookings.ear-contents/bookings-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml
  | ***  logging in up to here
  | INFO  [STDOUT] Hibernate: select principal0_.username as username7_, 
principal0_.name as name7_, principal0_.password as password7_, 
principal0_.hotel_hotelID as hotel7_7_, principal0_.email as email7_, 
principal0_.surname as surname7_, principal0_.created as created7_ from 
Principal principal0_ where principal0_.username=? and principal0_.password=?
  | INFO  [STDOUT] Hibernate: select hotel0_.hotelID as hotelID5_1_, 
hotel0_.name as name5_1_, hotel0_.state as state5_1_, hotel0_.country as 
country5_1_, hotel0_.description as descript4_5_1_, hotel0_.city as city5_1_, 
hotel0_.stars as stars5_1_, hotel0_.street as street5_1_, hotel0_.suburb as 
suburb5_1_, country1_.ID as ID2_0_, country1_.country as country2_0_ from Hotel 
hotel0_ inner join Country country1_ on hotel0_.country=country1_.ID where 
hotel0_.hotelID=?
  | INFO  [STDOUT] Hibernate: select principalr0_.ID as ID8_, 
principalr0_.principal as principal8_, principalr0_.user_role as user3_8_ from 
PrincipalRole principalr0_ where principalr0_.principal=?
  | INFO  [STDOUT] Hibernate: select role0_.name as name9_0_, 
role0_.description as descript2_9_0_ from Role role0_ where role0_.name=?
  | INFO  [lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not 
have been displayed.
  | 

Note that the page find the right hotel for the logged in user to upload the 
image to the right hotel.

Where is my mistake?

Thanks,


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065259#4065259

Reply to the post : 
http

[jboss-user] [JBoss Seam] - option values generated by s:selectItems

2007-07-02 Thread chrismalan
The following html is generated:
admin
  | manager
  | user

It should be this:
admin
  | manager
  | user

This comes from the Role class which has an @Id annotation for the primary key, 
which is a String.

The code that produces the selectOneMenu looks like this:

  |   
  |   
  | 

"role" is the name of the entity bean, or it can be the name of the factory 
specified in components.xml - I've tried both ways.   

"roles" can either be an outjected List or the name of the query specified in 
components.xml.  Again, I've tried both ways.

The option labels are always faithfully produced.  It's the values...

This is what the relevant part of components.xml looks like when it is used:

  | 
  | 
  | 

I've looked at the ui examples, over and over.  I've tried 
roleHome.instance.name instead of role.name in h:selectOneMenu value=

The results are the same.

Any idea how I can get the option values to be correctly generated?

This is Seam 1.2.1 on JBoss 4.2.0

Thanks,

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059510#4059510

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059510
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Function 's:hasRole' not found

2007-06-27 Thread chrismalan
So far nothing helps.  The problem only arises when I perform an action from a 
xhtml page containing #{s:hasRole(... When I log in from another page and then 
request the offending page via the browser address field, everything is fine.  
The links are correctly rendered according to the role of the logged in user.  
But let me now do something sending data to the server from the page with 
#{s:hasRole(..., causing the page to be reloaded, and the function s:hasRole 
has disappeared.  Reloading the page with the browser reload button (or ctrl r) 
works fine.

Any idea on how to fix this?  

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057986#4057986

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057986
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Function 's:hasRole' not found

2007-06-24 Thread chrismalan
Hi Shane,

I downloaded 1.3.0 and tried.  That caused a whole new universe of problems. If 
I remove jboss-seam.jar from the ear and copy it to 
$JBOSS_HOME/server/default/lib everything works well. The only problem was 
 should be 

This is clearly a class loading problem.  Is the JBoss AS responsible for class 
loading, or the application?  I would think it is the AS, in which case the 
problem lies with JBoss 4.2.0.  I'll go and read up in the wiki about class 
loading.


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057235#4057235

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057235
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Function 's:hasRole' not found

2007-06-24 Thread chrismalan
Hi Gavin,

Facelets.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057175#4057175

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057175
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Function 's:hasRole' not found

2007-06-21 Thread chrismalan
In addition to the above, the stack trace in the console window gives the 
following information not found in the Seam window:

  | 15:54:29,481 ERROR [STDERR] java.lang.ClassNotFoundException: No 
ClassLoaders found for: org.jboss.seam.security.SecurityFunctions
  | 15:54:29,481 ERROR [STDERR] at 
org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
  | 15:54:29,481 ERROR [STDERR] at 
org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:514)
  | 15:54:29,481 ERROR [STDERR] at 
org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:408)
  | 15:54:29,481 ERROR [STDERR] at 
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
  | 15:54:29,481 ERROR [STDERR] at 
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
  | 15:54:29,481 ERROR [STDERR] at java.lang.Class.forName0(Native 
Method)
  | 15:54:29,481 ERROR [STDERR] at 
java.lang.Class.forName(Class.java:164)

jboss-app.xml is fine.  How can I get JBoss to supply the class-loader to load 
the class which is in jboss-seam.jar which is in the ear and duly noted in 
application.xml?

Thanks

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056730#4056730

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056730
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Function 's:hasRole' not found

2007-06-21 Thread chrismalan
PS I am using Seam 1.2.1 on JBoss-4.2.0

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056727#4056727

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056727
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Function 's:hasRole' not found

2007-06-21 Thread chrismalan
Here is a bit more of the stack trace:


  | javax.faces.FacesException: javax.el.ELException: /login.xhtml @36,93 
rendered="#{s:hasRole('manager')}": 
  | Function 's:hasRole' not found
  | at 
javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:373)
  | at javax.faces.component.UIComponent.encodeAll(UIComponent.java:880)
  | at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
  | at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
  | at 
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
  | at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)

I see this has been reported before, but no clear solution supplied.

This is the code on the page that causes the problem:


  |   
  |   
  | 

I can log in with no problem, now I want to go one step further and render a 
link depending on the role of the user who logged in.

Any ideas?  Any specific jars which I may have missed?  

Thanks,

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056726#4056726

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056726
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: How can I use a EJB Query with this?

2007-02-25 Thread chrismalan
Hi Dornus,

There are two solutions I can think of.  The first side-steps an EJB query.

One of class A's attributes will be a collections of some sort of class B.  
Simply get an instance of class A by primary key, get an instance of the 
collection of Bs and do a bees.size().

The second is to do a join.  Something like select ab from A as a join a.b as 
ab where a.PrimaryKey=PK and then again a size() on ab.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4022152#4022152

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4022152
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Cannot find a suitable constructor

2007-02-25 Thread chrismalan
I have a custom util class called LessonView.  It looks like this:

public class LessonView{
  | private String subject;
  | private int year, count;
  | 
  | public LessonView(){}
  | 
  | public LessonView(String subject, int year, int count){
  |   sets the variables via setters
  | }
  | 
  | public getters and setters
  | }

Then I have a query:
"select new LessonView(l.subject, l.year, count(*)) from Lesson l group by 
l.lesson, l.year order by l.lesson, l.year";

This throws exceptions telling me there is no suitable constructor.  When the 
count(*) is removed everything works fine.  I have used custom classes before 
with sum(whatever.k) and it worked fine.  I have also tried count(l.id), same 
results.

Any idea how to fix this?  The database is MySQL.  

Thanks,

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021964#4021964

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4021964
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Installation, Configuration & Deployment] - Re: Class not found

2006-12-28 Thread chrismalan
Hi Peter,

Here is the solution to the java time problem in Linux.  I added one line to my 
JBoss start-up script and that does it.  Here is the whole start-up script:
#!/bin/bash
  | export JBOSS_HOME=/usr/local/jboss-4.0.4.GA
  | export JAVA_OPTS=-Duser.timezone=Australia/Sydney
  | /usr/local/jboss-4.0.4.GA/bin/run.sh  

Another problem bites the dust.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3996631#3996631

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3996631
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Installation, Configuration & Deployment] - Re: Class not found

2006-12-28 Thread chrismalan
Hi Peter,

Thanks for your answer.  Clear, unambiguous and easy to implement.  I like them 
that way. ;-)

Yes, I am running Gentoo.  I am just finished updating everything - new gcc 
(4.1), new kernel (2.6.18), new KDE (3.5.5) and new everything else, including 
JDK.  

When I do "date" on the command line the time is Aussie time, Sydney, as it 
should be.  So, no problem with the system time. I'll post on the Java forums 
and see what they say.  If I get anything back I'll post it here.

I made a mistake with the time zone returned; it is not a USA zone but GMT.  We 
are in summer time and 11 hours ahead of GMT.

Thanks again.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3996613#3996613

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3996613
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Installation, Configuration & Deployment] - Class not found

2006-12-27 Thread chrismalan
There is a utility class (UsernamePasswordHandler) in the war container.  It is 
used for log-ins.  When instantiated from any class in the war container, 
things are fine.  

However, when the only class in the jar container that needs it tries to 
instantiate it, a java.lang.NoClassDefFoundError exception is thrown.

The package structure is as for EJB3, a war and a jar inside an ear.

The UsernamePasswordHandler is not mentioned in the web.xml - I don't know if 
this is relevant.

The jboss-app.xml looks like this:

  |   
  | transportsite:app=ejb3
  |   
  | 

Any idea how to solve this problem that seems to be class loader related?

As an aside, the time and dates displayed by the console as JBoss starts up are 
all 11 hours behind. Same for the log files. That safely places it in one of 
the USA time zones.  I am in Aussie.  The system time is correct.  Is this a 
JBoss problem, a log4j problem or a Java problem?  Any idea how to fix it? 
There is a timer which which needs times.  Subtracting 11 hours from the time 
the timer should fire makes things work, but that is not really the way to go.

Thanks for any help.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3996434#3996434

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3996434
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Mapping between form field and database fields

2006-12-21 Thread chrismalan
Thanks for the replies.  I thought about three fields because there are so many 
ways to enter dates; 2006-12-22, 22/12/06, 22-12-2006, etc.  Of course, with 
the examples given one can find the right date in some instances.  6-9-06 is 
harder to figure out.  Each field clearly labeled as day, month or year is 
nearly foolproof.

Of course, a date selector will also achieve that.  Although it seems like 
using a sledgehammer to crack a nut.

Thanks again,

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995743#3995743

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995743
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Mapping between form field and database fields

2006-12-20 Thread chrismalan
I'm new to Seam.  After reading some of the documentation and looking at the 
examples I'm left with one question.  Searches of the forum provide no answer.

One html form field in Seam seems to map to one attribute in a POJO which in 
turn seems to map to one field in a database.  Now say I want a day field, a 
month field and a year field in the html form, a java.sql.Date field in the 
POJO and a date field in the database, how do I do that?

I'm sure there is a way (most likely a simple way) as this the one to one 
mapping will often not do.

Thanks,

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995509#3995509

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995509
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Installation, Configuration & Deployment] - Re: Got NoClassDefFoundError when deployed to production ser

2006-11-09 Thread chrismalan
Hi Kingcu,

Which class is not found?  

All I can recommend is a step by step drill-down to find the problem.
1)Get the name of the specific class not found, e.g., xyz.dkl.Wonderful.class
2)Find out in which jar this class is
3)Make sure that jar is on your classpath at the production server

Hope this helps

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984452#3984452

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984452
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Installation, Configuration & Deployment] - Re:

2006-10-12 Thread chrismalan
http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigurePorts will show you which 
services use which ports.

Looking at your exceptions again, it seems your problems start with classes in 
subpackages of com.appiancorp.asl3.runtimefw.rta  To the best of my knowledge 
this is not part of JBoss.  It appears to be an extenrnal (to JBoss) connection 
pool manager.  Try disabling it and start JBoss again.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978040#3978040

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978040
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: List in EJB3 Entity:

2006-10-12 Thread chrismalan
Make both your List and long[] transient by annotating them as such. You will 
not be able to persist them in the database, but can use them inside your 
SimpleEntity class.  

Do not try to do too much in a persistence pojo. It is mainly, as the name 
says, an entity to persist.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=398#398

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=398
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Installation, Configuration & Deployment] - HTTP Request statistics

2006-10-12 Thread chrismalan
I have a webapplication running (www.lessonsite.com.au) and managed to get 
Tomcat to generate request logs.  Webalizer then reads these logs and generates 
very nice request statistics.  

However, the request log grows big very quickly and needs to be rotated.  I 
used logrotate for that.  Unfortunately webalizer needs the same log file to 
read from every time - request_log_2006_10_08.log and 
request_log_2006_10_09.log won't do.  Pity.  Rotating the log while the server 
runs results in an invalid new log.  The docs say stop the web server, rotate 
the logs, restart the web server.  With Apache that is quick, but with JBoss 
restarting takes the best part of a minute.

The logs grow so big quite quickly that webalizer takes more than 10 seconds to 
do its thing.  Once that crashed the server.  Resources are limited.

Does anyone know a way past this? I am thinking of running JBoss behind Apache 
which then generates the request logs.  That way only Apache needs to be 
restarted.  According to the Tomcat website the performance advantage of Apache 
over Tomcat 5 is no longer a factor.  So, I am loathe to do this.

This will be an issue for anyone running JBoss who wants request statistics.

Any ideas?

As an aside, I signed up with Google analytics to get the same statistics.  The 
figures differ.  For 11 October Google says the site got 63 visits (not hits) 
and webalizers says 85 visits.  All the Google code is where it should be in 
the web pages.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=394#394

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=394
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Installation, Configuration & Deployment] - Re:

2006-10-12 Thread chrismalan
This is a long shot: does whoever starts JBoss have permissions to write to all 
the directories in and under JBOSS_HOME?

I also vaguely remember there was an issue with the IP Address assigned to the 
machine that should be referred to somewhere.  

Why use such an old JBoss?

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977769#3977769

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977769
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Installation, Configuration & Deployment] - Re: Access Loggin

2006-09-16 Thread chrismalan
Found the solution in the Wiki pages virtual host how-to. Basically, it 
consists of a few more entries in server.xml.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972132#3972132

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972132
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Installation, Configuration & Deployment] - Re: Access Logging

2006-09-16 Thread chrismalan
I've narrowed it down a bit.  When entering the IP address to go to the JBoss 
Console, all access requests are logged. It must be because of the virtual host 
created in jboss-web.xml.

I've looked at the Tomcat Access Log Valve documentation - not a word on 
virtual hosts or anything else that may help.

Any ideas?

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972127#3972127

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972127
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Installation, Configuration & Deployment] - Access Loggin

2006-09-16 Thread chrismalan
I have a web application running on JBoss-4.0.4.GA. It is the ejb3 setup 
running as all. The OS is CentOS 4 and the JDK is JDK1.5, the latest downloaded 
about 10 days ago.

The relevant part in server.xml in 
JBOSS_HOME/server/all/deploy/jbossweb-tomcat55.sar has been uncommented to 
generate http request logs.

The trouble is that the logs look like this:
69.13.158.140 - - [16/Sep/2006:00:47:21 -0500] "GET 
/a1b2c3d4e5f6g7h8i9/nonexistentfile.php HTTP/1.0" 404 1069
  | 69.13.158.140 - - [16/Sep/2006:00:47:22 -0500] "GET /adxmlrpc.php HTTP/1.0" 
404 991
  | 69.13.158.140 - - [16/Sep/2006:00:47:22 -0500] "GET /adserver/adxmlrpc.php 
HTTP/1.0" 404 1018
  | 69.13.158.140 - - [16/Sep/2006:00:47:22 -0500] "GET /phpAdsNew/adxmlrpc.php 
HTTP/1.0" 404 1021
  | 69.13.158.140 - - [16/Sep/2006:00:47:22 -0500] "GET /phpadsnew/adxmlrpc.php 
HTTP/1.0" 404 1021

Once in a while there is a log for a page or image which actually exists on the 
server, like /, with a return code of 200.  

Visits to the site by me and others which I know about are not logged. Just 
these requests for non-existent pages with return codes of 404.

Is there any setting to be done which will get Tomcat to log all http requests?

On my machine at home everything works fine running the same stuff, albeit on a 
JBoss installed with the installer and running as default.

I'd appreciate any help.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972107#3972107

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972107
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user